msg

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Compress

func Compress(in []byte) (out []byte, err error)

func DecodeString

func DecodeString(in string) (msg, sig []byte, id uint32, tstamp uint64, err error)

func Decompress

func Decompress(in []byte) (out []byte, err error)

func EncodeToString

func EncodeToString(msg, sig []byte, id uint32, tstamp uint64) (out string, err error)

func EncodeToString(msg, tstamp, sig, id []byte, signed bool) (out string, err error) { XXX i should be able to remove the signed parameter

func EncodedLen

func EncodedLen(inlen int) int

func UnsignedDecodeString

func UnsignedDecodeString(in string) (msg []byte, tstamp uint64, err error)

func UnsignedEncodeToString

func UnsignedEncodeToString(msg []byte, tstamp uint64) (out string, err error)

Types

type Blob

type Blob struct {
	Payload []byte  `protobuf:"bytes,1,req,name=payload" json:"payload,omitempty"`           // the message
	Sig     []byte  `protobuf:"bytes,2,req,name=sig" json:"sig,omitempty"`                   // the signature
	SigId   *uint32 `protobuf:"varint,3,req,name=sig_id,json=sigId" json:"sig_id,omitempty"` // the id of the signature.
	Tstamp  *uint64 `protobuf:"varint,4,req,name=tstamp" json:"tstamp,omitempty"`            // the nonce/timestamp counter
	// contains filtered or unexported fields
}

func (*Blob) Descriptor deprecated

func (*Blob) Descriptor() ([]byte, []int)

Deprecated: Use Blob.ProtoReflect.Descriptor instead.

func (*Blob) GetPayload

func (x *Blob) GetPayload() []byte

func (*Blob) GetSig

func (x *Blob) GetSig() []byte

func (*Blob) GetSigId

func (x *Blob) GetSigId() uint32

func (*Blob) GetTstamp

func (x *Blob) GetTstamp() uint64

func (*Blob) ProtoMessage

func (*Blob) ProtoMessage()

func (*Blob) ProtoReflect

func (x *Blob) ProtoReflect() protoreflect.Message

func (*Blob) Reset

func (x *Blob) Reset()

func (*Blob) String

func (x *Blob) String() string

type UnsignedBlob

type UnsignedBlob struct {
	Payload []byte  `protobuf:"bytes,5,req,name=payload" json:"payload,omitempty"` // the payload
	Tstamp  *uint64 `protobuf:"varint,6,req,name=tstamp" json:"tstamp,omitempty"`  // the counter that helps build the nonce and avoid nonce re-use
	// contains filtered or unexported fields
}

func (*UnsignedBlob) Descriptor deprecated

func (*UnsignedBlob) Descriptor() ([]byte, []int)

Deprecated: Use UnsignedBlob.ProtoReflect.Descriptor instead.

func (*UnsignedBlob) GetPayload

func (x *UnsignedBlob) GetPayload() []byte

func (*UnsignedBlob) GetTstamp

func (x *UnsignedBlob) GetTstamp() uint64

func (*UnsignedBlob) ProtoMessage

func (*UnsignedBlob) ProtoMessage()

func (*UnsignedBlob) ProtoReflect

func (x *UnsignedBlob) ProtoReflect() protoreflect.Message

func (*UnsignedBlob) Reset

func (x *UnsignedBlob) Reset()

func (*UnsignedBlob) String

func (x *UnsignedBlob) String() string

Jump to

Keyboard shortcuts

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