waste

package
v0.0.0-...-8846729 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithWasteApiClientFactory

func WithWasteApiClientFactory(f func(name string) (traits.WasteApiClient, error)) router.Option

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

func WithWasteInfoClientFactory

func WithWasteInfoClientFactory(f func(name string) (traits.WasteInfoClient, error)) router.Option

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 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.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) HoldsType

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

func (*ApiRouter) ListWasteRecords

func (*ApiRouter) PullWasteRecords

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)

Jump to

Keyboard shortcuts

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