Documentation ¶
Overview ¶
Package message represents message that messagebus can route
Index ¶
- func Deserialize(buff io.Reader) (core.Parcel, error)
- func DeserializeParcel(buff io.Reader) (core.Parcel, error)
- func ExtractAllowedSenderObjectAndRole(msg core.Message) (*core.RecordRef, core.DynamicRole)
- func ExtractRole(msg core.Message) core.DynamicRole
- func ExtractTarget(msg core.Message) core.RecordRef
- func MustSerializeBytes(msg core.Message) []byte
- func ParcelToBytes(msg core.Parcel) []byte
- func Serialize(msg core.Message) (io.Reader, error)
- func SerializeParcel(parcel core.Parcel) (io.Reader, error)
- func ToBytes(msg core.Message) []byte
- type BaseLogicMessage
- type CallConstructor
- type CallMethod
- type ExecutorResults
- type GenesisRequest
- type GetChildren
- type GetCode
- type GetDelegate
- type GetObject
- type GetObjectIndex
- type HeavyPayload
- type HeavyStartStop
- type IBaseLogicMessage
- type JetDrop
- type MethodReturnMode
- type Parcel
- func (sm *Parcel) AddDelegationToken(token core.DelegationToken)
- func (sm *Parcel) Context(ctx context.Context) context.Context
- func (sm *Parcel) DelegationToken() core.DelegationToken
- func (sm *Parcel) GetCaller() *core.RecordRef
- func (sm *Parcel) GetSender() core.RecordRef
- func (sm *Parcel) GetSign() []byte
- func (sm *Parcel) Message() core.Message
- func (sm *Parcel) Type() core.MessageType
- type ParcelFactory
- type RegisterChild
- type SaveAs
- type SetBlob
- type SetRecord
- type UpdateObject
- type ValidateCaseBind
- type ValidateRecord
- type ValidationResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deserialize ¶
Deserialize returns decoded message.
func DeserializeParcel ¶ added in v0.6.3
DeserializeParcel returns decoded signed message.
func ExtractAllowedSenderObjectAndRole ¶ added in v0.6.3
ExtractAllowedSenderObjectAndRole extracts information from message verify sender required to 's "caller" for sender verification purpose. If nil then check of sender's role is not provided by the message bus
func ExtractRole ¶ added in v0.6.3
func ExtractRole(msg core.Message) core.DynamicRole
func MustSerializeBytes ¶ added in v0.5.0
MustSerializeBytes returns encoded core.Message, panics on error.
func ParcelToBytes ¶ added in v0.6.3
ParcelToBytes deserialize a core.Parcel to bytes.
func SerializeParcel ¶ added in v0.6.3
SerializeParcel returns io.Reader on buffer with encoded core.Parcel.
Types ¶
type BaseLogicMessage ¶ added in v0.5.0
type BaseLogicMessage struct { Caller core.RecordRef Request core.RecordRef CallerPrototype core.RecordRef Nonce uint64 }
BaseLogicMessage base of event class family, do not use it standalone
func (*BaseLogicMessage) GetCaller ¶ added in v0.5.0
func (m *BaseLogicMessage) GetCaller() *core.RecordRef
func (*BaseLogicMessage) GetCallerPrototype ¶ added in v0.6.3
func (m *BaseLogicMessage) GetCallerPrototype() *core.RecordRef
func (*BaseLogicMessage) GetRequest ¶ added in v0.6.1
func (m *BaseLogicMessage) GetRequest() core.RecordRef
GetRequest returns DynamicRoleVirtualExecutor as routing target role.
type CallConstructor ¶
type CallConstructor struct { BaseLogicMessage ParentRef core.RecordRef SaveAs SaveAs PrototypeRef 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 (m *CallConstructor) GetReference() core.RecordRef
func (*CallConstructor) Type ¶
func (m *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 (m *CallMethod) GetReference() core.RecordRef
type ExecutorResults ¶ added in v0.6.0
type ExecutorResults struct { Caller core.RecordRef RecordRef core.RecordRef CaseBind core.CaseBind }
func (*ExecutorResults) GetCaller ¶ added in v0.6.0
func (m *ExecutorResults) GetCaller() *core.RecordRef
TODO change after changing pulsar
func (*ExecutorResults) GetReference ¶ added in v0.6.0
func (m *ExecutorResults) GetReference() core.RecordRef
func (*ExecutorResults) Type ¶ added in v0.6.0
func (m *ExecutorResults) Type() core.MessageType
type GenesisRequest ¶ added in v0.6.3
type GenesisRequest struct { // Name should be unique for each genesis record. Name string }
GenesisRequest is used for genesis records generation.
func (*GenesisRequest) GetCaller ¶ added in v0.6.3
func (*GenesisRequest) GetCaller() *core.RecordRef
GetCaller implementation for genesis request.
func (*GenesisRequest) Type ¶ added in v0.6.3
func (*GenesisRequest) Type() core.MessageType
Type implementation for genesis request.
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) Type ¶ added in v0.5.0
func (e *GetChildren) Type() core.MessageType
Type implementation of Message interface.
type GetCode ¶
GetCode retrieves code From storage.
func (*GetCode) Type ¶
func (e *GetCode) Type() core.MessageType
Type implementation of Message interface.
type GetDelegate ¶
type GetDelegate struct { Head core.RecordRef AsType core.RecordRef // contains filtered or unexported fields }
GetDelegate retrieves object represented as provided type.
func (*GetDelegate) Type ¶
func (e *GetDelegate) Type() core.MessageType
Type implementation of Message interface.
type GetObject ¶
type GetObject struct { Head core.RecordRef State *core.RecordID // If nil, will fetch the latest state. Approved bool // contains filtered or unexported fields }
GetObject retrieves object From storage.
func (*GetObject) Type ¶
func (e *GetObject) Type() core.MessageType
Type implementation of Message interface.
type GetObjectIndex ¶ added in v0.6.3
GetObjectIndex fetches objects index.
func (*GetObjectIndex) Type ¶ added in v0.6.3
func (*GetObjectIndex) Type() core.MessageType
Type implementation of Message interface.
type HeavyPayload ¶ added in v0.6.3
type HeavyPayload struct { PulseNum core.PulseNumber Records []core.KV }
HeavyPayload carries Key/Value records and pulse number that replicates to Heavy Material node.
func (HeavyPayload) GetCaller ¶ added in v0.6.3
func (HeavyPayload) GetCaller() *core.RecordRef
GetCaller implementation of Message interface.
func (*HeavyPayload) Type ¶ added in v0.6.3
func (e *HeavyPayload) Type() core.MessageType
Type implementation of Message interface.
type HeavyStartStop ¶ added in v0.6.3
type HeavyStartStop struct { PulseNum core.PulseNumber Finished bool }
HeavyStartStop carries heavy replication start/stop signal with pulse range.
func (HeavyStartStop) GetCaller ¶ added in v0.6.3
func (HeavyStartStop) GetCaller() *core.RecordRef
GetCaller implementation of Message interface.
func (*HeavyStartStop) Type ¶ added in v0.6.3
func (e *HeavyStartStop) Type() core.MessageType
Type implementation of Message interface.
type IBaseLogicMessage ¶ added in v0.5.0
type JetDrop ¶ added in v0.6.0
type JetDrop struct { Jet core.RecordRef Drop []byte Messages [][]byte PulseNumber core.PulseNumber // contains filtered or unexported fields }
JetDrop spreads jet drop
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 Parcel ¶ added in v0.6.3
type Parcel struct { Sender core.RecordRef Msg core.Message Signature []byte LogTraceID string TraceSpanData []byte Token core.DelegationToken }
Parcel is a message signed by senders private key.
func (*Parcel) AddDelegationToken ¶ added in v0.6.3
func (sm *Parcel) AddDelegationToken(token core.DelegationToken)
func (*Parcel) Context ¶ added in v0.6.3
Context returns initialized context with propagated data with ctx as parent.
func (*Parcel) DelegationToken ¶ added in v0.6.3
func (sm *Parcel) DelegationToken() core.DelegationToken
func (*Parcel) Type ¶ added in v0.6.3
func (sm *Parcel) Type() core.MessageType
Type returns message type.
type ParcelFactory ¶ added in v0.6.3
type RegisterChild ¶ added in v0.5.0
type RegisterChild struct { Record []byte Parent core.RecordRef Child core.RecordRef AsType *core.RecordRef // If not nil, considered as delegate. // contains filtered or unexported fields }
RegisterChild amends object.
func (*RegisterChild) Type ¶ added in v0.5.0
func (e *RegisterChild) Type() core.MessageType
Type implementation of Message interface.
type SetBlob ¶ added in v0.6.2
type SetBlob struct { TargetRef core.RecordRef Memory []byte // contains filtered or unexported fields }
SetBlob saves blob in storage.
func (*SetBlob) Type ¶ added in v0.6.2
func (*SetBlob) Type() core.MessageType
Type implementation of Message interface.
type SetRecord ¶ added in v0.6.1
type SetRecord struct { Record []byte TargetRef core.RecordRef // contains filtered or unexported fields }
SetRecord saves record in storage.
func (*SetRecord) Type ¶ added in v0.6.1
func (e *SetRecord) Type() core.MessageType
Type implementation of Message interface.
type UpdateObject ¶
type UpdateObject struct { Record []byte Object core.RecordRef // contains filtered or unexported fields }
UpdateObject amends object.
func (*UpdateObject) Type ¶
func (e *UpdateObject) Type() core.MessageType
Type implementation of Message interface.
type ValidateCaseBind ¶ added in v0.6.0
type ValidateCaseBind struct { Caller core.RecordRef RecordRef core.RecordRef CaseBind core.CaseBind Pulse core.Pulse }
func (*ValidateCaseBind) GetCaller ¶ added in v0.6.0
func (m *ValidateCaseBind) GetCaller() *core.RecordRef
TODO change after changing pulsar
func (*ValidateCaseBind) GetPulse ¶ added in v0.6.0
func (m *ValidateCaseBind) GetPulse() core.Pulse
func (*ValidateCaseBind) GetReference ¶ added in v0.6.0
func (m *ValidateCaseBind) GetReference() core.RecordRef
func (*ValidateCaseBind) Type ¶ added in v0.6.0
func (m *ValidateCaseBind) Type() core.MessageType
type ValidateRecord ¶ added in v0.6.2
type ValidateRecord struct { Object core.RecordRef State core.RecordID IsValid bool ValidationMessages []core.Message // contains filtered or unexported fields }
ValidateRecord creates VM validation for specific object record.
func (*ValidateRecord) Type ¶ added in v0.6.2
func (*ValidateRecord) Type() core.MessageType
Type implementation of Message interface.
type ValidationResults ¶ added in v0.6.0
type ValidationResults struct { Caller core.RecordRef RecordRef core.RecordRef PassedStepsCount int Error string }
func (*ValidationResults) GetCaller ¶ added in v0.6.0
func (m *ValidationResults) GetCaller() *core.RecordRef
TODO change after changing pulsar
func (*ValidationResults) GetReference ¶ added in v0.6.0
func (m *ValidationResults) GetReference() core.RecordRef
func (*ValidationResults) Type ¶ added in v0.6.0
func (m *ValidationResults) Type() core.MessageType