Documentation ¶
Index ¶
- func InitialCount() *traits.Count
- func WithCountApiClientFactory(f func(name string) (traits.CountApiClient, error)) router.Option
- func WithCountInfoClientFactory(f func(name string) (traits.CountInfoClient, error)) router.Option
- type ApiRouter
- func (r *ApiRouter) Add(name string, client any) any
- func (r *ApiRouter) AddCountApiClient(name string, client traits.CountApiClient) traits.CountApiClient
- func (r *ApiRouter) GetCount(ctx context.Context, request *traits.GetCountRequest) (*traits.Count, error)
- func (r *ApiRouter) GetCountApiClient(name string) (traits.CountApiClient, error)
- func (r *ApiRouter) HoldsType(client any) bool
- func (r *ApiRouter) PullCounts(request *traits.PullCountsRequest, server traits.CountApi_PullCountsServer) error
- func (r *ApiRouter) Register(server grpc.ServiceRegistrar)
- func (r *ApiRouter) RemoveCountApiClient(name string) traits.CountApiClient
- func (r *ApiRouter) ResetCount(ctx context.Context, request *traits.ResetCountRequest) (*traits.Count, error)
- func (r *ApiRouter) UpdateCount(ctx context.Context, request *traits.UpdateCountRequest) (*traits.Count, error)
- type ApiWrapper
- type InfoRouter
- func (r *InfoRouter) Add(name string, client any) any
- func (r *InfoRouter) AddCountInfoClient(name string, client traits.CountInfoClient) traits.CountInfoClient
- func (r *InfoRouter) DescribeCount(ctx context.Context, request *traits.DescribeCountRequest) (*traits.CountSupport, error)
- func (r *InfoRouter) GetCountInfoClient(name string) (traits.CountInfoClient, error)
- func (r *InfoRouter) HoldsType(client any) bool
- func (r *InfoRouter) Register(server grpc.ServiceRegistrar)
- func (r *InfoRouter) RemoveCountInfoClient(name string) traits.CountInfoClient
- type InfoWrapper
- type MemoryDevice
- func (t *MemoryDevice) GetCount(_ context.Context, req *traits.GetCountRequest) (*traits.Count, error)
- func (t *MemoryDevice) PullCounts(request *traits.PullCountsRequest, server traits.CountApi_PullCountsServer) error
- func (t *MemoryDevice) ResetCount(_ context.Context, request *traits.ResetCountRequest) (*traits.Count, error)
- func (t *MemoryDevice) UpdateCount(_ context.Context, request *traits.UpdateCountRequest) (*traits.Count, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitialCount ¶
func WithCountApiClientFactory ¶
WithCountApiClientFactory instructs the router to create a new client the first time Get is called for that name.
func WithCountInfoClientFactory ¶
WithCountInfoClientFactory instructs the router to create a new client the first time Get is called for that name.
Types ¶
type ApiRouter ¶
type ApiRouter struct { traits.UnimplementedCountApiServer router.Router }
ApiRouter is a traits.CountApiServer that allows routing named requests to specific traits.CountApiClient
func NewApiRouter ¶
func (*ApiRouter) Add ¶
Add extends Router.Add to panic if client is not of type traits.CountApiClient.
func (*ApiRouter) AddCountApiClient ¶
func (r *ApiRouter) AddCountApiClient(name string, client traits.CountApiClient) traits.CountApiClient
func (*ApiRouter) GetCountApiClient ¶
func (r *ApiRouter) GetCountApiClient(name string) (traits.CountApiClient, error)
func (*ApiRouter) PullCounts ¶
func (r *ApiRouter) PullCounts(request *traits.PullCountsRequest, server traits.CountApi_PullCountsServer) error
func (*ApiRouter) Register ¶
func (r *ApiRouter) Register(server grpc.ServiceRegistrar)
func (*ApiRouter) RemoveCountApiClient ¶
func (r *ApiRouter) RemoveCountApiClient(name string) traits.CountApiClient
func (*ApiRouter) ResetCount ¶
func (*ApiRouter) UpdateCount ¶
type ApiWrapper ¶
type ApiWrapper struct { traits.CountApiClient // contains filtered or unexported fields }
func WrapApi ¶
func WrapApi(server traits.CountApiServer) *ApiWrapper
WrapApi adapts a traits.CountApiServer and presents it as a traits.CountApiClient
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.CountApiServer
UnwrapServer returns the underlying server instance.
func (*ApiWrapper) UnwrapService ¶
func (w *ApiWrapper) UnwrapService() (grpc.ClientConnInterface, grpc.ServiceDesc)
type InfoRouter ¶
type InfoRouter struct { traits.UnimplementedCountInfoServer router.Router }
InfoRouter is a traits.CountInfoServer that allows routing named requests to specific traits.CountInfoClient
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.CountInfoClient.
func (*InfoRouter) AddCountInfoClient ¶
func (r *InfoRouter) AddCountInfoClient(name string, client traits.CountInfoClient) traits.CountInfoClient
func (*InfoRouter) DescribeCount ¶
func (r *InfoRouter) DescribeCount(ctx context.Context, request *traits.DescribeCountRequest) (*traits.CountSupport, error)
func (*InfoRouter) GetCountInfoClient ¶
func (r *InfoRouter) GetCountInfoClient(name string) (traits.CountInfoClient, error)
func (*InfoRouter) HoldsType ¶
func (r *InfoRouter) HoldsType(client any) bool
func (*InfoRouter) Register ¶
func (r *InfoRouter) Register(server grpc.ServiceRegistrar)
func (*InfoRouter) RemoveCountInfoClient ¶
func (r *InfoRouter) RemoveCountInfoClient(name string) traits.CountInfoClient
type InfoWrapper ¶
type InfoWrapper struct { traits.CountInfoClient // contains filtered or unexported fields }
func WrapInfo ¶
func WrapInfo(server traits.CountInfoServer) *InfoWrapper
WrapInfo adapts a traits.CountInfoServer and presents it as a traits.CountInfoClient
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.CountInfoServer
UnwrapServer returns the underlying server instance.
func (*InfoWrapper) UnwrapService ¶
func (w *InfoWrapper) UnwrapService() (grpc.ClientConnInterface, grpc.ServiceDesc)
type MemoryDevice ¶
type MemoryDevice struct { traits.UnimplementedCountApiServer // contains filtered or unexported fields }
func NewMemoryDevice ¶
func NewMemoryDevice() *MemoryDevice
func (*MemoryDevice) GetCount ¶
func (t *MemoryDevice) GetCount(_ context.Context, req *traits.GetCountRequest) (*traits.Count, error)
func (*MemoryDevice) PullCounts ¶
func (t *MemoryDevice) PullCounts(request *traits.PullCountsRequest, server traits.CountApi_PullCountsServer) error
func (*MemoryDevice) ResetCount ¶
func (t *MemoryDevice) ResetCount(_ context.Context, request *traits.ResetCountRequest) (*traits.Count, error)
func (*MemoryDevice) UpdateCount ¶
func (t *MemoryDevice) UpdateCount(_ context.Context, request *traits.UpdateCountRequest) (*traits.Count, error)