invoker

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Function

type Function interface {
	FuncName() string
	In() []reflect.Type
	Out() []reflect.Type
}

type Interceptor

type Interceptor func(InvokeFunc) InvokeFunc

type InvokeFunc

type InvokeFunc func(context.Context, Message, ...InvokeOption) (Message, error)

type InvokeOption

type InvokeOption func(*InvokeOptions)

func WithInterceptor

func WithInterceptor(i ...Interceptor) InvokeOption

type InvokeOptions

type InvokeOptions struct {
	Interceptors []Interceptor
}

type Invoker

type Invoker interface {
	Name() string
	Init(...Option) error
	Invoke(context.Context, Message, ...InvokeOption) (Message, error)
	Function(string) (Function, error)
	Functions() []Function
	String() string
}

type Message

type Message interface {
	FuncName() string
	SetFuncName(string)
	Parameters() []interface{}
	SetParameters([]interface{})
	Attachments() map[string]string
	Attachment(string) (string, bool)
	SetAttachment(string, string)
}

func NewMessage

func NewMessage() Message

type Option

type Option func(*Options)

func Intercept

func Intercept(i ...Interceptor) Option

func Name

func Name(n string) Option

type Options

type Options struct {
	Name          string
	InvokeOptions InvokeOptions
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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