metadata

package
v0.28.9 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 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 = [6]string{"read", "list", "add", "update_one", "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 added in v0.27.2

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

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

func NewListEndpoint added in v0.27.2

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

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

func NewReadEndpoint added in v0.27.2

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

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

func NewRevokeEndpoint added in v0.27.2

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

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

func NewUpdateOneEndpoint added in v0.27.2

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

NewUpdateOneEndpoint returns an endpoint function that calls the method "update_one" of service "metadata".

func NewUpdateRecordEndpoint added in v0.27.2

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

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

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 record created
	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 `json:"entity-id,omitempty"`
	// Schema of metadata
	Schema string
	// Aspect content
	Aspect interface{}
	// 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
}

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 Endpoints added in v0.27.2

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

Endpoints wraps the "metadata" service endpoints.

func NewEndpoints added in v0.27.2

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use added in v0.27.2

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

Use applies the given middleware to all the "metadata" 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 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 `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"`
	// 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 *string
}

type MetadataRecordRT

type MetadataRecordRT struct {
	// Record ID
	RecordID *string
	// Entity ID
	Entity *string
	// Schema ID
	Schema *string
	// Attached metadata aspect
	Aspect interface{}
	// Time this record was asserted
	ValidFrom *string
	// Time this record was revoked
	ValidTo *string
	// Entity asserting this metadata record at 'valid-from'
	Asserter *string
	// Entity revoking this record at 'valid-to'
	Revoker *string
}

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 {
	// 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 a record for the same entity and same schema and create new one
	// with the provided properties. __NOTE__, this method will fail if there is
	// more than one active record for the entity/schema pair.
	UpdateOne(context.Context, *UpdateOnePayload) (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 {
}

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".

type UpdateOnePayload added in v0.27.0

type UpdateOnePayload 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 interface{}
	// 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
}

UpdateOnePayload is the payload type of the metadata service update_one method.

type UpdateRecordPayload added in v0.27.0

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 interface{}
	// 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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