method

package
v0.0.0-...-bb9396b Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMalformedMethodResponse    = errors.New("method response was malformed")
	ErrEmptyMethodResponse        = errors.New("method response was empty")
	ErrMethodListUnbalanced       = errors.New("method argument list is unbalanced")
	ErrTPerClosedSession          = errors.New("TPer forcefully closed our session")
	ErrReceivedUnexpectedResponse = errors.New("method response was unexpected")
	ErrMethodTimeout              = errors.New("method call timed out waiting for a response")

	MethodStatusSuccess uint = 0x00
	MethodStatusCodeMap      = map[uint]error{
		0x00: errors.New("method returned status SUCCESS"),
		0x01: errors.New("method returned status NOT_AUTHORIZED"),
		0x02: errors.New("method returned status OBSOLETE"),
		0x03: errors.New("method returned status SP_BUSY"),
		0x04: errors.New("method returned status SP_FAILED"),
		0x05: errors.New("method returned status SP_DISABLED"),
		0x06: errors.New("method returned status SP_FROZEN"),
		0x07: errors.New("method returned status NO_SESSIONS_AVAILABLE"),
		0x08: errors.New("method returned status UNIQUENESS_CONFLICT"),
		0x09: errors.New("method returned status INSUFFICIENT_SPACE"),
		0x0A: errors.New("method returned status INSUFFICIENT_ROWS"),
		0x0B: errors.New("method returned status INVALID_COMMAND"),
		0x0C: errors.New("method returned status INVALID_PARAMETER"),
		0x0D: errors.New("method returned status INVALID_REFERENCE"),
		0x0E: errors.New("method returned status INVALID_SECMSG_PROPERTIES"),
		0x0F: errors.New("method returned status TPER_MALFUNCTION"),
		0x10: errors.New("method returned status TRANSACTION_FAILURE"),
		0x11: errors.New("method returned status RESPONSE_OVERFLOW"),
		0x12: errors.New("method returned status AUTHORITY_LOCKED_OUT"),
		0x3F: errors.New("method returned status FAIL"),
	}

	ErrMethodStatusNotAuthorized       = MethodStatusCodeMap[0x01]
	ErrMethodStatusSPBusy              = MethodStatusCodeMap[0x03]
	ErrMethodStatusNoSessionsAvailable = MethodStatusCodeMap[0x07]
	ErrMethodStatusInvalidParameter    = MethodStatusCodeMap[0x0C]
	ErrMethodStatusAuthorityLockedOut  = MethodStatusCodeMap[0x12]
)

Functions

This section is empty.

Types

type Call

type Call interface {
	MarshalBinary() ([]byte, error)
	IsEOS() bool
}

type EOSMethodCall

type EOSMethodCall struct {
}

func (*EOSMethodCall) IsEOS

func (m *EOSMethodCall) IsEOS() bool

func (*EOSMethodCall) MarshalBinary

func (m *EOSMethodCall) MarshalBinary() ([]byte, error)

type MethodCall

type MethodCall struct {
	// contains filtered or unexported fields
}

func NewMethodCall

func NewMethodCall(iid uid.InvokingID, mid uid.MethodID, flags MethodFlag) *MethodCall

Prepare a new method call

func (*MethodCall) Bool

func (m *MethodCall) Bool(v bool)

Bool adds a bool atom (as uint)

func (*MethodCall) Bytes

func (m *MethodCall) Bytes(b []byte)

Bytes adds a bytes atom

func (*MethodCall) Clone

func (m *MethodCall) Clone() *MethodCall

Copy the current state of a method call into a new independent copy

func (*MethodCall) EndList

func (m *MethodCall) EndList()

func (*MethodCall) EndOptionalParameter

func (m *MethodCall) EndOptionalParameter()

EndOptionalParameter ends the current optional parameter group

func (*MethodCall) IsEOS

func (m *MethodCall) IsEOS() bool

func (*MethodCall) MarshalBinary

func (m *MethodCall) MarshalBinary() ([]byte, error)

Marshal the complete method call to the data stream representation

func (*MethodCall) NamedBool

func (m *MethodCall) NamedBool(name string, val bool)

Add a named value (bool) pair

func (*MethodCall) NamedUInt

func (m *MethodCall) NamedUInt(name string, val uint)

Add a named value (uint) pair

func (*MethodCall) RawByte

func (m *MethodCall) RawByte(b []byte)

func (*MethodCall) StartList

func (m *MethodCall) StartList()

func (*MethodCall) StartOptionalParameter

func (m *MethodCall) StartOptionalParameter(id uint, name string)

Start an optional parameters group

From "3.2.1.2 Method Signature Pseudo-code" > Optional parameters are submitted to the method invocation as Named value pairs. > The Name portion of the Named value pair SHALL be a uinteger. Starting at zero, > these uinteger values are assigned based on the ordering of the optional parameters > as defined in this document. The above is true for Core 2.0 things like OpalV2 but not for e.g. Enterprise. Thus, we provide a way for the code to switch between using uint or string.

func (*MethodCall) Token

func (m *MethodCall) Token(t stream.TokenType)

Token adds a specific token to the MethodCall buffer.

func (*MethodCall) UInt

func (m *MethodCall) UInt(v uint)

UInt adds an uint atom

type MethodFlag

type MethodFlag int
const (
	MethodFlagOptionalAsName MethodFlag = 1
)

Jump to

Keyboard shortcuts

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