reply

package
v0.6.1 Latest Latest
Warning

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

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

Documentation

Overview

Package reply represents responses to messages of the messagebus

Index

Constants

View Source
const (

	// TypeError is reply with error.
	TypeError = core.ReplyType(iota + 1)
	// TypeOK is a generic reply for success calls without returned value.
	TypeOK

	// TypeCallMethod - two binary fields: data and results.
	TypeCallMethod
	// TypeCallConstructor - reference on created object
	TypeCallConstructor

	// TypeCode is code from storage.
	TypeCode
	// TypeClass is class from storage.
	TypeClass
	// TypeObject is object from storage.
	TypeObject
	// TypeDelegate is delegate reference from storage.
	TypeDelegate
	// TypeReference is common reply for methods returning reference to created records.
	TypeReference
	// TypeID is common reply for methods returning id to lifeline states.
	TypeID
	// TypeChildren is a reply for fetching objects children in chunks.
	TypeChildren
)
View Source
const (
	// ErrDeactivated returned when requested object is deactivated.
	ErrDeactivated = iota + 1
)

Variables

This section is empty.

Functions

func Deserialize

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

Deserialize returns decoded reply.

func Serialize

func Serialize(reply core.Reply) (io.Reader, error)

Serialize returns encoded reply.

Types

type CallConstructor added in v0.5.0

type CallConstructor struct {
	Object *core.RecordRef
}

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

type CallMethod struct {
	Data   []byte
	Result []byte
}

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

type Children struct {
	Refs     []core.RecordRef
	NextFrom *core.RecordID
}

Children is common reaction for methods returning id to lifeline states.

func (*Children) Type added in v0.5.0

func (e *Children) Type() core.ReplyType

Type implementation of Reply interface.

type Class

type Class struct {
	Head        core.RecordRef
	State       core.RecordID
	Code        *core.RecordRef // Can be nil.
	MachineType core.MachineType
}

Class is class from storage.

func (*Class) Type

func (e *Class) Type() core.ReplyType

Type implementation of Reply interface.

type Code

type Code struct {
	Code        []byte
	MachineType core.MachineType
}

Code is code from storage.

func (*Code) Type

func (e *Code) Type() core.ReplyType

Type implementation of Reply interface.

type Delegate

type Delegate struct {
	Head core.RecordRef
}

Delegate is delegate reference from storage.

func (*Delegate) Type

func (e *Delegate) Type() core.ReplyType

Type implementation of Reply interface.

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.

func (*Error) Error added in v0.6.0

func (e *Error) Error() error

Error returns concrete error for stored type.

func (*Error) Type added in v0.6.0

func (e *Error) Type() core.ReplyType

Type implementation of Reply interface.

type ID added in v0.5.0

type ID struct {
	ID core.RecordID
}

ID is common reaction for methods returning id to lifeline states.

func (*ID) Type added in v0.5.0

func (e *ID) Type() core.ReplyType

Type implementation of Reply interface.

type OK added in v0.6.0

type OK struct {
}

OK is a generic reply for success calls without returned value.

func (*OK) Type added in v0.6.0

func (e *OK) Type() core.ReplyType

Type implementation of Reply interface.

type Object

type Object struct {
	Head   core.RecordRef
	State  core.RecordID
	Class  core.RecordRef
	Memory []byte
}

Object is object from storage.

func (*Object) Type

func (e *Object) Type() core.ReplyType

Type implementation of Reply interface.

type Reference

type Reference struct {
	Ref core.RecordRef
}

Reference is common reaction for methods returning reference to created records.

func (*Reference) Type

func (e *Reference) Type() core.ReplyType

Type implementation of Reply interface.

Jump to

Keyboard shortcuts

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