catalog

package
v0.0.0-...-520f1c6 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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

type CatalogErrorPayload struct {
	// Name of catalog
	CatalogName string
	// JWT
	Token string
}

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 NewClient

func NewClient(refresh, refreshAll, catalogError goa.Endpoint) *Client

NewClient initializes a "catalog" service client given the endpoints.

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) Refresh

func (c *Client) Refresh(ctx context.Context, p *RefreshPayload) (res *Job, err error)

Refresh calls the "Refresh" endpoint of the "catalog" service.

func (*Client) RefreshAll

func (c *Client) RefreshAll(ctx context.Context, p *RefreshAllPayload) (res []*Job, err error)

RefreshAll calls the "RefreshAll" endpoint of the "catalog" service.

type Endpoints

type Endpoints struct {
	Refresh      goa.Endpoint
	RefreshAll   goa.Endpoint
	CatalogError goa.Endpoint
}

Endpoints wraps the "catalog" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "catalog" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "catalog" service 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

type RefreshPayload struct {
	// Name of catalog
	CatalogName string
	// JWT
	Token string
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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