Documentation
¶
Overview ¶
Package codegen contains functions and types used by the weaver_gen.go files generated by "weaver generate". The APIs in this package are not suitable for direct use by Service Weaver applications.
Index ¶
- func CatchPanics(r interface{}) error
- func ComponentConfigValidator(path, cfg string) error
- func ExtractEdges(data []byte) [][2]string
- func MakeEdgeString(src, dst string) string
- func MakeListenersString(component string, listeners []string) string
- func Register(reg Registration)
- func RegisterSerializable[T AutoMarshal]()
- type AutoMarshal
- type CallEdge
- type ComponentListeners
- type Decoder
- func (d *Decoder) Bool() bool
- func (d *Decoder) Byte() byte
- func (d *Decoder) Bytes() []byte
- func (d *Decoder) Complex64() complex64
- func (d *Decoder) Complex128() complex128
- func (d *Decoder) DecodeBinaryUnmarshaler(value encoding.BinaryUnmarshaler)
- func (d *Decoder) DecodeProto(value proto.Message)
- func (d *Decoder) Empty() bool
- func (d *Decoder) Error() error
- func (d *Decoder) Float32() float32
- func (d *Decoder) Float64() float64
- func (d *Decoder) Int() int
- func (d *Decoder) Int8() int8
- func (d *Decoder) Int16() int16
- func (d *Decoder) Int32() int32
- func (d *Decoder) Int64() int64
- func (d *Decoder) Interface() any
- func (d *Decoder) Len() int
- func (d *Decoder) Read(n int) []byte
- func (d *Decoder) Rune() rune
- func (d *Decoder) String() string
- func (d *Decoder) Uint() uint
- func (d *Decoder) Uint8() uint8
- func (d *Decoder) Uint16() uint16
- func (d *Decoder) Uint32() uint32
- func (d *Decoder) Uint64() uint64
- type Encoder
- func (e *Encoder) Bool(arg bool)
- func (e *Encoder) Byte(arg byte)
- func (e *Encoder) Bytes(arg []byte)
- func (e *Encoder) Complex64(arg complex64)
- func (e *Encoder) Complex128(arg complex128)
- func (e *Encoder) Data() []byte
- func (e *Encoder) EncodeBinaryMarshaler(value encoding.BinaryMarshaler)
- func (e *Encoder) EncodeProto(value proto.Message)
- func (e *Encoder) Error(err error)
- func (e *Encoder) Float32(arg float32)
- func (e *Encoder) Float64(arg float64)
- func (e *Encoder) Grow(bytesNeeded int) []byte
- func (e *Encoder) Int(arg int)
- func (e *Encoder) Int8(arg int8)
- func (e *Encoder) Int16(arg int16)
- func (e *Encoder) Int32(arg int32)
- func (e *Encoder) Int64(arg int64)
- func (e *Encoder) Interface(value AutoMarshal)
- func (e *Encoder) Len(l int)
- func (e *Encoder) Reset(n int)
- func (e *Encoder) Rune(arg rune)
- func (e *Encoder) String(arg string)
- func (e *Encoder) Uint(arg uint)
- func (e *Encoder) Uint8(arg uint8)
- func (e *Encoder) Uint16(arg uint16)
- func (e *Encoder) Uint32(arg uint32)
- func (e *Encoder) Uint64(arg uint64)
- type Hasher
- func (h *Hasher) Sum64() uint64
- func (h *Hasher) WriteFloat32(v float32)
- func (h *Hasher) WriteFloat64(v float64)
- func (h *Hasher) WriteInt(v int)
- func (h *Hasher) WriteInt8(v int8)
- func (h *Hasher) WriteInt16(v int16)
- func (h *Hasher) WriteInt32(v int32)
- func (h *Hasher) WriteInt64(v int64)
- func (h *Hasher) WriteString(v string)
- func (h *Hasher) WriteUint(v uint)
- func (h *Hasher) WriteUint8(v uint8)
- func (h *Hasher) WriteUint16(v uint16)
- func (h *Hasher) WriteUint32(v uint32)
- func (h *Hasher) WriteUint64(v uint64)
- type LatestVersion
- type MethodCallHandle
- type MethodLabels
- type MethodMetrics
- type OrderedCode
- type OrderedEncoder
- func (e *OrderedEncoder) Encode() OrderedCode
- func (e *OrderedEncoder) Reset()
- func (e *OrderedEncoder) WriteFloat32(f float32)
- func (e *OrderedEncoder) WriteFloat64(f float64)
- func (e *OrderedEncoder) WriteInt(x int)
- func (e *OrderedEncoder) WriteInt8(x int8)
- func (e *OrderedEncoder) WriteInt16(x int16)
- func (e *OrderedEncoder) WriteInt32(x int32)
- func (e *OrderedEncoder) WriteInt64(x int64)
- func (e *OrderedEncoder) WriteString(s string)
- func (e *OrderedEncoder) WriteUint(x uint)
- func (e *OrderedEncoder) WriteUint8(x uint8)
- func (e *OrderedEncoder) WriteUint16(x uint16)
- func (e *OrderedEncoder) WriteUint32(x uint32)
- func (e *OrderedEncoder) WriteUint64(x uint64)
- type Registration
- type Server
- type Stub
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CatchPanics ¶
func CatchPanics(r interface{}) error
CatchPanics recovers from panic() calls that occur during encoding, decoding, and RPC execution.
func ComponentConfigValidator ¶
ComponentConfigValidator checks that cfg is a valid configuration for the component type whose fully qualified name is given by path.
TODO(mwhittaker): Move out of codegen package? It's not used by the generated code.
func ExtractEdges ¶
ExtractEdges returns the edges corresponding to MakeEdgeString() results that occur in data.
func MakeEdgeString ¶
MakeEdgeString returns a string that should be emitted into generated code to represent an edge from src to dst.
func MakeListenersString ¶
MakeListenersString returns a string that should be emitted into generated code to represent the set of listeners associated with a given component.
func RegisterSerializable ¶
func RegisterSerializable[T AutoMarshal]()
RegisterSerializable records type T as serializable. This is needed to instantiate the appropriate concrete type when an interface is sent over the wire (currently only used for AutoMarshal errors returned from remote method calls). The registration is automatically done by generated code for custom error structs that embed weaver.AutoMarshal.
Types ¶
type AutoMarshal ¶
AutoMarshal is the interface implemented by structs with weaver.AutoMarshal declarations.