Documentation ¶
Index ¶
- func WithMetadataApiClientFactory(f func(name string) (traits.MetadataApiClient, error)) router.Option
- func WithMetadataInfoClientFactory(f func(name string) (traits.MetadataInfoClient, error)) router.Option
- type ApiRouter
- func (r *ApiRouter) Add(name string, client any) any
- func (r *ApiRouter) AddMetadataApiClient(name string, client traits.MetadataApiClient) traits.MetadataApiClient
- func (r *ApiRouter) GetMetadata(ctx context.Context, request *traits.GetMetadataRequest) (*traits.Metadata, error)
- func (r *ApiRouter) GetMetadataApiClient(name string) (traits.MetadataApiClient, error)
- func (r *ApiRouter) HoldsType(client any) bool
- func (r *ApiRouter) PullMetadata(request *traits.PullMetadataRequest, ...) error
- func (r *ApiRouter) Register(server grpc.ServiceRegistrar)
- func (r *ApiRouter) RemoveMetadataApiClient(name string) traits.MetadataApiClient
- type ApiWrapper
- type Collection
- func (m *Collection) DeleteMetadata(name string, opts ...resource.WriteOption) (*traits.Metadata, error)
- func (m *Collection) GetMetadata(name string, opts ...resource.ReadOption) (*traits.Metadata, error)
- func (m *Collection) ListMetadata(opts ...resource.ReadOption) []*traits.Metadata
- func (m *Collection) MergeMetadata(name string, metadata *traits.Metadata, opts ...resource.WriteOption) (*traits.Metadata, error)
- func (m *Collection) PullAllMetadata(ctx context.Context, opts ...resource.ReadOption) <-chan CollectionChange
- func (m *Collection) PullMetadata(ctx context.Context, name string, opts ...resource.ReadOption) <-chan *traits.PullMetadataResponse_Change
- func (m *Collection) UpdateMetadata(name string, metadata *traits.Metadata, opts ...resource.WriteOption) (*traits.Metadata, error)
- func (m *Collection) UpdateTraitMetadata(name string, traitMetadata *traits.TraitMetadata, opts ...resource.WriteOption) (*traits.Metadata, error)
- type CollectionChange
- type CollectionServer
- type InfoRouter
- func (r *InfoRouter) Add(name string, client any) any
- func (r *InfoRouter) AddMetadataInfoClient(name string, client traits.MetadataInfoClient) traits.MetadataInfoClient
- func (r *InfoRouter) GetMetadataInfoClient(name string) (traits.MetadataInfoClient, error)
- func (r *InfoRouter) HoldsType(client any) bool
- func (r *InfoRouter) Register(server grpc.ServiceRegistrar)
- func (r *InfoRouter) RemoveMetadataInfoClient(name string) traits.MetadataInfoClient
- type InfoWrapper
- type Model
- func (m *Model) GetMetadata(opts ...resource.ReadOption) (*traits.Metadata, error)
- func (m *Model) MergeMetadata(metadata *traits.Metadata, opts ...resource.WriteOption) (*traits.Metadata, error)
- func (m *Model) PullMetadata(ctx context.Context, opts ...resource.ReadOption) <-chan *traits.PullMetadataResponse_Change
- func (m *Model) UpdateMetadata(metadata *traits.Metadata, opts ...resource.WriteOption) (*traits.Metadata, error)
- func (m *Model) UpdateTraitMetadata(traitMetadata *traits.TraitMetadata, opts ...resource.WriteOption) (*traits.Metadata, error)
- type ModelServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithMetadataApiClientFactory ¶
func WithMetadataApiClientFactory(f func(name string) (traits.MetadataApiClient, error)) router.Option
WithMetadataApiClientFactory instructs the router to create a new client the first time Get is called for that name.
func WithMetadataInfoClientFactory ¶
func WithMetadataInfoClientFactory(f func(name string) (traits.MetadataInfoClient, error)) router.Option
WithMetadataInfoClientFactory instructs the router to create a new client the first time Get is called for that name.
Types ¶
type ApiRouter ¶
type ApiRouter struct { traits.UnimplementedMetadataApiServer router.Router }
ApiRouter is a traits.MetadataApiServer that allows routing named requests to specific traits.MetadataApiClient
func NewApiRouter ¶
func (*ApiRouter) Add ¶
Add extends Router.Add to panic if client is not of type traits.MetadataApiClient.
func (*ApiRouter) AddMetadataApiClient ¶
func (r *ApiRouter) AddMetadataApiClient(name string, client traits.MetadataApiClient) traits.MetadataApiClient
func (*ApiRouter) GetMetadata ¶
func (*ApiRouter) GetMetadataApiClient ¶
func (r *ApiRouter) GetMetadataApiClient(name string) (traits.MetadataApiClient, error)
func (*ApiRouter) PullMetadata ¶
func (r *ApiRouter) PullMetadata(request *traits.PullMetadataRequest, server traits.MetadataApi_PullMetadataServer) error
func (*ApiRouter) Register ¶
func (r *ApiRouter) Register(server grpc.ServiceRegistrar)
func (*ApiRouter) RemoveMetadataApiClient ¶
func (r *ApiRouter) RemoveMetadataApiClient(name string) traits.MetadataApiClient
type ApiWrapper ¶
type ApiWrapper struct { traits.MetadataApiClient // contains filtered or unexported fields }
func WrapApi ¶
func WrapApi(server traits.MetadataApiServer) *ApiWrapper
WrapApi adapts a traits.MetadataApiServer and presents it as a traits.MetadataApiClient
func (*ApiWrapper) Unwrap ¶
func (w *ApiWrapper) Unwrap() any
Unwrap implements wrap.Unwrapper and returns the underlying server instance as an unknown type.
func (*ApiWrapper) UnwrapServer ¶
func (w *ApiWrapper) UnwrapServer() traits.MetadataApiServer
UnwrapServer returns the underlying server instance.
func (*ApiWrapper) UnwrapService ¶
func (w *ApiWrapper) UnwrapService() (grpc.ClientConnInterface, grpc.ServiceDesc)
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func NewCollection ¶
func NewCollection(opts ...resource.Option) *Collection
func (*Collection) DeleteMetadata ¶
func (m *Collection) DeleteMetadata(name string, opts ...resource.WriteOption) (*traits.Metadata, error)
func (*Collection) GetMetadata ¶
func (m *Collection) GetMetadata(name string, opts ...resource.ReadOption) (*traits.Metadata, error)
func (*Collection) ListMetadata ¶
func (m *Collection) ListMetadata(opts ...resource.ReadOption) []*traits.Metadata
func (*Collection) MergeMetadata ¶
func (m *Collection) MergeMetadata(name string, metadata *traits.Metadata, opts ...resource.WriteOption) (*traits.Metadata, error)
MergeMetadata writes any present fields in metadata to the existing data. Traits that exist in the given metadata are merged with existing traits, so that each trait appears only once and the 'more' maps are merged.
func (*Collection) PullAllMetadata ¶
func (m *Collection) PullAllMetadata(ctx context.Context, opts ...resource.ReadOption) <-chan CollectionChange
func (*Collection) PullMetadata ¶
func (m *Collection) PullMetadata(ctx context.Context, name string, opts ...resource.ReadOption) <-chan *traits.PullMetadataResponse_Change
func (*Collection) UpdateMetadata ¶
func (m *Collection) UpdateMetadata(name string, metadata *traits.Metadata, opts ...resource.WriteOption) (*traits.Metadata, error)
func (*Collection) UpdateTraitMetadata ¶
func (m *Collection) UpdateTraitMetadata(name string, traitMetadata *traits.TraitMetadata, opts ...resource.WriteOption) (*traits.Metadata, error)
type CollectionChange ¶
type CollectionServer ¶
type CollectionServer struct { traits.UnimplementedMetadataApiServer // contains filtered or unexported fields }
func NewCollectionServer ¶
func NewCollectionServer(model *Collection) *CollectionServer
func (*CollectionServer) GetMetadata ¶
func (s *CollectionServer) GetMetadata(_ context.Context, request *traits.GetMetadataRequest) (*traits.Metadata, error)
func (*CollectionServer) PullMetadata ¶
func (s *CollectionServer) PullMetadata(request *traits.PullMetadataRequest, server traits.MetadataApi_PullMetadataServer) error
func (*CollectionServer) Unwrap ¶
func (s *CollectionServer) Unwrap() any
type InfoRouter ¶
type InfoRouter struct { traits.UnimplementedMetadataInfoServer router.Router }
InfoRouter is a traits.MetadataInfoServer that allows routing named requests to specific traits.MetadataInfoClient
func NewInfoRouter ¶
func NewInfoRouter(opts ...router.Option) *InfoRouter
func (*InfoRouter) Add ¶
func (r *InfoRouter) Add(name string, client any) any
Add extends Router.Add to panic if client is not of type traits.MetadataInfoClient.
func (*InfoRouter) AddMetadataInfoClient ¶
func (r *InfoRouter) AddMetadataInfoClient(name string, client traits.MetadataInfoClient) traits.MetadataInfoClient
func (*InfoRouter) GetMetadataInfoClient ¶
func (r *InfoRouter) GetMetadataInfoClient(name string) (traits.MetadataInfoClient, error)
func (*InfoRouter) HoldsType ¶
func (r *InfoRouter) HoldsType(client any) bool
func (*InfoRouter) Register ¶
func (r *InfoRouter) Register(server grpc.ServiceRegistrar)
func (*InfoRouter) RemoveMetadataInfoClient ¶
func (r *InfoRouter) RemoveMetadataInfoClient(name string) traits.MetadataInfoClient
type InfoWrapper ¶
type InfoWrapper struct { traits.MetadataInfoClient // contains filtered or unexported fields }
func WrapInfo ¶
func WrapInfo(server traits.MetadataInfoServer) *InfoWrapper
WrapInfo adapts a traits.MetadataInfoServer and presents it as a traits.MetadataInfoClient
func (*InfoWrapper) Unwrap ¶
func (w *InfoWrapper) Unwrap() any
Unwrap implements wrap.Unwrapper and returns the underlying server instance as an unknown type.
func (*InfoWrapper) UnwrapServer ¶
func (w *InfoWrapper) UnwrapServer() traits.MetadataInfoServer
UnwrapServer returns the underlying server instance.
func (*InfoWrapper) UnwrapService ¶
func (w *InfoWrapper) UnwrapService() (grpc.ClientConnInterface, grpc.ServiceDesc)
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) GetMetadata ¶
func (*Model) MergeMetadata ¶
func (m *Model) MergeMetadata(metadata *traits.Metadata, opts ...resource.WriteOption) (*traits.Metadata, error)
MergeMetadata writes any present fields in metadata to the existing data. Traits that exist in the given metadata are merged with existing traits, so that each trait appears only once and the 'more' maps are merged.
func (*Model) PullMetadata ¶
func (m *Model) PullMetadata(ctx context.Context, opts ...resource.ReadOption) <-chan *traits.PullMetadataResponse_Change
func (*Model) UpdateMetadata ¶
func (*Model) UpdateTraitMetadata ¶
func (m *Model) UpdateTraitMetadata(traitMetadata *traits.TraitMetadata, opts ...resource.WriteOption) (*traits.Metadata, error)
type ModelServer ¶
type ModelServer struct { traits.UnimplementedMetadataApiServer // contains filtered or unexported fields }
func NewModelServer ¶
func NewModelServer(model *Model) *ModelServer
func (*ModelServer) GetMetadata ¶
func (s *ModelServer) GetMetadata(_ context.Context, request *traits.GetMetadataRequest) (*traits.Metadata, error)
func (*ModelServer) PullMetadata ¶
func (s *ModelServer) PullMetadata(request *traits.PullMetadataRequest, server traits.MetadataApi_PullMetadataServer) error
func (*ModelServer) Register ¶
func (s *ModelServer) Register(server grpc.ServiceRegistrar)
func (*ModelServer) Unwrap ¶
func (s *ModelServer) Unwrap() any