common

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

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const CommonPluginAPIVersion = 1

Variables

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)

Functions

func WazeroModuleConfig

func WazeroModuleConfig(moduleConfig wazero.ModuleConfig) wazeroConfigOption

func WazeroRuntime

func WazeroRuntime(newRuntime WazeroNewRuntime) wazeroConfigOption

Types

type Common

type Common interface {
	Prepare(context.Context, *Request) (*Reply, error)
	Run(context.Context, *Request) (*Reply, error)
	Check(context.Context, *Request) (*Reply, error)
	Rollback(context.Context, *Request) (*Reply, error)
}

go:plugin type=plugin version=1

type CommonPlugin

type CommonPlugin struct {
	// contains filtered or unexported fields
}

func NewCommonPlugin

func NewCommonPlugin(ctx context.Context, opts ...wazeroConfigOption) (*CommonPlugin, error)

func (*CommonPlugin) Load

func (p *CommonPlugin) Load(ctx context.Context, pluginPath string) (common, error)

type Reply

type Reply struct {
	Code    int32  `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=Message,proto3" json:"Message,omitempty"`
	// contains filtered or unexported fields
}

func (*Reply) GetCode

func (x *Reply) GetCode() int32

func (*Reply) GetMessage

func (x *Reply) GetMessage() string

func (*Reply) MarshalToSizedBufferVT

func (m *Reply) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Reply) MarshalToVT

func (m *Reply) MarshalToVT(dAtA []byte) (int, error)

func (*Reply) MarshalVT

func (m *Reply) MarshalVT() (dAtA []byte, err error)

func (*Reply) ProtoReflect

func (x *Reply) ProtoReflect() protoreflect.Message

func (*Reply) SizeVT

func (m *Reply) SizeVT() (n int)

func (*Reply) UnmarshalVT

func (m *Reply) UnmarshalVT(dAtA []byte) error

type Request

type Request struct {
	Args string `protobuf:"bytes,1,opt,name=Args,proto3" json:"Args,omitempty"`
	// contains filtered or unexported fields
}

func (*Request) GetArgs

func (x *Request) GetArgs() string

func (*Request) MarshalToSizedBufferVT

func (m *Request) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Request) MarshalToVT

func (m *Request) MarshalToVT(dAtA []byte) (int, error)

func (*Request) MarshalVT

func (m *Request) MarshalVT() (dAtA []byte, err error)

func (*Request) ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) SizeVT

func (m *Request) SizeVT() (n int)

func (*Request) UnmarshalVT

func (m *Request) UnmarshalVT(dAtA []byte) error

type WazeroConfig

type WazeroConfig struct {
	// contains filtered or unexported fields
}

type WazeroNewRuntime

type WazeroNewRuntime func(context.Context) (wazero.Runtime, error)

func DefaultWazeroRuntime

func DefaultWazeroRuntime() WazeroNewRuntime

Jump to

Keyboard shortcuts

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