Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

proto source pure

Constants 1

const VARINT, FIXED64, LEN, FIXED32

1const (
2	VARINT  WireType = 0 //	int32, int64, uint32, uint64, sint32, sint64, bool, enum
3	FIXED64 WireType = 1 // fixed64, sfixed64, double
4	LEN     WireType = 2 // string, bytes, embedded messages, packed repeated fields
5	FIXED32 WireType = 5 //	fixed32, sfixed32, float
6)
source

Functions 13

func AppendAlwaysLengthDelimited

1func AppendAlwaysLengthDelimited(buf []byte, fieldNum int, bz []byte) []byte
source

AppendAlwaysLengthDelimited appends a length-delimited field, including when bz is empty (emits a length-0 value). Required to match the wire format produced by gogoproto for fields marked `[(gogoproto.nullable) = false]`, which always serialize even when their underlying message has no non-zero fields.

func AppendDuration

1func AppendDuration(buf []byte, fieldNum int, d time.Duration) []byte
source

AppendDuration appends a google.protobuf.Duration field.

func AppendFixed64

1func AppendFixed64(buf []byte, fieldNum int, v uint64) []byte
source

AppendFixed64 appends a fixed 64-bit field.

func AppendLengthDelimited

1func AppendLengthDelimited(buf []byte, fieldNum int, bz []byte) []byte
source

AppendLengthDelimited appends a length-delimited field. Returns buf unchanged when bz is empty (proto3 default for optional fields).

func AppendPackedVarintInt32

1func AppendPackedVarintInt32(buf []byte, fieldNum int, values []int32) []byte
source

AppendPackedVarintInt32 appends a packed repeated int32 varint field. Negative values are sign-extended to 64 bits to match proto3 wire format. Returns buf unchanged when values is empty (proto3 default).

func AppendTag

1func AppendTag(buf []byte, fieldNum int, wireType WireType) []byte
source

AppendTag appends a protobuf tag (field number and wire type)

func AppendTime

1func AppendTime(buf []byte, fieldNum int, t time.Time) []byte
source

AppendTime appends a google.protobuf.Timestamp field.

func AppendVarint

1func AppendVarint(buf []byte, fieldNum int, v uint64) []byte
source

AppendVarint appends a varint field.

func DecodeString

1func DecodeString(buf []byte, pos int) (string, int, error)
source

DecodeString reads a string (length-prefixed) from the byte slice

func DecodeVarint

1func DecodeVarint(buf []byte, pos int) (uint64, int, error)
source

DecodeVarint reads a varint from the byte slice and returns the value and new position

func DurationMarshal

1func DurationMarshal(d time.Duration) []byte
source

DurationMarshal returns the inner proto encoding of a google.protobuf.Duration (without the length-delimited field wrapper).

func MarshalAny

1func MarshalAny(typeURL string, value []byte) []byte
source

MarshalAny returns the wire encoding of a google.protobuf.Any message holding (typeURL, value). Used to match the cdc.MarshalInterface format produced by the Cosmos SDK proto codec when storing or verifying interface-typed messages (e.g. ClientState in the upgrade store).

func TimeMarshal

1func TimeMarshal(t time.Time) []byte
source

TimeMarshal returns a proto marshalled time.

Types 1

Imports 3

Source Files 3