Documentation
¶
Overview ¶
Package irpcgen provides functionality for code generated by iRPC tool
This code is not meant to be imported directly by users. Instead, it will be used by the generated *_irpc.go files
Index ¶
- func DecBinaryUnmarshaler[T encoding.BinaryUnmarshaler](dec *Decoder, dst T) error
- func DecBool[T ~bool](dec *Decoder, v *T) error
- func DecBoolSlice[T ~[]bool](dec *Decoder, v *T) error
- func DecByteSlice[T ~[]byte](dec *Decoder, v *T) error
- func DecFloat32[T ~float32](dec *Decoder, v *T) error
- func DecFloat64[T ~float64](dec *Decoder, v *T) error
- func DecInt[T ~int](dec *Decoder, v *T) error
- func DecInt8[T ~int8](dec *Decoder, v *T) error
- func DecInt16[T ~int16](dec *Decoder, v *T) error
- func DecInt32[T ~int32](dec *Decoder, v *T) error
- func DecInt64[T ~int64](dec *Decoder, v *T) error
- func DecIsNil(dec *Decoder, isNil *bool) error
- func DecMap[M ~map[K]V, K comparable, V any](dec *Decoder, m *M, kName string, kDecFunc func(*Decoder, *K) error, ...) error
- func DecPointer[T any](dec *Decoder, p **T, elemType string, decFnc func(dec *Decoder, v *T) error) error
- func DecSlice[S ~[]E, E any](dec *Decoder, sl *S, elemType string, elemDecFnc func(*Decoder, *E) error) error
- func DecString[T ~string](dec *Decoder, v *T) error
- func DecUint[T ~uint](dec *Decoder, v *T) error
- func DecUint8[T ~uint8](dec *Decoder, v *T) error
- func DecUint16[T ~uint16](dec *Decoder, v *T) error
- func DecUint32[T ~uint32](dec *Decoder, v *T) error
- func DecUint64[T ~uint64](dec *Decoder, v *T) error
- func EncBinaryMarshaler[T encoding.BinaryMarshaler](enc *Encoder, v T) error
- func EncBool[T ~bool](enc *Encoder, v T) error
- func EncBoolSlice[S ~[]bool](enc *Encoder, vs S) error
- func EncByteSlice[T ~[]byte](enc *Encoder, v T) error
- func EncFloat32[T ~float32](enc *Encoder, v T) error
- func EncFloat64[T ~float64](enc *Encoder, v T) error
- func EncInt[T ~int](enc *Encoder, v T) error
- func EncInt8[T ~int8](enc *Encoder, v T) error
- func EncInt16[T ~int16](enc *Encoder, v T) error
- func EncInt32[T ~int32](enc *Encoder, v T) error
- func EncInt64[T ~int64](enc *Encoder, v T) error
- func EncIsNil(enc *Encoder, isNil bool) error
- func EncMap[M ~map[K]V, K comparable, V any](enc *Encoder, m M, kType string, kEncFunc func(*Encoder, K) error, ...) error
- func EncPointer[T any](enc *Encoder, p *T, elemType string, encFnc func(enc *Encoder, v T) error) error
- func EncSlice[S ~[]E, E any](enc *Encoder, sl S, elemType string, elemEncFnc func(enc *Encoder, v E) error) error
- func EncString[T ~string](enc *Encoder, v T) error
- func EncUint[T ~uint](enc *Encoder, v T) error
- func EncUint8[T ~uint8](enc *Encoder, v T) error
- func EncUint16[T ~uint16](enc *Encoder, v T) error
- func EncUint32[T ~uint32](enc *Encoder, v T) error
- func EncUint64[T ~uint64](enc *Encoder, v T) error
- type ArgDeserializer
- type Decoder
- type Deserializable
- type EmptyDeserializable
- type EmptySerializable
- type Encoder
- type Endpoint
- type FuncExecutor
- type FuncId
- type Serializable
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecBinaryUnmarshaler ¶
func DecBinaryUnmarshaler[T encoding.BinaryUnmarshaler](dec *Decoder, dst T) error
func DecBoolSlice ¶
func DecByteSlice ¶
func DecFloat32 ¶
func DecFloat64 ¶
func DecPointer ¶
func EncBinaryMarshaler ¶
func EncBinaryMarshaler[T encoding.BinaryMarshaler](enc *Encoder, v T) error
func EncBoolSlice ¶
func EncByteSlice ¶
func EncFloat32 ¶
func EncFloat64 ¶
func EncPointer ¶
Types ¶
type ArgDeserializer ¶
type ArgDeserializer func(d *Decoder) (FuncExecutor, error)
ArgDeserializer deserializes function arguments from a Decoder and returns a FuncExecutor that performs the function call.
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder is a binary decoder that reads various data types from an io.Reader.
It is meant to be used by generated code to decode messages in the IRPC protocol.
func NewDecoder ¶
type Deserializable ¶
Deserializable initializes its state from a Decoder.
type EmptyDeserializable ¶
type EmptyDeserializable struct{}
EmptyDeserializable is a no-op implementation of Deserializable.
func (EmptyDeserializable) Deserialize ¶
func (EmptyDeserializable) Deserialize(d *Decoder) error
type EmptySerializable ¶
type EmptySerializable struct{}
EmptySerializable is a no-op implementation of Serializable.
func (EmptySerializable) Serialize ¶
func (EmptySerializable) Serialize(e *Encoder) error
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder serializes given data type to byte stream. Encoder is meant to be used by generated code, not directly by the user.
func NewEncoder ¶
type Endpoint ¶
type Endpoint interface {
// RegisterClient registers a client with the peer Endpoint.
RegisterClient(serviceId []byte) error
// CallRemoteFunc invokes a function on the peer Endpoint.
CallRemoteFunc(ctx context.Context, serviceId []byte, funcId FuncId, params Serializable, resp Deserializable) error
}
Endpoint represents one side of an active RPC connection. Each Endpoint communicates with one peer Endpoint on the other side.
type FuncExecutor ¶
type FuncExecutor func(ctx context.Context) Serializable
FuncExecutor wraps a function call and returns its result as Serializable.
type Serializable ¶
Serializable serializes its state using an Encoder