message

package
v1.5.19 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBytesToString added in v1.5.19

func FromBytesToString(pMsg []byte) string

func FromStringToBytes added in v1.5.19

func FromStringToBytes(pMsg string) []byte

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 {
	types.IConverter
	IsValid(ISettings) bool

	GetHead() IHead
	GetBody() IBody
}

func LoadMessage

func LoadMessage(psett ISettings, pMsg interface{}) IMessage

Message can be created only with client module.

type ISettings added in v1.5.7

type ISettings interface {
	GetMessageSizeBytes() uint64
	GetWorkSizeBits() uint64
}

func NewSettings added in v1.5.7

func NewSettings(pSett *SSettings) ISettings

type SBodyMessage

type SBodyMessage struct {
	FSign    string `json:"sign"`
	FHash    string `json:"hash"`
	FProof   string `json:"proof"`
	FPayload []byte `json:"-"`
}

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

func (*SMessage) ToString added in v1.5.14

func (p *SMessage) ToString() string

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