reply

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: Apache-2.0 Imports: 7 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 = insolar.ReplyType(iota + 1)
	// TypeOK is a generic reply for signaling a positive result.
	TypeOK
	// TypeNotOK is a generic reply for signaling a negative result.
	TypeNotOK

	// TypeCallMethod - two binary fields: data and results.
	TypeCallMethod
	// TypeRegisterRequest - request for execution was registered
	TypeRegisterRequest
)
View Source
const (
	// ErrDeactivated returned when requested object is deactivated.
	ErrDeactivated = iota + 1
	// ErrStateNotAvailable is returned when requested object is deactivated.
	ErrStateNotAvailable
	// ErrHotDataTimeout is returned when no hot data received for a specific jet
	ErrHotDataTimeout
	// ErrNoPendingRequests is returned when there are no pending requests on current LME
	ErrNoPendingRequests
	// FlowCancelled is returned when a new pulse happened in the process of message execution
	FlowCancelled
)

Variables

This section is empty.

Functions

func Deserialize

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

Deserialize returns decoded reply.

func Serialize

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

Serialize returns encoded reply.

func ToBytes

func ToBytes(rep insolar.Reply) []byte

ToBytes deserializes reply to bytes.

func UnmarshalFromMeta

func UnmarshalFromMeta(meta []byte) (insolar.Reply, error)

UnmarshalFromMeta reads only payload skipping meta decoding. Use this instead of regular Unmarshal if you don't need Meta data.

Types

type CallMethod

type CallMethod struct {
	Object *insolar.Reference
	Result []byte
}

CallMethod - the most common reply

func (*CallMethod) Type

func (r *CallMethod) Type() insolar.ReplyType

Type returns type of the reply

type ErrType

type ErrType int

ErrType is used to determine and compare reply errors.

type Error

type Error struct {
	ErrType ErrType
}

Error is common error reaction.

func (*Error) Error

func (e *Error) Error() error

Error returns concrete error for stored type.

func (*Error) Type

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

Type implementation of Reply interface.

type NotOK

type NotOK struct {
}

NotOK is a generic reply for signaling a negative result.

func (*NotOK) Type

func (e *NotOK) Type() insolar.ReplyType

Type implementation of Reply interface.

type OK

type OK struct {
}

OK is a generic reply for signaling a positive result.

func (*OK) Type

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

Type implementation of Reply interface.

type RegisterRequest

type RegisterRequest struct {
	Request insolar.Reference
}

func (*RegisterRequest) Type

func (r *RegisterRequest) Type() insolar.ReplyType

Type returns type of the reply

Jump to

Keyboard shortcuts

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