proto

package
v0.0.0-...-b00a37c Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CmdTxSend is for creating a new transaction for sending tokens to another address
	// or anything else that the protocol allows.
	CmdTxSend = iota

	// CmdUpdate is for receiving any blocks that follow the current index of the client.
	CmdUpdate = iota

	// CmdExit signals the termination of a client-session.
	CmdExit = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback struct{}

Callback defines a custom callbacks type.

func (*Callback) GetPublicKeyForId

func (clb *Callback) GetPublicKeyForId(ss *session.SecureSession, id []byte) *keys.PublicKey

GetPublicKeyForId returns the public key for the id.

func (*Callback) StateChanged

func (clb *Callback) StateChanged(ss *session.SecureSession, state int)

StateChanged handles a state change.

type Message

type Message struct {
	Command int `json:"command" msgpack:"c"`

	// In order to make this struct flexible and expand its use, we allow the payload
	// to be any arbitrary type.
	Payload interface{} `json:"payload" msgpack:"p"`
}

Message defines what the protocol's message structure.

func Unpack

func Unpack(bytes []byte) (*Message, error)

Unpack unmarshals the msgpack encoded message into an instance of a Message.

func (*Message) Pack

func (m *Message) Pack() ([]byte, error)

Pack creates the msgpack version of the message.

Jump to

Keyboard shortcuts

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