metadata

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 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.43"

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

View Source
const ServiceName = "metadata"

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", "add", "update_record", "revoke"}

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 NewAddEndpoint

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

NewAddEndpoint returns an endpoint function that calls the method "add" of service "metadata".

func NewListEndpoint

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

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

func NewReadEndpoint

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

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

func NewRevokeEndpoint

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

NewRevokeEndpoint returns an endpoint function that calls the method "revoke" of service "metadata".

func NewUpdateRecordEndpoint

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

NewUpdateRecordEndpoint returns an endpoint function that calls the method "update_record" of service "metadata".

Types

type AddMetaRT

type AddMetaRT struct {
	// Reference to record created
	RecordID string
}

AddMetaRT is the result type of the metadata service add method.

type AddPayload

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

AddPayload is the payload type of the metadata service add 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
}

Something wasn't right with this request

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 Endpoints

type Endpoints struct {
	Read         goa.Endpoint
	List         goa.Endpoint
	Add          goa.Endpoint
	UpdateRecord goa.Endpoint
	Revoke       goa.Endpoint
}

Endpoints wraps the "metadata" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

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

type InvalidParameterT added in v0.39.0

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

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

func (*InvalidParameterT) Error added in v0.39.0

func (e *InvalidParameterT) Error() string

Error returns an error description.

func (*InvalidParameterT) ErrorName deprecated added in v0.39.0

func (e *InvalidParameterT) ErrorName() string

ErrorName returns "InvalidParameterT".

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

func (*InvalidParameterT) GoaErrorName added in v0.39.0

func (e *InvalidParameterT) GoaErrorName() string

GoaErrorName returns "InvalidParameterT".

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 ListMetaRT

type ListMetaRT struct {
	// List of metadata records
	Items []*MetadataListItemRT
	// Entity for which to request metadata
	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
}

ListMetaRT is the result type of the metadata service list method.

type ListPayload

type ListPayload struct {
	// Entity for which to request metadata
	EntityID *string `json:"entity-id,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
	AspectPath *string `json:"aspect-path,omitempty"`
	// Return metadata 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
	// The 'orderby' query option allows clients to request resources in either
	// ascending order using asc or descending order using desc. If asc or desc not
	// specified,
	// then the resources will be ordered in ascending order. The request below
	// orders Trips on
	// property EndsAt in descending order.
	OrderBy string `json:"order-by,omitempty"`
	// When set order result in descending order. Ascending order is the default.
	OrderDesc *bool `json:"order-desc,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 metadata service list method.

type MetadataListItemRT

type MetadataListItemRT struct {
	// ID
	ID string
	// Entity ID
	Entity string
	// Schema ID
	Schema string
	// Attached metadata aspect
	Aspect any
	// If aspectPath was defined, this is what matched the query
	AspectContext *string
}

type MetadataRecordRT

type MetadataRecordRT struct {
	// ID
	ID string
	// Entity ID
	Entity string
	// Schema ID
	Schema string
	// Attached metadata aspect
	Aspect any
	// 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 revoking this record at 'valid-to'
	Revoker *string
	Links   []*LinkT
}

MetadataRecordRT is the result type of the metadata service read 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 ReadPayload

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

ReadPayload is the payload type of the metadata 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 RevokePayload

type RevokePayload struct {
	// Record ID to restract
	ID *string
	// JWT used for authentication
	JWT string
}

RevokePayload is the payload type of the metadata service revoke method.

type Service

type Service interface {
	// Show metadata by ID
	Read(context.Context, *ReadPayload) (res *MetadataRecordRT, err error)
	// Return a list of metadata records.
	List(context.Context, *ListPayload) (res *ListMetaRT, err error)
	// Attach new metadata to an entity.
	Add(context.Context, *AddPayload) (res *AddMetaRT, err error)
	// Revoke this record and create a new one with the information provided.
	// For any field not provided, the value from the current record is used.
	UpdateRecord(context.Context, *UpdateRecordPayload) (res *AddMetaRT, err error)
	// Retract a previously created statement.
	Revoke(context.Context, *RevokePayload) (err error)
}

Manages the life cycle of metadata attached to an entity.

type ServiceNotAvailableT

type ServiceNotAvailableT struct {
}

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 UpdateRecordPayload

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

UpdateRecordPayload is the payload type of the metadata service update_record method.

Jump to

Keyboard shortcuts

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