Documentation ¶
Index ¶
- func WithWasteApiClientFactory(f func(name string) (traits.WasteApiClient, error)) router.Option
- func WithWasteInfoClientFactory(f func(name string) (traits.WasteInfoClient, error)) router.Option
- type ApiRouter
- func (r *ApiRouter) Add(name string, client any) any
- func (r *ApiRouter) AddWasteApiClient(name string, client traits.WasteApiClient) traits.WasteApiClient
- func (r *ApiRouter) GetWasteApiClient(name string) (traits.WasteApiClient, error)
- func (r *ApiRouter) HoldsType(client any) bool
- func (r *ApiRouter) ListWasteRecords(ctx context.Context, request *traits.ListWasteRecordsRequest) (*traits.ListWasteRecordsResponse, error)
- func (r *ApiRouter) PullWasteRecords(request *traits.PullWasteRecordsRequest, ...) error
- func (r *ApiRouter) Register(server grpc.ServiceRegistrar)
- func (r *ApiRouter) RemoveWasteApiClient(name string) traits.WasteApiClient
- type ApiWrapper
- type InfoRouter
- func (r *InfoRouter) Add(name string, client any) any
- func (r *InfoRouter) AddWasteInfoClient(name string, client traits.WasteInfoClient) traits.WasteInfoClient
- func (r *InfoRouter) DescribeWasteRecord(ctx context.Context, request *traits.DescribeWasteRecordRequest) (*traits.WasteRecordSupport, error)
- func (r *InfoRouter) GetWasteInfoClient(name string) (traits.WasteInfoClient, error)
- func (r *InfoRouter) HoldsType(client any) bool
- func (r *InfoRouter) Register(server grpc.ServiceRegistrar)
- func (r *InfoRouter) RemoveWasteInfoClient(name string) traits.WasteInfoClient
- type InfoWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithWasteApiClientFactory ¶
WithWasteApiClientFactory instructs the router to create a new client the first time Get is called for that name.
func WithWasteInfoClientFactory ¶
WithWasteInfoClientFactory instructs the router to create a new client the first time Get is called for that name.
Types ¶
type ApiRouter ¶
type ApiRouter struct { traits.UnimplementedWasteApiServer router.Router }
ApiRouter is a traits.WasteApiServer that allows routing named requests to specific traits.WasteApiClient
func NewApiRouter ¶
func (*ApiRouter) Add ¶
Add extends Router.Add to panic if client is not of type traits.WasteApiClient.
func (*ApiRouter) AddWasteApiClient ¶
func (r *ApiRouter) AddWasteApiClient(name string, client traits.WasteApiClient) traits.WasteApiClient
func (*ApiRouter) GetWasteApiClient ¶
func (r *ApiRouter) GetWasteApiClient(name string) (traits.WasteApiClient, error)
func (*ApiRouter) ListWasteRecords ¶
func (r *ApiRouter) ListWasteRecords(ctx context.Context, request *traits.ListWasteRecordsRequest) (*traits.ListWasteRecordsResponse, error)
func (*ApiRouter) PullWasteRecords ¶
func (r *ApiRouter) PullWasteRecords(request *traits.PullWasteRecordsRequest, server traits.WasteApi_PullWasteRecordsServer) error
func (*ApiRouter) Register ¶
func (r *ApiRouter) Register(server grpc.ServiceRegistrar)
func (*ApiRouter) RemoveWasteApiClient ¶
func (r *ApiRouter) RemoveWasteApiClient(name string) traits.WasteApiClient
type ApiWrapper ¶
type ApiWrapper struct { traits.WasteApiClient // contains filtered or unexported fields }
func WrapApi ¶
func WrapApi(server traits.WasteApiServer) *ApiWrapper
WrapApi adapts a traits.WasteApiServer and presents it as a traits.WasteApiClient
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.WasteApiServer
UnwrapServer returns the underlying server instance.
func (*ApiWrapper) UnwrapService ¶
func (w *ApiWrapper) UnwrapService() (grpc.ClientConnInterface, grpc.ServiceDesc)
type InfoRouter ¶
type InfoRouter struct { traits.UnimplementedWasteInfoServer router.Router }
InfoRouter is a traits.WasteInfoServer that allows routing named requests to specific traits.WasteInfoClient
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.WasteInfoClient.
func (*InfoRouter) AddWasteInfoClient ¶
func (r *InfoRouter) AddWasteInfoClient(name string, client traits.WasteInfoClient) traits.WasteInfoClient
func (*InfoRouter) DescribeWasteRecord ¶
func (r *InfoRouter) DescribeWasteRecord(ctx context.Context, request *traits.DescribeWasteRecordRequest) (*traits.WasteRecordSupport, error)
func (*InfoRouter) GetWasteInfoClient ¶
func (r *InfoRouter) GetWasteInfoClient(name string) (traits.WasteInfoClient, error)
func (*InfoRouter) HoldsType ¶
func (r *InfoRouter) HoldsType(client any) bool
func (*InfoRouter) Register ¶
func (r *InfoRouter) Register(server grpc.ServiceRegistrar)
func (*InfoRouter) RemoveWasteInfoClient ¶
func (r *InfoRouter) RemoveWasteInfoClient(name string) traits.WasteInfoClient
type InfoWrapper ¶
type InfoWrapper struct { traits.WasteInfoClient // contains filtered or unexported fields }
func WrapInfo ¶
func WrapInfo(server traits.WasteInfoServer) *InfoWrapper
WrapInfo adapts a traits.WasteInfoServer and presents it as a traits.WasteInfoClient
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.WasteInfoServer
UnwrapServer returns the underlying server instance.
func (*InfoWrapper) UnwrapService ¶
func (w *InfoWrapper) UnwrapService() (grpc.ClientConnInterface, grpc.ServiceDesc)