Documentation ¶
Overview ¶
Package reply represents responses to messages of the messagebus
Index ¶
- Constants
- func Deserialize(buff io.Reader) (core.Reply, error)
- func Serialize(reply core.Reply) (io.Reader, error)
- func ToBytes(rep core.Reply) []byte
- type CallConstructor
- type CallMethod
- type Children
- type Code
- type Delegate
- type ErrType
- type Error
- type GetChildrenRedirect
- type GetCodeRedirect
- type GetObjectRedirect
- type ID
- type OK
- type Object
- type ObjectIndex
Constants ¶
const ( // TypeError is reply with error. TypeError = core.ReplyType(iota + 1) // TypeOK is a generic reply for success calls without returned value. TypeOK TypeGetCodeRedirect TypeGetObjectRedirect TypeGetChildrenRedirect // TypeCallMethod - two binary fields: data and results. TypeCallMethod // TypeCallConstructor - reference on created object TypeCallConstructor // TypeCode is code from storage. TypeCode // TypeObject is object from storage. TypeObject // TypeDelegate is delegate reference from storage. TypeDelegate // TypeID is common reply for methods returning id to lifeline states. TypeID // TypeChildren is a reply for fetching objects children in chunks. TypeChildren // TypeObjectIndex contains serialized object index. It can be stored in DB without processing. TypeObjectIndex )
const ( // ErrDeactivated returned when requested object is deactivated. ErrDeactivated = iota + 1 ErrStateNotAvailable )
Variables ¶
This section is empty.
Functions ¶
func Deserialize ¶
Deserialize returns decoded reply.
Types ¶
type CallConstructor ¶ added in v0.5.0
func (*CallConstructor) Type ¶ added in v0.5.0
func (r *CallConstructor) Type() core.ReplyType
Type returns type of the reply
type CallMethod ¶ added in v0.5.0
CallMethod - the most common reply
func (*CallMethod) Type ¶ added in v0.5.0
func (r *CallMethod) Type() core.ReplyType
Type returns type of the reply
type Children ¶ added in v0.5.0
Children is common reaction for methods returning id to lifeline states.
type Code ¶
type Code struct { Code []byte MachineType core.MachineType }
Code is code from storage.
type ErrType ¶ added in v0.6.0
type ErrType int
ErrType is used to determine and compare reply errors.
type Error ¶ added in v0.6.0
type Error struct {
ErrType ErrType
}
Error is common reaction for methods returning id to lifeline states.
type GetChildrenRedirect ¶ added in v0.6.3
type GetChildrenRedirect struct { Receiver *core.RecordRef Token core.DelegationToken }
GetChildrenRedirect is a redirect reply for get children.
func NewGetChildrenRedirect ¶ added in v0.6.3
func NewGetChildrenRedirect( factory core.DelegationTokenFactory, parcel core.Parcel, receiver *core.RecordRef, ) (*GetChildrenRedirect, error)
NewGetChildrenRedirect creates a new instance of GetChildrenRedirect.
func (*GetChildrenRedirect) GetReceiver ¶ added in v0.6.3
func (r *GetChildrenRedirect) GetReceiver() *core.RecordRef
GetReceiver returns node reference to send message to.
func (*GetChildrenRedirect) GetToken ¶ added in v0.6.3
func (r *GetChildrenRedirect) GetToken() core.DelegationToken
GetToken returns delegation token.
func (*GetChildrenRedirect) Redirected ¶ added in v0.6.3
func (r *GetChildrenRedirect) Redirected(genericMsg core.Message) core.Message
Redirected creates redirected message from redirect data.
func (*GetChildrenRedirect) Type ¶ added in v0.6.3
func (r *GetChildrenRedirect) Type() core.ReplyType
Type returns type of the reply
type GetCodeRedirect ¶ added in v0.6.3
type GetCodeRedirect struct { Receiver *core.RecordRef Token core.DelegationToken }
GetCodeRedirect is a redirect reply for get children.
func NewGetCodeRedirect ¶ added in v0.6.3
func NewGetCodeRedirect( factory core.DelegationTokenFactory, parcel core.Parcel, receiver *core.RecordRef, ) (*GetCodeRedirect, error)
NewGetCodeRedirect creates a new instance of GetChildrenRedirect.
func (*GetCodeRedirect) GetReceiver ¶ added in v0.6.3
func (r *GetCodeRedirect) GetReceiver() *core.RecordRef
GetReceiver returns node reference to send message to.
func (*GetCodeRedirect) GetToken ¶ added in v0.6.3
func (r *GetCodeRedirect) GetToken() core.DelegationToken
GetToken returns delegation token.
func (*GetCodeRedirect) Redirected ¶ added in v0.6.3
func (r *GetCodeRedirect) Redirected(genericMsg core.Message) core.Message
Redirected creates redirected message from redirect data.
func (*GetCodeRedirect) Type ¶ added in v0.6.3
func (r *GetCodeRedirect) Type() core.ReplyType
Type returns type of the reply
type GetObjectRedirect ¶ added in v0.6.3
type GetObjectRedirect struct { Receiver *core.RecordRef Token core.DelegationToken StateID *core.RecordID }
GetObjectRedirect is a redirect-reply for get object
func NewGetObjectRedirectReply ¶ added in v0.6.3
func NewGetObjectRedirectReply( factory core.DelegationTokenFactory, parcel core.Parcel, receiver *core.RecordRef, state *core.RecordID, ) (*GetObjectRedirect, error)
NewGetObjectRedirectReply return new GetObjectRedirect
func (*GetObjectRedirect) GetReceiver ¶ added in v0.6.3
func (r *GetObjectRedirect) GetReceiver() *core.RecordRef
GetReceiver returns node reference to send message to.
func (*GetObjectRedirect) GetToken ¶ added in v0.6.3
func (r *GetObjectRedirect) GetToken() core.DelegationToken
GetToken returns delegation token.
func (*GetObjectRedirect) Redirected ¶ added in v0.6.3
func (r *GetObjectRedirect) Redirected(genericMsg core.Message) core.Message
Redirected creates redirected message from redirect data.
func (*GetObjectRedirect) Type ¶ added in v0.6.3
func (r *GetObjectRedirect) Type() core.ReplyType
Type returns type of the reply
type OK ¶ added in v0.6.0
type OK struct { }
OK is a generic reply for success calls without returned value.
type Object ¶
type Object struct { Head core.RecordRef State core.RecordID Prototype *core.RecordRef IsPrototype bool ChildPointer *core.RecordID Memory []byte Parent core.RecordRef }
Object is object from storage.
type ObjectIndex ¶ added in v0.6.3
type ObjectIndex struct {
Index []byte
}
ObjectIndex contains serialized object index. It can be stored in DB without processing.
func (*ObjectIndex) Type ¶ added in v0.6.3
func (e *ObjectIndex) Type() core.ReplyType
Type implementation of Reply interface.