message

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IBody

type IBody interface {
	GetPayload() payload.IPayload
	GetHash() []byte
	GetSign() []byte
	GetProof() uint64
}

type IHead

type IHead interface {
	GetSender() []byte
	GetSession() []byte
	GetSalt() []byte
}

type IMessage

type IMessage interface {
	GetHead() IHead
	GetBody() IBody

	IsValid(ISettings) bool
	ToBytes() []byte
}

func LoadMessage

func LoadMessage(psett ISettings, pMsg []byte) IMessage

Message can be created only with client module.

type ISettings added in v1.5.7

type ISettings interface {
	GetMessageSize() uint64
	GetWorkSize() uint64
}

func NewSettings added in v1.5.7

func NewSettings(pSett *SSettings) ISettings

type SBodyMessage

type SBodyMessage struct {
	FPayload string `json:"payload"`
	FSign    string `json:"sign"`
	FHash    string `json:"hash"`
	FProof   string `json:"proof"`
}

func (SBodyMessage) GetHash added in v1.5.6

func (p SBodyMessage) GetHash() []byte

func (SBodyMessage) GetPayload added in v1.5.6

func (p SBodyMessage) GetPayload() payload.IPayload

func (SBodyMessage) GetProof added in v1.5.6

func (p SBodyMessage) GetProof() uint64

func (SBodyMessage) GetSign added in v1.5.6

func (p SBodyMessage) GetSign() []byte

type SHeadMessage

type SHeadMessage struct {
	FSalt    string `json:"salt"`
	FSession string `json:"session"`
	FSender  string `json:"sender"`
}

func (SHeadMessage) GetSalt added in v1.5.6

func (p SHeadMessage) GetSalt() []byte

func (SHeadMessage) GetSender added in v1.5.6

func (p SHeadMessage) GetSender() []byte

func (SHeadMessage) GetSession added in v1.5.6

func (p SHeadMessage) GetSession() []byte

type SMessage

type SMessage struct {
	FHead SHeadMessage `json:"head"`
	FBody SBodyMessage `json:"body"`
}

Basic structure of transport package.

func (*SMessage) GetBody added in v1.5.6

func (p *SMessage) GetBody() IBody

func (*SMessage) GetHead added in v1.5.6

func (p *SMessage) GetHead() IHead

func (*SMessage) IsValid

func (p *SMessage) IsValid(psett ISettings) bool

func (*SMessage) ToBytes added in v1.5.6

func (p *SMessage) ToBytes() []byte

type SSettings added in v1.5.7

type SSettings sSettings

Jump to

Keyboard shortcuts

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