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
- func WrapApi(server traits.CountApiServer) traits.CountApiClient
- func WrapInfo(server traits.CountInfoServer) traits.CountInfoClient
- 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.Server)
- 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 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.Server)
- func (r *InfoRouter) RemoveCountInfoClient(name string) traits.CountInfoClient
- 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.
func WrapApi ¶
func WrapApi(server traits.CountApiServer) traits.CountApiClient
WrapApi adapts a traits.CountApiServer and presents it as a traits.CountApiClient
func WrapInfo ¶
func WrapInfo(server traits.CountInfoServer) traits.CountInfoClient
WrapInfo adapts a traits.CountInfoServer and presents it as a traits.CountInfoClient
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) RemoveCountApiClient ¶
func (r *ApiRouter) RemoveCountApiClient(name string) traits.CountApiClient
func (*ApiRouter) ResetCount ¶
func (*ApiRouter) UpdateCount ¶
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.Server)
func (*InfoRouter) RemoveCountInfoClient ¶
func (r *InfoRouter) RemoveCountInfoClient(name string) traits.CountInfoClient
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)