api

package
v1.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2022 License: BSD-3-Clause Imports: 55 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrConflict is returned when a conflict is detected.
	ErrConflict = goa.NewErrorClass("conflict", 409)
)

Functions

func CancelWithRequest

func CancelWithRequest(ctx context.Context, req *http.Request) context.Context

func DatadogTx added in v1.0.9

func DatadogTx() goa.Middleware

DatadogTx creates a request datadog middleware.

func HasAccessToElement

func HasAccessToElement(ctx context.Context, ids ...rankdb.ElementID) error

HasAccessToElement returns true Not optimized for big lists of IDs.

func HasAccessToList

func HasAccessToList(ctx context.Context, ids ...rankdb.ListID) error

func InitDatadog added in v1.0.9

func InitDatadog(ctx context.Context, o DatadogOptions)

func InitNewRelic

func InitNewRelic(ctx context.Context, o NewRelicOptions)

func LoadJWTPublicKeys

func LoadJWTPublicKeys() ([]*rsa.PublicKey, error)

LoadJWTPublicKeys loads PEM encoded RSA public keys used to validate and decrypt the JWT.

func NewJWTMiddleware

func NewJWTMiddleware() (goa.Middleware, error)

NewJWTMiddleware creates a middleware that checks for the presence of a JWT Authorization header and validates its content. A real app would probably use goa's JWT security middleware instead.

Note: the code below assumes the example is compiled against the master branch of goa. If compiling against goa v1 the call to jwt.New needs to be:

middleware := jwt.New(keys, ForceFail(), app.NewJWTSecurity())

func NewRelicTx

func NewRelicTx() goa.Middleware

NewRelicTx creates a request new relic middleware. If verbose is true then the middlware logs the request and response bodies.

func SetLogger

func SetLogger() goa.Middleware

SetLogger attaches loggers to the request.

func ShutdownMiddleware

func ShutdownMiddleware(h goa.Handler) goa.Handler

ShutdownMiddleware rejects request once shutdown starts.

func StartServer

func StartServer(ctx context.Context, confData io.Reader, lr *logrus.Logger) error

func StartServices

func StartServices(logger goa.LogAdapter, ctx context.Context)

func UpdateRequest

func UpdateRequest(ctx context.Context) (done func(), err error)

Types

type BackupController

type BackupController struct {
	*goa.Controller
}

BackupController implements the backup resource.

func NewBackupController

func NewBackupController(service *goa.Service) *BackupController

NewBackupController creates a backup controller.

func (*BackupController) Delete

Delete runs the delete action.

func (*BackupController) Status

Status runs the status action.

type DatadogOptions added in v1.0.9

type DatadogOptions struct {
	Enabled bool
}

type ElementsController

type ElementsController struct {
	*goa.Controller
}

ElementsController implements the list-elements resource.

func NewElementsController

func NewElementsController(service *goa.Service) *ElementsController

NewElementsController creates a list-elements controller.

func (*ElementsController) Create

Create runs the create action.

func (*ElementsController) Delete

Delete runs the delete action.

func (*ElementsController) DeleteMulti

DeleteMulti runs the delete action.

func (*ElementsController) Get

Get runs the get action.

func (*ElementsController) GetAround

GetNear runs the get-near action.

func (*ElementsController) GetMulti

GetMulti runs the get-multi action.

func (*ElementsController) Put

Put runs the put action.

func (*ElementsController) PutMulti

Put runs the put action.

type HealthController

type HealthController struct {
	*goa.Controller
	// contains filtered or unexported fields
}

HealthController implements the health resource.

func NewHealthController

func NewHealthController(service *goa.Service) *HealthController

NewHealthController creates a health controller.

func (*HealthController) Health

Health runs the health action.

func (*HealthController) Root

Root allows to ping the server.

type JWTController

type JWTController struct {
	*goa.Controller
	// contains filtered or unexported fields
}

JWTController implements the jwt resource.

func NewJWTController

func NewJWTController(service *goa.Service) (*JWTController, error)

NewJWTController creates a jwt controller.

func (*JWTController) JWT

func (c *JWTController) JWT(ctx *app.JWTJWTContext) error

JWT runs the jwt action.

type ListsController

type ListsController struct {
	*goa.Controller
}

ListsController implements the lists resource.

func NewListsController

func NewListsController(service *goa.Service) *ListsController

NewListsController creates a lists controller.

func (*ListsController) Clone

func (c *ListsController) Clone(ctx *app.CloneListsContext) error

Clone runs the clone action.

func (*ListsController) Create

func (c *ListsController) Create(ctx *app.CreateListsContext) error

Create runs the create action.

func (*ListsController) Delete

func (c *ListsController) Delete(ctx *app.DeleteListsContext) error

Delete runs the delete action.

func (*ListsController) Get

Get runs the get action.

func (*ListsController) GetAll

func (c *ListsController) GetAll(ctx *app.GetAllListsContext) error

GetAll runs the get_all action.

func (*ListsController) GetPercentile

func (c *ListsController) GetPercentile(ctx *app.GetPercentileListsContext) error

GetPercentile runs the get-percentile action.

func (*ListsController) GetRange

func (c *ListsController) GetRange(ctx *app.GetRangeListsContext) error

GetRange runs the get-range action.

func (*ListsController) Reindex

func (c *ListsController) Reindex(ctx *app.ReindexListsContext) error

Reindex runs the reindex action.

func (*ListsController) Repair

func (c *ListsController) Repair(ctx *app.RepairListsContext) error

Reindex runs the reindex action.

func (*ListsController) Verify

func (c *ListsController) Verify(ctx *app.VerifyListsContext) error

Verify runs the verify action.

type MultilistController

type MultilistController struct {
	*goa.Controller
}

MultilistController implements the multilist-elements resource.

func NewMultilistElementsController

func NewMultilistElementsController(service *goa.Service) *MultilistController

NewMultilistElementsController creates a multilist-elements controller.

func (*MultilistController) Backup

Create runs the create action.

func (*MultilistController) Create

Create runs the create action.

func (*MultilistController) Delete

Delete runs the delete action.

func (*MultilistController) Get

Get runs the get action.

func (*MultilistController) Put

Put runs the put action.

func (*MultilistController) Reindex

Reindex runs the reindex action.

func (*MultilistController) Restore

Create runs the create action.

func (*MultilistController) Verify

Create runs the create action.

type NewRelicOptions

type NewRelicOptions struct {
	AppName           string
	License           string
	RecordCustomEvent bool
	TxTracerThreshold duration
	ExcludeAttributes []string
	HostDisplayName   string
	Enabled           bool
}

type StaticController

type StaticController struct {
	*goa.Controller
}

StaticController implements the static resource.

func NewStaticController

func NewStaticController(service *goa.Service) *StaticController

NewStaticController creates a static controller.

Directories

Path Synopsis
app
Package design contains the API design used for generating goa models and controllers.
Package design contains the API design used for generating goa models and controllers.
tool
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL