channel

package
v0.0.0-...-8d9afb2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithChannelApiClientFactory

func WithChannelApiClientFactory(f func(name string) (traits.ChannelApiClient, error)) router.Option

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

func WithChannelInfoClientFactory

func WithChannelInfoClientFactory(f func(name string) (traits.ChannelInfoClient, error)) router.Option

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

func WrapApi

WrapApi adapts a traits.ChannelApiServer and presents it as a traits.ChannelApiClient

func WrapInfo

WrapInfo adapts a traits.ChannelInfoServer and presents it as a traits.ChannelInfoClient

Types

type ApiRouter

ApiRouter is a traits.ChannelApiServer that allows routing named requests to specific traits.ChannelApiClient

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

func (*ApiRouter) AddChannelApiClient

func (r *ApiRouter) AddChannelApiClient(name string, client traits.ChannelApiClient) traits.ChannelApiClient

func (*ApiRouter) AdjustChannel

func (r *ApiRouter) AdjustChannel(ctx context.Context, request *traits.AdjustChannelRequest) (*traits.Channel, error)

func (*ApiRouter) ChooseChannel

func (r *ApiRouter) ChooseChannel(ctx context.Context, request *traits.ChooseChannelRequest) (*traits.Channel, error)

func (*ApiRouter) GetChannelApiClient

func (r *ApiRouter) GetChannelApiClient(name string) (traits.ChannelApiClient, error)

func (*ApiRouter) GetChosenChannel

func (r *ApiRouter) GetChosenChannel(ctx context.Context, request *traits.GetChosenChannelRequest) (*traits.Channel, error)

func (*ApiRouter) HoldsType

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

func (*ApiRouter) PullChosenChannel

func (*ApiRouter) Register

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

func (*ApiRouter) RemoveChannelApiClient

func (r *ApiRouter) RemoveChannelApiClient(name string) traits.ChannelApiClient

func (*ApiRouter) ReturnChannel

func (r *ApiRouter) ReturnChannel(ctx context.Context, request *traits.ReturnChannelRequest) (*traits.Channel, error)

type InfoRouter

type InfoRouter struct {
	traits.UnimplementedChannelInfoServer

	router.Router
}

InfoRouter is a traits.ChannelInfoServer that allows routing named requests to specific traits.ChannelInfoClient

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

func (*InfoRouter) AddChannelInfoClient

func (r *InfoRouter) AddChannelInfoClient(name string, client traits.ChannelInfoClient) traits.ChannelInfoClient

func (*InfoRouter) DescribeChosenChannel

func (r *InfoRouter) DescribeChosenChannel(ctx context.Context, request *traits.DescribeChosenChannelRequest) (*traits.ChosenChannelSupport, error)

func (*InfoRouter) GetChannelInfoClient

func (r *InfoRouter) GetChannelInfoClient(name string) (traits.ChannelInfoClient, error)

func (*InfoRouter) HoldsType

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

func (*InfoRouter) Register

func (r *InfoRouter) Register(server *grpc.Server)

func (*InfoRouter) RemoveChannelInfoClient

func (r *InfoRouter) RemoveChannelInfoClient(name string) traits.ChannelInfoClient

Jump to

Keyboard shortcuts

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