Documentation
¶
Index ¶
- func WithBrightnessSensorApiClientFactory(f func(name string) (traits.BrightnessSensorApiClient, error)) router.Option
- func WithBrightnessSensorInfoClientFactory(f func(name string) (traits.BrightnessSensorInfoClient, error)) router.Option
- type ApiRouter
- func (r *ApiRouter) Add(name string, client any) any
- func (r *ApiRouter) AddBrightnessSensorApiClient(name string, client traits.BrightnessSensorApiClient) traits.BrightnessSensorApiClient
- func (r *ApiRouter) GetAmbientBrightness(ctx context.Context, request *traits.GetAmbientBrightnessRequest) (*traits.AmbientBrightness, error)
- func (r *ApiRouter) GetBrightnessSensorApiClient(name string) (traits.BrightnessSensorApiClient, error)
- func (r *ApiRouter) HoldsType(client any) bool
- func (r *ApiRouter) PullAmbientBrightness(request *traits.PullAmbientBrightnessRequest, ...) error
- func (r *ApiRouter) Register(server grpc.ServiceRegistrar)
- func (r *ApiRouter) RemoveBrightnessSensorApiClient(name string) traits.BrightnessSensorApiClient
- type ApiWrapper
- type InfoRouter
- func (r *InfoRouter) Add(name string, client any) any
- func (r *InfoRouter) AddBrightnessSensorInfoClient(name string, client traits.BrightnessSensorInfoClient) traits.BrightnessSensorInfoClient
- func (r *InfoRouter) DescribeAmbientBrightness(ctx context.Context, request *traits.DescribeAmbientBrightnessRequest) (*traits.AmbientBrightnessSupport, error)
- func (r *InfoRouter) GetBrightnessSensorInfoClient(name string) (traits.BrightnessSensorInfoClient, error)
- func (r *InfoRouter) HoldsType(client any) bool
- func (r *InfoRouter) Register(server grpc.ServiceRegistrar)
- func (r *InfoRouter) RemoveBrightnessSensorInfoClient(name string) traits.BrightnessSensorInfoClient
- type InfoWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBrightnessSensorApiClientFactory ¶
func WithBrightnessSensorApiClientFactory(f func(name string) (traits.BrightnessSensorApiClient, error)) router.Option
WithBrightnessSensorApiClientFactory instructs the router to create a new client the first time Get is called for that name.
func WithBrightnessSensorInfoClientFactory ¶
func WithBrightnessSensorInfoClientFactory(f func(name string) (traits.BrightnessSensorInfoClient, error)) router.Option
WithBrightnessSensorInfoClientFactory instructs the router to create a new client the first time Get is called for that name.
Types ¶
type ApiRouter ¶
type ApiRouter struct {
traits.UnimplementedBrightnessSensorApiServer
router.Router
}
ApiRouter is a traits.BrightnessSensorApiServer that allows routing named requests to specific traits.BrightnessSensorApiClient
func NewApiRouter ¶
func (*ApiRouter) Add ¶
Add extends Router.Add to panic if client is not of type traits.BrightnessSensorApiClient.
func (*ApiRouter) AddBrightnessSensorApiClient ¶
func (r *ApiRouter) AddBrightnessSensorApiClient(name string, client traits.BrightnessSensorApiClient) traits.BrightnessSensorApiClient
func (*ApiRouter) GetAmbientBrightness ¶
func (r *ApiRouter) GetAmbientBrightness(ctx context.Context, request *traits.GetAmbientBrightnessRequest) (*traits.AmbientBrightness, error)
func (*ApiRouter) GetBrightnessSensorApiClient ¶
func (r *ApiRouter) GetBrightnessSensorApiClient(name string) (traits.BrightnessSensorApiClient, error)
func (*ApiRouter) PullAmbientBrightness ¶
func (r *ApiRouter) PullAmbientBrightness(request *traits.PullAmbientBrightnessRequest, server traits.BrightnessSensorApi_PullAmbientBrightnessServer) error
func (*ApiRouter) Register ¶
func (r *ApiRouter) Register(server grpc.ServiceRegistrar)
func (*ApiRouter) RemoveBrightnessSensorApiClient ¶
func (r *ApiRouter) RemoveBrightnessSensorApiClient(name string) traits.BrightnessSensorApiClient
type ApiWrapper ¶
type ApiWrapper struct {
traits.BrightnessSensorApiClient
// contains filtered or unexported fields
}
func WrapApi ¶
func WrapApi(server traits.BrightnessSensorApiServer) *ApiWrapper
WrapApi adapts a traits.BrightnessSensorApiServer and presents it as a traits.BrightnessSensorApiClient
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.BrightnessSensorApiServer
UnwrapServer returns the underlying server instance.
func (*ApiWrapper) UnwrapService ¶
func (w *ApiWrapper) UnwrapService() (grpc.ClientConnInterface, grpc.ServiceDesc)
type InfoRouter ¶
type InfoRouter struct {
traits.UnimplementedBrightnessSensorInfoServer
router.Router
}
InfoRouter is a traits.BrightnessSensorInfoServer that allows routing named requests to specific traits.BrightnessSensorInfoClient
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.BrightnessSensorInfoClient.
func (*InfoRouter) AddBrightnessSensorInfoClient ¶
func (r *InfoRouter) AddBrightnessSensorInfoClient(name string, client traits.BrightnessSensorInfoClient) traits.BrightnessSensorInfoClient
func (*InfoRouter) DescribeAmbientBrightness ¶
func (r *InfoRouter) DescribeAmbientBrightness(ctx context.Context, request *traits.DescribeAmbientBrightnessRequest) (*traits.AmbientBrightnessSupport, error)
func (*InfoRouter) GetBrightnessSensorInfoClient ¶
func (r *InfoRouter) GetBrightnessSensorInfoClient(name string) (traits.BrightnessSensorInfoClient, error)
func (*InfoRouter) HoldsType ¶
func (r *InfoRouter) HoldsType(client any) bool
func (*InfoRouter) Register ¶
func (r *InfoRouter) Register(server grpc.ServiceRegistrar)
func (*InfoRouter) RemoveBrightnessSensorInfoClient ¶
func (r *InfoRouter) RemoveBrightnessSensorInfoClient(name string) traits.BrightnessSensorInfoClient
type InfoWrapper ¶
type InfoWrapper struct {
traits.BrightnessSensorInfoClient
// contains filtered or unexported fields
}
func WrapInfo ¶
func WrapInfo(server traits.BrightnessSensorInfoServer) *InfoWrapper
WrapInfo adapts a traits.BrightnessSensorInfoServer and presents it as a traits.BrightnessSensorInfoClient
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.BrightnessSensorInfoServer
UnwrapServer returns the underlying server instance.
func (*InfoWrapper) UnwrapService ¶
func (w *InfoWrapper) UnwrapService() (grpc.ClientConnInterface, grpc.ServiceDesc)