emergencypb

package
v0.0.0-...-ac0bb94 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitialEmergency

func InitialEmergency() *traits.Emergency

func WithEmergencyApiClientFactory

func WithEmergencyApiClientFactory(f func(name string) (traits.EmergencyApiClient, error)) router.Option

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

func WithEmergencyInfoClientFactory

func WithEmergencyInfoClientFactory(f func(name string) (traits.EmergencyInfoClient, error)) router.Option

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

Types

type ApiRouter

ApiRouter is a traits.EmergencyApiServer that allows routing named requests to specific traits.EmergencyApiClient

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

func (*ApiRouter) AddEmergencyApiClient

func (r *ApiRouter) AddEmergencyApiClient(name string, client traits.EmergencyApiClient) traits.EmergencyApiClient

func (*ApiRouter) GetEmergency

func (r *ApiRouter) GetEmergency(ctx context.Context, request *traits.GetEmergencyRequest) (*traits.Emergency, error)

func (*ApiRouter) GetEmergencyApiClient

func (r *ApiRouter) GetEmergencyApiClient(name string) (traits.EmergencyApiClient, error)

func (*ApiRouter) HoldsType

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

func (*ApiRouter) PullEmergency

func (*ApiRouter) Register

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

func (*ApiRouter) RemoveEmergencyApiClient

func (r *ApiRouter) RemoveEmergencyApiClient(name string) traits.EmergencyApiClient

func (*ApiRouter) UpdateEmergency

func (r *ApiRouter) UpdateEmergency(ctx context.Context, request *traits.UpdateEmergencyRequest) (*traits.Emergency, error)

type ApiWrapper

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

func WrapApi

func WrapApi(server traits.EmergencyApiServer) *ApiWrapper

WrapApi adapts a traits.EmergencyApiServer and presents it as a traits.EmergencyApiClient

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

UnwrapServer returns the underlying server instance.

func (*ApiWrapper) UnwrapService

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

type InfoRouter

InfoRouter is a traits.EmergencyInfoServer that allows routing named requests to specific traits.EmergencyInfoClient

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

func (*InfoRouter) AddEmergencyInfoClient

func (r *InfoRouter) AddEmergencyInfoClient(name string, client traits.EmergencyInfoClient) traits.EmergencyInfoClient

func (*InfoRouter) DescribeEmergency

func (r *InfoRouter) DescribeEmergency(ctx context.Context, request *traits.DescribeEmergencyRequest) (*traits.EmergencySupport, error)

func (*InfoRouter) GetEmergencyInfoClient

func (r *InfoRouter) GetEmergencyInfoClient(name string) (traits.EmergencyInfoClient, error)

func (*InfoRouter) HoldsType

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

func (*InfoRouter) Register

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

func (*InfoRouter) RemoveEmergencyInfoClient

func (r *InfoRouter) RemoveEmergencyInfoClient(name string) traits.EmergencyInfoClient

type InfoWrapper

type InfoWrapper struct {
	traits.EmergencyInfoClient
	// contains filtered or unexported fields
}

func WrapInfo

func WrapInfo(server traits.EmergencyInfoServer) *InfoWrapper

WrapInfo adapts a traits.EmergencyInfoServer and presents it as a traits.EmergencyInfoClient

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

UnwrapServer returns the underlying server instance.

func (*InfoWrapper) UnwrapService

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

type MemoryDevice

type MemoryDevice struct {
	traits.UnimplementedEmergencyApiServer
	// contains filtered or unexported fields
}

func NewMemoryDevice

func NewMemoryDevice() *MemoryDevice

func (*MemoryDevice) GetEmergency

func (*MemoryDevice) PullEmergency

func (*MemoryDevice) Register

func (t *MemoryDevice) Register(server grpc.ServiceRegistrar)

func (*MemoryDevice) UpdateEmergency

func (t *MemoryDevice) UpdateEmergency(_ context.Context, request *traits.UpdateEmergencyRequest) (*traits.Emergency, error)

Jump to

Keyboard shortcuts

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