Documentation
¶
Index ¶
- Constants
- Variables
- func MakeInternalError(err error) *goa.ServiceError
- func MakeNotFound(err error) *goa.ServiceError
- func NewCatalogErrorEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewRefreshAllEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewRefreshEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewViewedJob(res *Job, view string) *catalogviews.Job
- type Auther
- type CatalogErrorPayload
- type CatalogErrorResult
- type CatalogErrors
- type Client
- type Endpoints
- type Job
- type RefreshAllPayload
- type RefreshPayload
- type Service
Constants ¶
const ServiceName = "catalog"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [3]string{"Refresh", "RefreshAll", "CatalogError"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func MakeInternalError ¶
func MakeInternalError(err error) *goa.ServiceError
MakeInternalError builds a goa.ServiceError from an error.
func MakeNotFound ¶
func MakeNotFound(err error) *goa.ServiceError
MakeNotFound builds a goa.ServiceError from an error.
func NewCatalogErrorEndpoint ¶
func NewCatalogErrorEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewCatalogErrorEndpoint returns an endpoint function that calls the method "CatalogError" of service "catalog".
func NewRefreshAllEndpoint ¶
func NewRefreshAllEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewRefreshAllEndpoint returns an endpoint function that calls the method "RefreshAll" of service "catalog".
func NewRefreshEndpoint ¶
func NewRefreshEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewRefreshEndpoint returns an endpoint function that calls the method "Refresh" of service "catalog".
func NewViewedJob ¶
func NewViewedJob(res *Job, view string) *catalogviews.Job
NewViewedJob initializes viewed result type Job from result type Job using the given view.
Types ¶
type Auther ¶
type Auther interface {
// JWTAuth implements the authorization logic for the JWT security scheme.
JWTAuth(ctx context.Context, token string, schema *security.JWTScheme) (context.Context, error)
}
Auther defines the authorization functions to be implemented by the service.
type CatalogErrorPayload ¶
CatalogErrorPayload is the payload type of the catalog service CatalogError method.
type CatalogErrorResult ¶
type CatalogErrorResult struct {
// Catalog errors
Data []*CatalogErrors
}
CatalogErrorResult is the result type of the catalog service CatalogError method.
type CatalogErrors ¶
type CatalogErrors struct {
// Catalog Errror type
Type string
// Catalog Error message
Errors []string
}
CatalogErrors define the errors that occurred during catalog refresh
type Client ¶
type Client struct {
RefreshEndpoint goa.Endpoint
RefreshAllEndpoint goa.Endpoint
CatalogErrorEndpoint goa.Endpoint
}
Client is the "catalog" service client.
func (*Client) CatalogError ¶
func (c *Client) CatalogError(ctx context.Context, p *CatalogErrorPayload) (res *CatalogErrorResult, err error)
CatalogError calls the "CatalogError" endpoint of the "catalog" service.
func (*Client) RefreshAll ¶
RefreshAll calls the "RefreshAll" endpoint of the "catalog" service.
type Endpoints ¶
Endpoints wraps the "catalog" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "catalog" service with endpoints.
type Job ¶
type Job struct {
// id of the job
ID uint
// Name of the catalog
CatalogName string
// status of the job
Status string
}
Job is the result type of the catalog service Refresh method.
func NewJob ¶
func NewJob(vres *catalogviews.Job) *Job
NewJob initializes result type Job from viewed result type Job.
type RefreshAllPayload ¶
type RefreshAllPayload struct {
// JWT
Token string
}
RefreshAllPayload is the payload type of the catalog service RefreshAll method.
type RefreshPayload ¶
RefreshPayload is the payload type of the catalog service Refresh method.
type Service ¶
type Service interface {
// Refresh a Catalog by it's name
Refresh(context.Context, *RefreshPayload) (res *Job, err error)
// Refresh all catalogs
RefreshAll(context.Context, *RefreshAllPayload) (res []*Job, err error)
// List all errors occurred refreshing a catalog
CatalogError(context.Context, *CatalogErrorPayload) (res *CatalogErrorResult, err error)
}
The Catalog Service exposes endpoints to interact with catalogs