message

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package message represents message that messagebus can route

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(buff io.Reader) (core.Message, error)

Deserialize returns decoded message.

func MustSerializeBytes added in v0.5.0

func MustSerializeBytes(msg core.Message) []byte

MustSerializeBytes returns encoded core.Message, panics on error.

func Serialize

func Serialize(msg core.Message) (io.Reader, error)

Serialize returns io.Reader on buffer with encoded core.Message.

func SignIsCorrect added in v0.6.0

func SignIsCorrect(msg core.Message, key *ecdsa.PrivateKey) bool

SignIsCorrect checks if a sign is correct.

func SignMessage added in v0.6.0

func SignMessage(msg core.Message, key *ecdsa.PrivateKey) error

SignMessage tries to sign a core.Message.

func ToBytes added in v0.6.0

func ToBytes(msg core.Message) ([]byte, error)

ToBytes deserialize a core.Message to bytes.

Types

type ActivateClass

type ActivateClass struct {
	Domain  core.RecordRef
	Request core.RecordRef
	Code    core.RecordRef
	// contains filtered or unexported fields
}

ActivateClass activates class.

func (ActivateClass) GetCaller

func (ActivateClass) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*ActivateClass) GetSign added in v0.6.0

func (l *ActivateClass) GetSign() []byte

GetSign returns a sign.

func (*ActivateClass) SetSign added in v0.6.0

func (l *ActivateClass) SetSign(sign []byte)

SetSign sets a signature to message.

func (*ActivateClass) Target

func (e *ActivateClass) Target() *core.RecordRef

Target implementation of Message interface.

func (ActivateClass) TargetRole

func (ActivateClass) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*ActivateClass) Type

func (e *ActivateClass) Type() core.MessageType

Type implementation of Message interface.

type ActivateObject

type ActivateObject struct {
	Domain  core.RecordRef
	Request core.RecordRef
	Class   core.RecordRef
	Parent  core.RecordRef
	Memory  []byte
	// contains filtered or unexported fields
}

ActivateObject activates object.

func (ActivateObject) GetCaller

func (ActivateObject) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*ActivateObject) GetSign added in v0.6.0

func (l *ActivateObject) GetSign() []byte

GetSign returns a sign.

func (*ActivateObject) SetSign added in v0.6.0

func (l *ActivateObject) SetSign(sign []byte)

SetSign sets a signature to message.

func (*ActivateObject) Target

func (e *ActivateObject) Target() *core.RecordRef

Target implementation of Message interface.

func (ActivateObject) TargetRole

func (ActivateObject) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*ActivateObject) Type

func (e *ActivateObject) Type() core.MessageType

Type implementation of Message interface.

type ActivateObjectDelegate

type ActivateObjectDelegate struct {
	Domain  core.RecordRef
	Request core.RecordRef
	Class   core.RecordRef
	Parent  core.RecordRef
	Memory  []byte
	// contains filtered or unexported fields
}

ActivateObjectDelegate similar to ActivateObjType but it creates object as parent's delegate of provided class.

func (ActivateObjectDelegate) GetCaller

func (ActivateObjectDelegate) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*ActivateObjectDelegate) GetSign added in v0.6.0

func (l *ActivateObjectDelegate) GetSign() []byte

GetSign returns a sign.

func (*ActivateObjectDelegate) SetSign added in v0.6.0

func (l *ActivateObjectDelegate) SetSign(sign []byte)

SetSign sets a signature to message.

func (*ActivateObjectDelegate) Target

func (e *ActivateObjectDelegate) Target() *core.RecordRef

Target implementation of Message interface.

func (ActivateObjectDelegate) TargetRole

func (ActivateObjectDelegate) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*ActivateObjectDelegate) Type

Type implementation of Message interface.

type BaseLogicMessage added in v0.5.0

type BaseLogicMessage struct {
	Caller core.RecordRef
	Nonce  uint64
	// contains filtered or unexported fields
}

BaseLogicMessage base of event class family, do not use it standalone

func (*BaseLogicMessage) GetCaller added in v0.5.0

func (e *BaseLogicMessage) GetCaller() *core.RecordRef

func (*BaseLogicMessage) GetSign added in v0.6.0

func (b *BaseLogicMessage) GetSign() []byte

GetSign returns a sign.

func (*BaseLogicMessage) SetSign added in v0.6.0

func (b *BaseLogicMessage) SetSign(sign []byte)

SetSign sets a signature to message.

func (*BaseLogicMessage) TargetRole added in v0.5.0

func (e *BaseLogicMessage) TargetRole() core.JetRole

TargetRole returns RoleVirtualExecutor as routing target role.

type BootstrapRequest added in v0.6.0

type BootstrapRequest struct {
	// Name should be unique for each bootstrap record.
	Name string
	// contains filtered or unexported fields
}

BootstrapRequest is used for bootstrap records generation.

func (*BootstrapRequest) GetCaller added in v0.6.0

func (*BootstrapRequest) GetCaller() *core.RecordRef

GetCaller implementation for bootstrap request.

func (*BootstrapRequest) GetSign added in v0.6.0

func (m *BootstrapRequest) GetSign() []byte

GetSign returns a sign.

func (*BootstrapRequest) SetSign added in v0.6.0

func (m *BootstrapRequest) SetSign(sign []byte)

SetSign sets a signature to message.

func (*BootstrapRequest) Target added in v0.6.0

func (m *BootstrapRequest) Target() *core.RecordRef

Target implementation for bootstrap request.

func (*BootstrapRequest) TargetRole added in v0.6.0

func (*BootstrapRequest) TargetRole() core.JetRole

TargetRole implementation for bootstrap request.

func (*BootstrapRequest) Type added in v0.6.0

Type implementation for bootstrap request.

type CallConstructor

type CallConstructor struct {
	BaseLogicMessage
	ParentRef core.RecordRef
	SaveAs    SaveAs
	ClassRef  core.RecordRef
	Name      string
	Arguments core.Arguments
	PulseNum  core.PulseNumber
}

CallConstructor is a message for calling constructor and obtain its reply

func (*CallConstructor) GetReference added in v0.5.0

func (e *CallConstructor) GetReference() core.RecordRef

func (*CallConstructor) Target

func (e *CallConstructor) Target() *core.RecordRef

Target returns request ref as routing target.

func (*CallConstructor) Type

func (e *CallConstructor) Type() core.MessageType

Type returns TypeCallConstructor.

type CallMethod

type CallMethod struct {
	BaseLogicMessage
	ReturnMode MethodReturnMode
	ObjectRef  core.RecordRef
	Method     string
	Arguments  core.Arguments
}

CallMethod - Simply call method and return result

func (*CallMethod) GetReference added in v0.5.0

func (e *CallMethod) GetReference() core.RecordRef

func (*CallMethod) Target

func (e *CallMethod) Target() *core.RecordRef

Target returns ObjectRef as routing target.

func (*CallMethod) Type

func (e *CallMethod) Type() core.MessageType

Type returns TypeCallMethod.

type DeactivateClass

type DeactivateClass struct {
	Domain  core.RecordRef
	Request core.RecordRef
	Class   core.RecordRef
	// contains filtered or unexported fields
}

DeactivateClass deactivates class.

func (DeactivateClass) GetCaller

func (DeactivateClass) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*DeactivateClass) GetSign added in v0.6.0

func (l *DeactivateClass) GetSign() []byte

GetSign returns a sign.

func (*DeactivateClass) SetSign added in v0.6.0

func (l *DeactivateClass) SetSign(sign []byte)

SetSign sets a signature to message.

func (*DeactivateClass) Target

func (e *DeactivateClass) Target() *core.RecordRef

Target implementation of Message interface.

func (DeactivateClass) TargetRole

func (DeactivateClass) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*DeactivateClass) Type

func (e *DeactivateClass) Type() core.MessageType

Type implementation of Message interface.

type DeactivateObject

type DeactivateObject struct {
	Domain  core.RecordRef
	Request core.RecordRef
	Object  core.RecordRef
	// contains filtered or unexported fields
}

DeactivateObject deactivates object.

func (DeactivateObject) GetCaller

func (DeactivateObject) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*DeactivateObject) GetSign added in v0.6.0

func (l *DeactivateObject) GetSign() []byte

GetSign returns a sign.

func (*DeactivateObject) SetSign added in v0.6.0

func (l *DeactivateObject) SetSign(sign []byte)

SetSign sets a signature to message.

func (*DeactivateObject) Target

func (e *DeactivateObject) Target() *core.RecordRef

Target implementation of Message interface.

func (DeactivateObject) TargetRole

func (DeactivateObject) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*DeactivateObject) Type

func (e *DeactivateObject) Type() core.MessageType

Type implementation of Message interface.

type DeclareType

type DeclareType struct {
	Domain  core.RecordRef
	Request core.RecordRef
	TypeDec []byte
	// contains filtered or unexported fields
}

DeclareType creates new type.

func (DeclareType) GetCaller

func (DeclareType) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*DeclareType) GetSign added in v0.6.0

func (l *DeclareType) GetSign() []byte

GetSign returns a sign.

func (*DeclareType) SetSign added in v0.6.0

func (l *DeclareType) SetSign(sign []byte)

SetSign sets a signature to message.

func (*DeclareType) Target

func (e *DeclareType) Target() *core.RecordRef

Target implementation of Message interface.

func (DeclareType) TargetRole

func (DeclareType) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*DeclareType) Type

func (e *DeclareType) Type() core.MessageType

Type implementation of Message interface.

type DeployCode

type DeployCode struct {
	Domain  core.RecordRef
	Request core.RecordRef
	CodeMap map[core.MachineType][]byte
	// contains filtered or unexported fields
}

DeployCode creates new code.

func (DeployCode) GetCaller

func (DeployCode) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*DeployCode) GetSign added in v0.6.0

func (l *DeployCode) GetSign() []byte

GetSign returns a sign.

func (*DeployCode) SetSign added in v0.6.0

func (l *DeployCode) SetSign(sign []byte)

SetSign sets a signature to message.

func (*DeployCode) Target

func (e *DeployCode) Target() *core.RecordRef

Target implementation of Message interface.

func (DeployCode) TargetRole

func (DeployCode) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*DeployCode) Type

func (e *DeployCode) Type() core.MessageType

Type implementation of Message interface.

type ExecutorResults added in v0.6.0

type ExecutorResults struct {
	RecordRef   core.RecordRef
	CaseRecords []core.CaseRecord
	// contains filtered or unexported fields
}

func (*ExecutorResults) GetCaller added in v0.6.0

func (e *ExecutorResults) GetCaller() *core.RecordRef

TODO change after changing pulsar

func (*ExecutorResults) GetReference added in v0.6.0

func (e *ExecutorResults) GetReference() core.RecordRef

func (*ExecutorResults) GetSign added in v0.6.0

func (e *ExecutorResults) GetSign() []byte

func (*ExecutorResults) SetSign added in v0.6.0

func (e *ExecutorResults) SetSign(sign []byte)

func (*ExecutorResults) Target added in v0.6.0

func (e *ExecutorResults) Target() *core.RecordRef

func (*ExecutorResults) TargetRole added in v0.6.0

func (e *ExecutorResults) TargetRole() core.JetRole

func (*ExecutorResults) Type added in v0.6.0

func (e *ExecutorResults) Type() core.MessageType

type GetChildren added in v0.5.0

type GetChildren struct {
	Parent    core.RecordRef
	FromChild *core.RecordID
	FromPulse *core.PulseNumber
	Amount    int
	// contains filtered or unexported fields
}

GetChildren retrieves a chunk of children references.

func (GetChildren) GetCaller added in v0.5.0

func (GetChildren) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*GetChildren) GetSign added in v0.6.0

func (l *GetChildren) GetSign() []byte

GetSign returns a sign.

func (*GetChildren) SetSign added in v0.6.0

func (l *GetChildren) SetSign(sign []byte)

SetSign sets a signature to message.

func (*GetChildren) Target added in v0.5.0

func (e *GetChildren) Target() *core.RecordRef

Target implementation of Message interface.

func (GetChildren) TargetRole added in v0.5.0

func (GetChildren) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*GetChildren) Type added in v0.5.0

func (e *GetChildren) Type() core.MessageType

Type implementation of Message interface.

type GetClass

type GetClass struct {
	Head  core.RecordRef
	State *core.RecordRef // If nil, will fetch the latest state.
	// contains filtered or unexported fields
}

GetClass retrieves class from storage.

func (GetClass) GetCaller

func (GetClass) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*GetClass) GetSign added in v0.6.0

func (l *GetClass) GetSign() []byte

GetSign returns a sign.

func (*GetClass) SetSign added in v0.6.0

func (l *GetClass) SetSign(sign []byte)

SetSign sets a signature to message.

func (*GetClass) Target

func (e *GetClass) Target() *core.RecordRef

Target implementation of Message interface.

func (GetClass) TargetRole

func (GetClass) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*GetClass) Type

func (e *GetClass) Type() core.MessageType

Type implementation of Message interface.

type GetCode

type GetCode struct {
	Code        core.RecordRef
	MachinePref []core.MachineType
	// contains filtered or unexported fields
}

GetCode retrieves code from storage.

func (GetCode) GetCaller

func (GetCode) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*GetCode) GetSign added in v0.6.0

func (l *GetCode) GetSign() []byte

GetSign returns a sign.

func (*GetCode) SetSign added in v0.6.0

func (l *GetCode) SetSign(sign []byte)

SetSign sets a signature to message.

func (*GetCode) Target

func (e *GetCode) Target() *core.RecordRef

Target implementation of Message interface.

func (GetCode) TargetRole

func (GetCode) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*GetCode) Type

func (e *GetCode) Type() core.MessageType

Type implementation of Message interface.

type GetDelegate

type GetDelegate struct {
	Head    core.RecordRef
	AsClass core.RecordRef
	// contains filtered or unexported fields
}

GetDelegate retrieves object represented as provided class.

func (GetDelegate) GetCaller

func (GetDelegate) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*GetDelegate) GetSign added in v0.6.0

func (l *GetDelegate) GetSign() []byte

GetSign returns a sign.

func (*GetDelegate) SetSign added in v0.6.0

func (l *GetDelegate) SetSign(sign []byte)

SetSign sets a signature to message.

func (*GetDelegate) Target

func (e *GetDelegate) Target() *core.RecordRef

Target implementation of Message interface.

func (GetDelegate) TargetRole

func (GetDelegate) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*GetDelegate) Type

func (e *GetDelegate) Type() core.MessageType

Type implementation of Message interface.

type GetObject

type GetObject struct {
	Head  core.RecordRef
	State *core.RecordRef // If nil, will fetch the latest state.
	// contains filtered or unexported fields
}

GetObject retrieves object from storage.

func (GetObject) GetCaller

func (GetObject) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*GetObject) GetSign added in v0.6.0

func (l *GetObject) GetSign() []byte

GetSign returns a sign.

func (*GetObject) SetSign added in v0.6.0

func (l *GetObject) SetSign(sign []byte)

SetSign sets a signature to message.

func (*GetObject) Target

func (e *GetObject) Target() *core.RecordRef

Target implementation of Message interface.

func (GetObject) TargetRole

func (GetObject) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*GetObject) Type

func (e *GetObject) Type() core.MessageType

Type implementation of Message interface.

type IBaseLogicMessage added in v0.5.0

type IBaseLogicMessage interface {
	core.Message
	GetReference() core.RecordRef
}

type JetDrop added in v0.6.0

type JetDrop struct {
	Jet     core.RecordRef
	Drop    []byte
	Records [][2][]byte
	// contains filtered or unexported fields
}

JetDrop spreads jet drop

func (JetDrop) GetCaller added in v0.6.0

func (JetDrop) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*JetDrop) GetSign added in v0.6.0

func (l *JetDrop) GetSign() []byte

GetSign returns a sign.

func (*JetDrop) SetSign added in v0.6.0

func (l *JetDrop) SetSign(sign []byte)

SetSign sets a signature to message.

func (*JetDrop) Target added in v0.6.0

func (e *JetDrop) Target() *core.RecordRef

Target implementation of Message interface.

func (JetDrop) TargetRole added in v0.6.0

func (JetDrop) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*JetDrop) Type added in v0.6.0

func (e *JetDrop) Type() core.MessageType

Type implementation of Message interface.

type MethodReturnMode

type MethodReturnMode int

MethodReturnMode ENUM to set when method returns its result

const (
	// ReturnResult - return result as soon as it is ready
	ReturnResult MethodReturnMode = iota
	// ReturnNoWait - call method and return without results
	ReturnNoWait
)

type RegisterChild added in v0.5.0

type RegisterChild struct {
	Parent core.RecordRef
	Child  core.RecordRef
	// contains filtered or unexported fields
}

RegisterChild amends object.

func (RegisterChild) GetCaller added in v0.5.0

func (RegisterChild) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*RegisterChild) GetSign added in v0.6.0

func (l *RegisterChild) GetSign() []byte

GetSign returns a sign.

func (*RegisterChild) SetSign added in v0.6.0

func (l *RegisterChild) SetSign(sign []byte)

SetSign sets a signature to message.

func (*RegisterChild) Target added in v0.5.0

func (e *RegisterChild) Target() *core.RecordRef

Target implementation of Message interface.

func (RegisterChild) TargetRole added in v0.5.0

func (RegisterChild) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*RegisterChild) Type added in v0.5.0

func (e *RegisterChild) Type() core.MessageType

Type implementation of Message interface.

type RequestCall added in v0.5.0

type RequestCall struct {
	core.Message
}

RequestCall is a Ledger's message wrapping logicrunner's Call messages.

func (*RequestCall) TargetRole added in v0.5.0

func (*RequestCall) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*RequestCall) Type added in v0.5.0

func (*RequestCall) Type() core.MessageType

Type implementation of Message interface.

type SaveAs added in v0.5.0

type SaveAs int
const (
	Child SaveAs = iota
	Delegate
)

type UpdateClass

type UpdateClass struct {
	Domain     core.RecordRef
	Request    core.RecordRef
	Class      core.RecordRef
	Code       core.RecordRef
	Migrations []core.RecordRef
	// contains filtered or unexported fields
}

UpdateClass amends class.

func (UpdateClass) GetCaller

func (UpdateClass) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*UpdateClass) GetSign added in v0.6.0

func (l *UpdateClass) GetSign() []byte

GetSign returns a sign.

func (*UpdateClass) SetSign added in v0.6.0

func (l *UpdateClass) SetSign(sign []byte)

SetSign sets a signature to message.

func (*UpdateClass) Target

func (e *UpdateClass) Target() *core.RecordRef

Target implementation of Message interface.

func (UpdateClass) TargetRole

func (UpdateClass) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*UpdateClass) Type

func (e *UpdateClass) Type() core.MessageType

Type implementation of Message interface.

type UpdateObject

type UpdateObject struct {
	Domain  core.RecordRef
	Request core.RecordRef
	Object  core.RecordRef
	Memory  []byte
	// contains filtered or unexported fields
}

UpdateObject amends object.

func (UpdateObject) GetCaller

func (UpdateObject) GetCaller() *core.RecordRef

GetCaller implementation of Message interface.

func (*UpdateObject) GetSign added in v0.6.0

func (l *UpdateObject) GetSign() []byte

GetSign returns a sign.

func (*UpdateObject) SetSign added in v0.6.0

func (l *UpdateObject) SetSign(sign []byte)

SetSign sets a signature to message.

func (*UpdateObject) Target

func (e *UpdateObject) Target() *core.RecordRef

Target implementation of Message interface.

func (UpdateObject) TargetRole

func (UpdateObject) TargetRole() core.JetRole

TargetRole implementation of Message interface.

func (*UpdateObject) Type

func (e *UpdateObject) Type() core.MessageType

Type implementation of Message interface.

type ValidateCaseBind added in v0.6.0

type ValidateCaseBind struct {
	RecordRef   core.RecordRef
	CaseRecords []core.CaseRecord
	Pulse       core.Pulse
	// contains filtered or unexported fields
}

func (*ValidateCaseBind) GetCaller added in v0.6.0

func (e *ValidateCaseBind) GetCaller() *core.RecordRef

TODO change after changing pulsar

func (*ValidateCaseBind) GetCaseRecords added in v0.6.0

func (e *ValidateCaseBind) GetCaseRecords() []core.CaseRecord

func (*ValidateCaseBind) GetPulse added in v0.6.0

func (e *ValidateCaseBind) GetPulse() core.Pulse

func (*ValidateCaseBind) GetReference added in v0.6.0

func (e *ValidateCaseBind) GetReference() core.RecordRef

func (*ValidateCaseBind) GetSign added in v0.6.0

func (e *ValidateCaseBind) GetSign() []byte

func (*ValidateCaseBind) SetSign added in v0.6.0

func (e *ValidateCaseBind) SetSign(sign []byte)

func (*ValidateCaseBind) Target added in v0.6.0

func (e *ValidateCaseBind) Target() *core.RecordRef

func (*ValidateCaseBind) TargetRole added in v0.6.0

func (e *ValidateCaseBind) TargetRole() core.JetRole

func (*ValidateCaseBind) Type added in v0.6.0

func (e *ValidateCaseBind) Type() core.MessageType

type ValidationResults added in v0.6.0

type ValidationResults struct {
	RecordRef        core.RecordRef
	PassedStepsCount int
	Error            error
	// contains filtered or unexported fields
}

func (*ValidationResults) GetCaller added in v0.6.0

func (e *ValidationResults) GetCaller() *core.RecordRef

TODO change after changing pulsar

func (*ValidationResults) GetReference added in v0.6.0

func (e *ValidationResults) GetReference() core.RecordRef

func (*ValidationResults) GetSign added in v0.6.0

func (e *ValidationResults) GetSign() []byte

func (*ValidationResults) SetSign added in v0.6.0

func (e *ValidationResults) SetSign(sign []byte)

func (*ValidationResults) Target added in v0.6.0

func (e *ValidationResults) Target() *core.RecordRef

func (ValidationResults) TargetRole added in v0.6.0

func (e ValidationResults) TargetRole() core.JetRole

func (*ValidationResults) Type added in v0.6.0

Jump to

Keyboard shortcuts

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