packager

package
v0.0.0-...-270fe73 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope struct {
	Message    *MessageData   `json:"message,omitempty"`
	Connection *MsgConnection `json:"connection,omitempty"`
	FromDID    string         `json:"fromdid,omitempty"`
	ToDID      string         `json:"todid,omitempty"`
}

type MessageData

type MessageData struct {
	Data    []byte `json:"data,omitempty"`
	MsgType int    `json:"msgtype,omitempty"`
	Sign    []byte `json:"sign,omitempty"`
}

type MsgConnection

type MsgConnection struct {
	Data []byte `json:"data,omitempty"` //Connection
	Sign []byte `json:"sign,omitempty"`
}

type Packager

type Packager interface {
	//PackConnection
	PackConnection(data []byte, did string) (*MsgConnection, error)
	//UnPackConnection
	UnPackConnection(data *Envelope) (*MsgConnection, error)
	//PackMessage
	PackMessage(envelope *MessageData, destDid string) (*MessageData, error)
	//UnpackMessage
	UnpackMessage(data *MessageData, sourceDid string) (*MessageData, error)
	//PackData
	PackData(envelope *Envelope) ([]byte, error)
	//UnPackData
	UnPackData(enData []byte) (*Envelope, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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