adapter

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCall

func HandleCall[R, P any, RM, PM any](
	handler func(context.Context, *PM, ...grpc.CallOption) (*RM, error),
	ctx context.Context,
	params P,
	result R,
	options ...grpc.CallOption,
) (R, error)

func HandleProcedure

func HandleProcedure[R, P any, RM, PM any](
	handler func(context.Context, P) (R, error),
	ctx context.Context,
	request *PM,
	response *RM,
	options ...grpc.CallOption,
) (resp *RM, err error)

func InitModules added in v1.0.0

func InitModules(server *grpc.Server, modules ...server.Module)

func ParseMessage

func ParseMessage[T any](message any) (value T, err error)

Types

type Caller

type Caller interface {
	Init(server *grpc.Server)
	Config() CallerConfig
}

type CallerConfig

type CallerConfig map[string]MethodConfig

func GetConfig added in v1.0.0

func GetConfig(modules ...server.Module) CallerConfig

type MethodConfig

type MethodConfig struct {
	Public bool
}

type Module added in v1.0.0

type Module interface {
	server.Module
	Callers() []Caller
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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