aspect

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "ivcap"

APIName is the name of the API as defined in the design.

View Source
const APIVersion = "0.35"

APIVersion is the version of the API as defined in the design.

View Source
const ServiceName = "aspect"

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 = [5]string{"read", "list", "create", "update", "retract"}

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 NewCreateEndpoint

func NewCreateEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewCreateEndpoint returns an endpoint function that calls the method "create" of service "aspect".

func NewListEndpoint

func NewListEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewListEndpoint returns an endpoint function that calls the method "list" of service "aspect".

func NewReadEndpoint

func NewReadEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewReadEndpoint returns an endpoint function that calls the method "read" of service "aspect".

func NewRetractEndpoint

func NewRetractEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewRetractEndpoint returns an endpoint function that calls the method "retract" of service "aspect".

func NewUpdateEndpoint

func NewUpdateEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewUpdateEndpoint returns an endpoint function that calls the method "update" of service "aspect".

Types

type AspectIDRT

type AspectIDRT struct {
	// ID
	ID string
}

AspectIDRT is the result type of the aspect service create method.

type AspectListItemRT

type AspectListItemRT struct {
	// ID
	ID string
	// Entity URN
	Entity string
	// Schema URN
	Schema string
	// Attached aspect aspect
	Content any
	// Content-Type header, MUST be of application/json.
	ContentType string `json:"content-type,omitempty"`
	// Time this assertion became valid
	ValidFrom *string
	// Time this assertion became valid
	ValidTo *string
}

type AspectListRT

type AspectListRT struct {
	// List of aspect descriptions
	Items []*AspectListItemRT
	// Entity for which to request aspect
	Entity *string
	// Optional schema to filter on
	Schema *string
	// Optional json path to further filter on returned list
	AspectPath *string
	// Time at which this list was valid
	AtTime string
	Links  []*LinkT
}

AspectListRT is the result type of the aspect service list method.

type AspectRT

type AspectRT struct {
	// ID
	ID string
	// Entity URN
	Entity string
	// Schema URN
	Schema string
	// Description of aspect encoded as 'content-type'
	Content any
	// Content-Type header, MUST be of application/json.
	ContentType string `json:"content-type,omitempty"`
	// Time this record was asserted
	ValidFrom string
	// Time this record was retracted
	ValidTo *string
	// Entity asserting this metadata record at 'valid-from'
	Asserter string
	// Entity retracting this record at 'valid-to'
	Retracter *string
	Links     []*LinkT
}

AspectRT is the result type of the aspect service read method.

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 BadRequestT

type BadRequestT struct {
	// Information message
	Message string
}

Bad arguments supplied.

func (*BadRequestT) Error

func (e *BadRequestT) Error() string

Error returns an error description.

func (*BadRequestT) ErrorName deprecated

func (e *BadRequestT) ErrorName() string

ErrorName returns "BadRequestT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*BadRequestT) GoaErrorName

func (e *BadRequestT) GoaErrorName() string

GoaErrorName returns "BadRequestT".

type CreatePayload

type CreatePayload struct {
	// Entity to which attach aspect
	Entity string `json:"entity,omitempty"`
	// Schema of the aspect in payload
	Schema string
	// Aspect content
	Content any
	// Optionally, an existing aspect this new one will replace (retract)
	Replaces *string
	// Content-Type header, MUST be of application/json.
	ContentType string `json:"content-type,omitempty"`
	// Policy guiding visibility and actions performed
	Policy *string `json:"policy,omitempty"`
	// JWT used for authentication
	JWT string
}

CreatePayload is the payload type of the aspect service create method.

type Endpoints

type Endpoints struct {
	Read    goa.Endpoint
	List    goa.Endpoint
	Create  goa.Endpoint
	Update  goa.Endpoint
	Retract goa.Endpoint
}

Endpoints wraps the "aspect" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

Use applies the given middleware to all the "aspect" service endpoints.

type InvalidCredentialsT

type InvalidCredentialsT struct {
}

Provided credential is not valid.

func (*InvalidCredentialsT) Error

func (e *InvalidCredentialsT) Error() string

Error returns an error description.

func (*InvalidCredentialsT) ErrorName deprecated

func (e *InvalidCredentialsT) ErrorName() string

ErrorName returns "InvalidCredentialsT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*InvalidCredentialsT) GoaErrorName

func (e *InvalidCredentialsT) GoaErrorName() string

GoaErrorName returns "InvalidCredentialsT".

type InvalidParameterValue

type InvalidParameterValue struct {
	// message describing expected type or pattern.
	Message string
	// name of parameter.
	Name string
	// provided parameter value.
	Value *string
}

InvalidParameterValue is the error returned when a parameter has the wrong value.

func (*InvalidParameterValue) Error

func (e *InvalidParameterValue) Error() string

Error returns an error description.

func (*InvalidParameterValue) ErrorName deprecated

func (e *InvalidParameterValue) ErrorName() string

ErrorName returns "InvalidParameterValue".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*InvalidParameterValue) GoaErrorName

func (e *InvalidParameterValue) GoaErrorName() string

GoaErrorName returns "InvalidParameterValue".

type InvalidScopesT

type InvalidScopesT struct {
	// ID of involved resource
	ID *string
	// Message of error
	Message string
}

Caller not authorized to access required scope.

func (*InvalidScopesT) Error

func (e *InvalidScopesT) Error() string

Error returns an error description.

func (*InvalidScopesT) ErrorName deprecated

func (e *InvalidScopesT) ErrorName() string

ErrorName returns "InvalidScopesT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*InvalidScopesT) GoaErrorName

func (e *InvalidScopesT) GoaErrorName() string

GoaErrorName returns "InvalidScopesT".

type LinkT added in v0.30.0

type LinkT struct {
	// relation type
	Rel string
	// mime type
	Type string
	// web link
	Href string
}

type ListPayload

type ListPayload struct {
	// Optional entity for which to request aspects
	Entity *string `json:"entity,omitempty"`
	// Schema prefix using '%' as wildcard indicator
	Schema *string
	// To learn more about the supported format, see
	// https://www.postgresql.org/docs/current/datatype-json.html#DATATYPE-JSONPATH
	ContentPath *string `json:"content-path,omitempty"`
	// Return aspect which where valid at that time [now]
	AtTime *string `json:"at-time,omitempty"`
	// The 'limit' system query option requests the number of items in the queried
	// collection to be included in the result.
	Limit int
	// The 'filter' system query option allows clients to filter a collection of
	// resources that are addressed by a request URL. The expression specified with
	// 'filter'
	// is evaluated for each resource in the collection, and only items where the
	// expression
	// evaluates to true are included in the response.
	Filter string

	OrderBy string `json:"order-by,omitempty"`
	// Set the sort direction 'ASC', 'DESC' for each order-by element.
	OrderDirection string `json:"order-direction,omitempty"`
	// When set, also include aspect content in list.
	IncludeContent *bool `json:"include-content,omitempty"`
	// The content of '$page' is returned in the 'links' part of a previous query
	// and
	// will when set, ALL other parameters, except for 'limit' are ignored.
	Page *string
	// JWT used for authentication
	JWT string
}

ListPayload is the payload type of the aspect service list method.

type NotImplementedT

type NotImplementedT struct {
	// Information message
	Message string
}

Method is not yet implemented.

func (*NotImplementedT) Error

func (e *NotImplementedT) Error() string

Error returns an error description.

func (*NotImplementedT) ErrorName deprecated

func (e *NotImplementedT) ErrorName() string

ErrorName returns "NotImplementedT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*NotImplementedT) GoaErrorName

func (e *NotImplementedT) GoaErrorName() string

GoaErrorName returns "NotImplementedT".

type NotUniqueResource added in v0.34.1

type NotUniqueResource struct {
	// message describing expected type or pattern.
	Message string
}

NotUniqueResource indicates that the method found more than the expected zero or one existing resources.

func (*NotUniqueResource) Error added in v0.34.1

func (e *NotUniqueResource) Error() string

Error returns an error description.

func (*NotUniqueResource) ErrorName deprecated added in v0.34.1

func (e *NotUniqueResource) ErrorName() string

ErrorName returns "NotUniqueResource".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*NotUniqueResource) GoaErrorName added in v0.34.1

func (e *NotUniqueResource) GoaErrorName() string

GoaErrorName returns "NotUniqueResource".

type ReadPayload

type ReadPayload struct {
	// ID of aspects to show
	ID string
	// JWT used for authentication
	JWT string
}

ReadPayload is the payload type of the aspect service read method.

type ResourceNotFoundT

type ResourceNotFoundT struct {
	// ID of missing resource
	ID string
	// Message of error
	Message string
}

NotFound is the type returned when attempting to manage a resource that does not exist.

func (*ResourceNotFoundT) Error

func (e *ResourceNotFoundT) Error() string

Error returns an error description.

func (*ResourceNotFoundT) ErrorName deprecated

func (e *ResourceNotFoundT) ErrorName() string

ErrorName returns "ResourceNotFoundT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*ResourceNotFoundT) GoaErrorName

func (e *ResourceNotFoundT) GoaErrorName() string

GoaErrorName returns "ResourceNotFoundT".

type RetractPayload

type RetractPayload struct {
	// Aspect ID to restract
	ID string
	// JWT used for authentication
	JWT string
}

RetractPayload is the payload type of the aspect service retract method.

type Service

type Service interface {
	// Show aspects by ID
	Read(context.Context, *ReadPayload) (res *AspectRT, err error)
	// Return a list of aspect aspects.
	List(context.Context, *ListPayload) (res *AspectListRT, err error)
	// Attach new aspect to an entity.
	Create(context.Context, *CreatePayload) (res *AspectIDRT, err error)
	// A convenience method which will create a new aspect, but will also
	// retract a potentially existing aspect for the same entity with the same
	// schema.
	Update(context.Context, *UpdatePayload) (res *AspectIDRT, err error)
	// Retract a previously created statement.
	Retract(context.Context, *RetractPayload) (err error)
}

Manages the life cycle of aspect(s) attached to some entity.

type ServiceNotAvailableT

type ServiceNotAvailableT struct {
}

ServiceNotAvailable is the type returned when the service necessary to fulfil the request is currently not available.

func (*ServiceNotAvailableT) Error

func (e *ServiceNotAvailableT) Error() string

Error returns an error description.

func (*ServiceNotAvailableT) ErrorName deprecated

func (e *ServiceNotAvailableT) ErrorName() string

ErrorName returns "ServiceNotAvailableT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*ServiceNotAvailableT) GoaErrorName

func (e *ServiceNotAvailableT) GoaErrorName() string

GoaErrorName returns "ServiceNotAvailableT".

type UnauthorizedT

type UnauthorizedT struct {
}

Unauthorized access to resource

func (*UnauthorizedT) Error

func (e *UnauthorizedT) Error() string

Error returns an error description.

func (*UnauthorizedT) ErrorName deprecated

func (e *UnauthorizedT) ErrorName() string

ErrorName returns "UnauthorizedT".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*UnauthorizedT) GoaErrorName

func (e *UnauthorizedT) GoaErrorName() string

GoaErrorName returns "UnauthorizedT".

type UnsupportedContentType

type UnsupportedContentType struct {
	// message describing expected type or pattern.
	Message string
}

UnsupportedContentType is the error returned when the provided content type is not supported.

func (*UnsupportedContentType) Error

func (e *UnsupportedContentType) Error() string

Error returns an error description.

func (*UnsupportedContentType) ErrorName deprecated

func (e *UnsupportedContentType) ErrorName() string

ErrorName returns "UnsupportedContentType".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*UnsupportedContentType) GoaErrorName

func (e *UnsupportedContentType) GoaErrorName() string

GoaErrorName returns "UnsupportedContentType".

type UpdatePayload

type UpdatePayload struct {
	// Entity to which attach aspect
	Entity string `json:"entity,omitempty"`
	// Schema of aspect
	Schema string
	// Aspect content
	Content any
	// Content-Type header, MUST be of application/json.
	ContentType string `json:"content-type,omitempty"`
	// Policy guiding visibility and actions performed
	Policy *string `json:"policy,omitempty"`
	// JWT used for authentication
	JWT string
}

UpdatePayload is the payload type of the aspect service update method.

Jump to

Keyboard shortcuts

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