fixdecoder

package module
v0.0.0-...-f05df5c Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: MIT Imports: 6 Imported by: 0

README

FIXDECODER

A convenient and decoder library for FIX messages.

install

go get -u github.com/ilovelili/fixdecoder

usage

    fd := fixdecoder.NewFixDecoder()
    fd.Decode("<your fix message>")

dependencies

Documentation

Overview

Package fixdecoder fix message decoder

Index

Constants

View Source
const (
	// CHECKSUM Three byte, simple checksum. ALWAYS LAST FIELD IN MESSAGE; i.e. serves, with the trailing <SOH>, as the end-of-message delimiter. Always defined as three characters. (Always unencrypted)
	CHECKSUM = "10"
	// BEGINSTRING Identifies beginning of new message and protocol version. ALWAYS FIRST FIELD IN MESSAGE. (Always unencrypted)
	BEGINSTRING = "8"
	// BODYLENGTH Message length, in bytes, forward to the CheckSum <10> field. ALWAYS SECOND FIELD IN MESSAGE. (Always unencrypted)
	BODYLENGTH = "9"
)

Variables

This section is empty.

Functions

func Fields

func Fields() string

Fields get fields group by tag

func SystemFieldIDs

func SystemFieldIDs() []string

SystemFieldIDs get system fields IDs (like checksum)

func Version

func Version() string

Version get version

Types

type BodyLengthValidator

type BodyLengthValidator struct{}

BodyLengthValidator BodyLength is the character count starting at tag 35 (included, MsgType) all the way to tag 10 (excluded). SOH delimiters do count in body length (length = 1).

func (BodyLengthValidator) Validate

func (v BodyLengthValidator) Validate(dfs DecodedFields) bool

Validate body length validate

type CheckSumValidator

type CheckSumValidator struct{}

CheckSumValidator checksum

func (CheckSumValidator) Validate

func (v CheckSumValidator) Validate(dfs DecodedFields) bool

Validate checksum validate https://www.onixs.biz/fix-dictionary/4.2/app_b.html

type DecodedField

type DecodedField struct {
	FieldID      string
	Value        string
	Field        *FieldMetaData
	DecodedValue string
	Classes      string
	Decoded      bool // Whether decoding succeeded or not
}

DecodedField decoded field

func (*DecodedField) Raw

func (df *DecodedField) Raw() string

Raw parse the raw message

type DecodedFields

type DecodedFields []*DecodedField

DecodedFields alias of DecodedField slice

func (DecodedFields) String

func (dfs DecodedFields) String() string

String decode to string

type FieldMetaData

type FieldMetaData struct {
	Name string
	Type string
}

FieldMetaData meta data of a field

type FixDecoder

type FixDecoder struct{}

FixDecoder the main struct

func NewFixDecoder

func NewFixDecoder() *FixDecoder

NewFixDecoder new fix decoder instance

func (*FixDecoder) Decode

func (f *FixDecoder) Decode(message string) (decodedfields DecodedFields)

Decode the main decode function

type Validator

type Validator interface {
	Validate(DecodedFields) bool
}

Validator field validator. For example, checksum validation, body length validation

type ValidatorFactory

type ValidatorFactory struct{}

ValidatorFactory validator factory

func NewValidatorFactory

func NewValidatorFactory() *ValidatorFactory

NewValidatorFactory validator factory

func (*ValidatorFactory) CreateValidators

func (vf *ValidatorFactory) CreateValidators() []Validator

CreateValidators create validators

Jump to

Keyboard shortcuts

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