message

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package message represents message that messagebus can route

Index

Constants

View Source
const (

	// TypeCallMethod calls method and returns result
	TypeCallMethod = core.MessageType(iota)
	// TypeCallConstructor is a message for calling constructor and obtain its reply
	TypeCallConstructor

	// TypeGetCode retrieves code from storage.
	TypeGetCode
	// TypeGetClass retrieves class from storage.
	TypeGetClass
	// TypeGetObject retrieves object from storage.
	TypeGetObject
	// TypeGetDelegate retrieves object represented as provided class.
	TypeGetDelegate
	// TypeDeclareType creates new type.
	TypeDeclareType
	// TypeDeployCode creates new code.
	TypeDeployCode
	// TypeActivateClass activates class.
	TypeActivateClass
	// TypeDeactivateClass deactivates class.
	TypeDeactivateClass
	// TypeUpdateClass amends class.
	TypeUpdateClass
	// TypeActivateObject activates object.
	TypeActivateObject
	// TypeActivateObjectDelegate similar to ActivateObjType but it creates object as parent's delegate of provided class.
	TypeActivateObjectDelegate
	// TypeDeactivateObject deactivates object.
	TypeDeactivateObject
	// TypeUpdateObject amends object.
	TypeUpdateObject
)

Variables

This section is empty.

Functions

func Deserialize

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

Deserialize returns decoded message.

func Serialize

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

Serialize returns encoded message.

Types

type ActivateClass

type ActivateClass struct {
	Domain  core.RecordRef
	Request 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) 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) 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) 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 BaseLogicEvent

type BaseLogicEvent struct {
	Caller core.RecordRef
}

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

func (*BaseLogicEvent) GetCaller

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

func (*BaseLogicEvent) TargetRole

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

type CallConstructor

type CallConstructor struct {
	BaseLogicEvent
	ClassRef  core.RecordRef
	Name      string
	Arguments core.Arguments
}

CallConstructor is a message for calling constructor and obtain its reply

func (*CallConstructor) Target

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

func (*CallConstructor) Type

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

func (*CallConstructor) WriteHash

func (e *CallConstructor) WriteHash(w io.Writer)

WriteHash implements ledger.hash.Hasher interface.

type CallMethod

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

CallMethod - Simply call method and return result

func (*CallMethod) Target

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

func (*CallMethod) Type

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

func (*CallMethod) WriteHash

func (e *CallMethod) WriteHash(w io.Writer)

WriteHash implements ledger.hash.Hasher interface.

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) 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) 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) 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) 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 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) 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) 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) 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) 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 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 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) 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) 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.

Jump to

Keyboard shortcuts

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