api

package
v0.0.0-...-ee3d063 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFullOfProvider = errors.New("full of provider")
View Source
var ErrNotExist = errors.New("provider not exist")
View Source
var ErrorCallFailed = errors.New("call failed")
View Source
var ProviderManager = newManager[func(data []byte, caller Caller) ([]byte, error)]()

Functions

func CallService

func CallService[T any, PT typeHolder[T]](service string, cap uuid.UUID, arg msgp.Marshaler) (PT, error)

Types

type Caller

type Caller struct {
	Host uuid.UUID
	Id   uint32
}

type Manager

type Manager[T any] struct {
	// contains filtered or unexported fields
}

func (*Manager[T]) Del

func (man *Manager[T]) Del(id uint32)

func (*Manager[T]) Get

func (man *Manager[T]) Get(id uint32) *T

func (*Manager[T]) New

func (man *Manager[T]) New(item T) (uint32, error)

func (*Manager[T]) Set

func (man *Manager[T]) Set(id uint32, item *T)

type ProviderArg

type ProviderArg struct {
	Id         uint32 `msg:"id"`
	CallerHost UUID   `msg:"caller_host"`
	CallerId   uint32 `msg:"caller_id"`
	Data       []byte `msg:"data"`
}

func (*ProviderArg) DecodeMsg

func (z *ProviderArg) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*ProviderArg) EncodeMsg

func (z *ProviderArg) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*ProviderArg) MarshalMsg

func (z *ProviderArg) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ProviderArg) Msgsize

func (z *ProviderArg) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ProviderArg) UnmarshalMsg

func (z *ProviderArg) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type UUID

type UUID [16]byte

func (*UUID) DecodeMsg

func (z *UUID) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*UUID) EncodeMsg

func (z *UUID) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*UUID) MarshalMsg

func (z *UUID) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*UUID) Msgsize

func (z *UUID) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*UUID) UnmarshalMsg

func (z *UUID) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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