metadata

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

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 = [4]string{"list", "read", "add", "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 NewViewedAddMetaRT

func NewViewedAddMetaRT(res *AddMetaRT, view string) *metadataviews.AddMetaRT

NewViewedAddMetaRT initializes viewed result type AddMetaRT from result type AddMetaRT using the given view.

func NewViewedListMetaRT

func NewViewedListMetaRT(res *ListMetaRT, view string) *metadataviews.ListMetaRT

NewViewedListMetaRT initializes viewed result type ListMetaRT from result type ListMetaRT using the given view.

func NewViewedMetadataRecordRT

func NewViewedMetadataRecordRT(res *MetadataRecordRT, view string) *metadataviews.MetadataRecordRT

NewViewedMetadataRecordRT initializes viewed result type MetadataRecordRT from result type MetadataRecordRT using the given view.

Types

type AddMetaRT

type AddMetaRT struct {
	// Reference to service requested
	RecordID string
}

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

func NewAddMetaRT

func NewAddMetaRT(vres *metadataviews.AddMetaRT) *AddMetaRT

NewAddMetaRT initializes result type AddMetaRT from viewed result type AddMetaRT.

type AddPayload

type AddPayload struct {
	// Entity to which attach metadata
	EntityID string
	// Schema of metadata
	Schema string
	// Content-Type header, MUST be of application/json.
	ContentType *string
	// JWT used for authentication
	JWT string
}

AddPayload is the payload type of the metadata service add method.

type AddRequestData added in v0.20.0

type AddRequestData struct {
	// Payload is the method payload.
	Payload *AddPayload
	// Body streams the HTTP request body.
	Body io.ReadCloser
}

AddRequestData holds both the payload and the HTTP request body reader of the 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
}

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 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 ListMetaRT

type ListMetaRT struct {
	// List of metadata records
	Records []*MetadataListItemRT
	// Entity for which to request metadata
	EntityID *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
	// Navigation links
	Links *NavT
}

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

func NewListMetaRT

func NewListMetaRT(vres *metadataviews.ListMetaRT) *ListMetaRT

NewListMetaRT initializes result type ListMetaRT from viewed result type ListMetaRT.

type ListPayload

type ListPayload struct {
	// Entity for which to request metadata
	EntityID *string
	// Optional schema to filter on
	Schema *string
	// To learn more about the supported format, see
	// https://www.postgresql.org/docs/current/datatype-json.html#DATATYPE-JSONPATH
	AspectPath *string
	// Return metadata which where valid at that time [now]
	AtTime *string
	// The $limit system query option requests the number of items in the queried
	// collection to be included in the result.
	Limit int
	// 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 {
	// Record ID
	RecordID *string
	// Entity ID
	Entity *string
	// Schema ID
	Schema *string
	// Attached metadata aspect
	Aspect interface{}
	// If aspectPath was defined, this is what matched the query
	AspectContext interface{}
}

type MetadataRecordRT

type MetadataRecordRT struct {
	// Record ID
	RecordID *string
	// Entity ID
	Entity *string
	// Schema ID
	Schema *string
	// Attached metadata aspect
	Aspect interface{}
}

MetadataRecordRT is the result type of the metadata service read method.

func NewMetadataRecordRT

func NewMetadataRecordRT(vres *metadataviews.MetadataRecordRT) *MetadataRecordRT

NewMetadataRecordRT initializes result type MetadataRecordRT from viewed result type MetadataRecordRT.

type NavT struct {
	Self  *string
	First *string
	Next  *string
}

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 {
	// Return a list of metadata records.
	List(context.Context, *ListPayload) (res *ListMetaRT, err error)
	// Show metadata by ID
	Read(context.Context, *ReadPayload) (res *MetadataRecordRT, err error)
	// Attach new metadata to an entity.
	Add(context.Context, *AddPayload, io.ReadCloser) (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 {
}

ServiceNotAvailable is the type returned when the service necessary to fulfill 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".

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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