rpc_core

package
v0.0.0-20240423 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPTION_HANDLER = "handler"
	OPTION_CALLER  = "caller"
)

Variables

View Source
var (
	ErrUnsupportedCaller, ErrUnsupportedCallerFn   = errors.NewErrorAndErrorFunc[string]("unsupported caller")
	ErrUnsupportedServer, ErrUnsupportedServerFn   = errors.NewErrorAndErrorFunc[string]("unsupported server")
	ErrUnsupportedHandler, ErrUnsupportedHandlerFn = errors.NewErrorAndErrorFunc[string]("unsupported handler")
	ErrUnsupportedMethod, ErrUnsupportedMethodFn   = errors.NewErrorAndErrorFunc[string]("unsupported method")
)
View Source
var RegisterNewServerFunc, NewServer = lib_registerer.Pair[Server]()

Functions

func RegisterNewCallerFunc

func RegisterNewCallerFunc(name string, fn NewCallerFunc)

func RegisterNewHandlerFunc

func RegisterNewHandlerFunc(name string, fn NewHandlerFunc)

func WithCaller

func WithCaller(c Caller) option.ApplyOption

func WithHandler

func WithHandler(h Handler) option.ApplyOption

func WrapHandleFuncGenerics

func WrapHandleFuncGenerics[IT, OT any](fn func(context.Context, IT) (OT, error)) rpc_interface.HandleFunc

Types

type Caller

type Caller = rpc_interface.Caller

func GetCaller

func GetCaller(o option.Option) (Caller, error)

func NewCaller

func NewCaller(name string, opts ...NewCallerOption) (Caller, error)

type EMPTY

type EMPTY = struct{}
var (
	NO_REQUEST EMPTY
	NO_CONTENT EMPTY
)

type Handler

type Handler = rpc_interface.Handler

func GetHandler

func GetHandler(o option.Option) (Handler, error)

func NewHandler

func NewHandler(name string, opts ...NewHandlerOption) (Handler, error)

type Middleware

type Middleware[IT, OT any] func(next func(context.Context, IT) (OT, error)) func(context.Context, IT) (OT, error)

type NewCallerFunc

type NewCallerFunc func(...NewCallerOption) (Caller, error)

type NewCallerOption

type NewCallerOption = rpc_interface.NewCallerOption

type NewHandlerFunc

type NewHandlerFunc func(...NewHandlerOption) (Handler, error)

type NewHandlerOption

type NewHandlerOption = rpc_interface.NewHandlerOption

type NewServerOption

type NewServerOption = rpc_interface.NewServerOption

type Server

type Server = rpc_interface.Server

Jump to

Keyboard shortcuts

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