Documentation
¶
Overview ¶
Package fixdecoder fix message decoder
Index ¶
Constants ¶
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 SystemFieldIDs ¶
func SystemFieldIDs() []string
SystemFieldIDs get system fields IDs (like checksum)
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
type FieldMetaData ¶
FieldMetaData meta data of a field
type FixDecoder ¶
type FixDecoder struct{}
FixDecoder the main struct
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