temperaturepb

package
v0.0.0-...-ee17ca8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithTemperatureApiClientFactory

func WithTemperatureApiClientFactory(f func(name string) (traits.TemperatureApiClient, error)) router.Option

WithTemperatureApiClientFactory instructs the router to create a new client the first time Get is called for that name.

Types

type ApiRouter

ApiRouter is a traits.TemperatureApiServer that allows routing named requests to specific traits.TemperatureApiClient

func NewApiRouter

func NewApiRouter(opts ...router.Option) *ApiRouter

func (*ApiRouter) Add

func (r *ApiRouter) Add(name string, client any) any

Add extends Router.Add to panic if client is not of type traits.TemperatureApiClient.

func (*ApiRouter) AddTemperatureApiClient

func (r *ApiRouter) AddTemperatureApiClient(name string, client traits.TemperatureApiClient) traits.TemperatureApiClient

func (*ApiRouter) GetTemperature

func (r *ApiRouter) GetTemperature(ctx context.Context, request *traits.GetTemperatureRequest) (*traits.Temperature, error)

func (*ApiRouter) GetTemperatureApiClient

func (r *ApiRouter) GetTemperatureApiClient(name string) (traits.TemperatureApiClient, error)

func (*ApiRouter) HoldsType

func (r *ApiRouter) HoldsType(client any) bool

func (*ApiRouter) PullTemperature

func (*ApiRouter) Register

func (r *ApiRouter) Register(server grpc.ServiceRegistrar)

func (*ApiRouter) RemoveTemperatureApiClient

func (r *ApiRouter) RemoveTemperatureApiClient(name string) traits.TemperatureApiClient

func (*ApiRouter) UpdateTemperature

func (r *ApiRouter) UpdateTemperature(ctx context.Context, request *traits.UpdateTemperatureRequest) (*traits.Temperature, error)

type ApiWrapper

type ApiWrapper struct {
	traits.TemperatureApiClient
	// contains filtered or unexported fields
}

func WrapApi

func WrapApi(server traits.TemperatureApiServer) *ApiWrapper

WrapApi adapts a traits.TemperatureApiServer and presents it as a traits.TemperatureApiClient

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.TemperatureApiServer

UnwrapServer returns the underlying server instance.

func (*ApiWrapper) UnwrapService

func (w *ApiWrapper) UnwrapService() (grpc.ClientConnInterface, grpc.ServiceDesc)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL