Documentation
¶
Overview ¶
Package wire encodes and decodes the protobuf wire format for the code aicoded generate writes for calls between apps. App code does not use it.
Index ¶
- Constants
- func AppendBool(b []byte, n protowire.Number, v bool) []byte
- func AppendBytes(b []byte, n protowire.Number, v []byte) []byte
- func AppendFloat32(b []byte, n protowire.Number, v float32) []byte
- func AppendFloat64(b []byte, n protowire.Number, v float64) []byte
- func AppendInt32(b []byte, n protowire.Number, v int32) []byte
- func AppendInt64(b []byte, n protowire.Number, v int64) []byte
- func AppendMessage(b []byte, n protowire.Number, enc func([]byte) []byte) []byte
- func AppendString(b []byte, n protowire.Number, v string) []byte
- func AppendTime(b []byte, n protowire.Number, v time.Time) []byte
- func AppendUint32(b []byte, n protowire.Number, v uint32) []byte
- func AppendUint64(b []byte, n protowire.Number, v uint64) []byte
- func Decode(b []byte, f func(n protowire.Number, v Value) error) error
- type Value
- func (v Value) Bool() (bool, error)
- func (v Value) Bytes() ([]byte, error)
- func (v Value) Decode(f func(n protowire.Number, v Value) error) error
- func (v Value) Float32() (float32, error)
- func (v Value) Float64() (float64, error)
- func (v Value) Int32() (int32, error)
- func (v Value) Int64() (int64, error)
- func (v Value) Message() ([]byte, error)
- func (v Value) Packed(elem protowire.Type, f func(Value) error) error
- func (v Value) String() (string, error)
- func (v Value) Time() (time.Time, error)
- func (v Value) Uint32() (uint32, error)
- func (v Value) Uint64() (uint64, error)
Constants ¶
const MaxDepth = 1000
MaxDepth bounds how deeply messages may nest inside the message Decode reads.
Variables ¶
This section is empty.
Functions ¶
func AppendBool ¶
AppendBool appends field n holding v.
func AppendBytes ¶
AppendBytes appends field n holding v.
func AppendFloat32 ¶
AppendFloat32 appends field n holding v.
func AppendFloat64 ¶
AppendFloat64 appends field n holding v.
func AppendInt32 ¶
AppendInt32 appends field n holding v.
func AppendInt64 ¶
AppendInt64 appends field n holding v.
func AppendMessage ¶
AppendMessage appends field n holding the message enc appends.
func AppendString ¶
AppendString appends field n holding v.
func AppendTime ¶
AppendTime appends field n holding v as the message {1: seconds, 2: nanoseconds} since the Unix epoch in UTC.
func AppendUint32 ¶
AppendUint32 appends field n holding v.
func AppendUint64 ¶
AppendUint64 appends field n holding v.
Types ¶
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is the value of one field. Its accessors refuse a wire type that does not fit.
func (Value) Decode ¶
Decode calls f for every field of the message v holds, like the package's Decode. It refuses a message nested more than MaxDepth levels inside the one Decode started with.
func (Value) Message ¶
Message returns the encoded message a message value holds. Generated code reads nested messages with Decode instead, which bounds their depth.
func (Value) Packed ¶
Packed calls f for every element of a repeated scalar field whose elements have wire type elem: once when v is a single element, and for each element when v holds them packed.