definitions

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrUnableToCastFieldInfo is returned when the field info cannot be cast.
	ErrUnableToCastFieldInfo = errors.New("unable to cast to field info")
)

Functions

This section is empty.

Types

type Definitions

type Definitions struct {
	Types              map[string]int32
	LedgerEntryTypes   map[string]int32
	Fields             fieldInstanceMap
	TransactionResults map[string]int32
	TransactionTypes   map[string]int32
	FieldIDNameMap     map[FieldHeader]string
}

func Get

func Get() *Definitions

func (*Definitions) CreateFieldHeader

func (d *Definitions) CreateFieldHeader(tc, fc int32) FieldHeader

CreateFieldHeader creates a new field header.

func (*Definitions) GetFieldCodeByFieldName

func (d *Definitions) GetFieldCodeByFieldName(n string) (int32, error)

Returns the field code associated with the given field name.

func (*Definitions) GetFieldHeaderByFieldName

func (d *Definitions) GetFieldHeaderByFieldName(n string) (*FieldHeader, error)

Returns the field header struct associated with the given field name.

func (*Definitions) GetFieldInfoByFieldName

func (d *Definitions) GetFieldInfoByFieldName(n string) (*FieldInfo, error)

Returns the field info struct associated with the given field name.

func (*Definitions) GetFieldInstanceByFieldName

func (d *Definitions) GetFieldInstanceByFieldName(n string) (*FieldInstance, error)

Returns the field instance struct associated with the given field name.

func (*Definitions) GetFieldNameByFieldHeader

func (d *Definitions) GetFieldNameByFieldHeader(fh FieldHeader) (string, error)

Returns the field name associated with the given field header struct.

func (*Definitions) GetLedgerEntryTypeCodeByLedgerEntryTypeName

func (d *Definitions) GetLedgerEntryTypeCodeByLedgerEntryTypeName(n string) (int32, error)

Returns the ledger entry type code associated with the ledger entry type name.

func (*Definitions) GetLedgerEntryTypeNameByLedgerEntryTypeCode

func (d *Definitions) GetLedgerEntryTypeNameByLedgerEntryTypeCode(c int32) (string, error)

Returns the ledger entry type name associated with the ledger entry type code.

func (*Definitions) GetTransactionResultNameByTransactionResultTypeCode

func (d *Definitions) GetTransactionResultNameByTransactionResultTypeCode(c int32) (string, error)

Returns the transaction result name associated with the transaction result type code.

func (*Definitions) GetTransactionResultTypeCodeByTransactionResultName

func (d *Definitions) GetTransactionResultTypeCodeByTransactionResultName(n string) (int32, error)

Returns the transaction result type code associated with the transaction result name.

func (*Definitions) GetTransactionTypeCodeByTransactionTypeName

func (d *Definitions) GetTransactionTypeCodeByTransactionTypeName(n string) (int32, error)

Returns the transaction type code associated with the transaction type name.

func (*Definitions) GetTransactionTypeNameByTransactionTypeCode

func (d *Definitions) GetTransactionTypeNameByTransactionTypeCode(c int32) (string, error)

Returns the transaction type name associated with the transaction type code.

func (*Definitions) GetTypeCodeByFieldName

func (d *Definitions) GetTypeCodeByFieldName(n string) (int32, error)

Returns the type code associated with the given field name.

func (*Definitions) GetTypeCodeByTypeName

func (d *Definitions) GetTypeCodeByTypeName(n string) (int32, error)

Returns the type code associated with the given type name.

func (*Definitions) GetTypeNameByFieldName

func (d *Definitions) GetTypeNameByFieldName(n string) (string, error)

Returns the serialization data type for the given field name.

type FieldHeader

type FieldHeader struct {
	TypeCode  int32
	FieldCode int32
}

FieldHeader is a struct that represents the field header.

type FieldInfo

type FieldInfo struct {
	Nth            int32
	IsVLEncoded    bool
	IsSerialized   bool
	IsSigningField bool
	Type           string
}

FieldInfo is a struct that represents the field info.

type FieldInstance

type FieldInstance struct {
	FieldName string
	*FieldInfo
	FieldHeader *FieldHeader
	Ordinal     int32
}

FieldInstance is a struct that represents a field instance.

type NotFoundError

type NotFoundError struct {
	Instance string
	Input    string
}

NotFoundError is an error that occurs when a value is not found.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotFoundErrorFieldHeader

type NotFoundErrorFieldHeader struct {
	Instance string
	Input    FieldHeader
}

NotFoundErrorFieldHeader is an error that occurs when a value is not found.

func (*NotFoundErrorFieldHeader) Error

func (e *NotFoundErrorFieldHeader) Error() string

Error implements the error interface.

type NotFoundErrorInt

type NotFoundErrorInt struct {
	Instance string
	Input    int32
}

NotFoundErrorInt is an error that occurs when a value is not found.

func (*NotFoundErrorInt) Error

func (e *NotFoundErrorInt) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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