datadictionary

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2016 License: Apache-1.1 Imports: 3 Imported by: 0

Documentation

Overview

Package datadictionary provides support for parsing and organizing FIX Data Dictionaries

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	Name   string
	Fields []*FieldDef
}

Component is a grouping of fields.

type DataDictionary

type DataDictionary struct {
	FIXType         string
	Major           int
	Minor           int
	ServicePack     int
	FieldTypeByTag  map[int]*FieldType
	FieldTypeByName map[string]*FieldType
	Messages        map[string]*MessageDef
	Components      map[string]*Component
	Header          *MessageDef
	Trailer         *MessageDef
}

DataDictionary models FIX messages, components, and fields.

func Parse

func Parse(path string) (*DataDictionary, error)

Parse loads and and build a datadictionary instance from an xml file.

type Enum

type Enum struct {
	Value       string
	Description string
}

Enum is a container for value and description.

type FieldDef

type FieldDef struct {
	*FieldType
	Component   *Component
	Required    bool
	ChildFields []*FieldDef
}

FieldDef models a field or component belonging to a message.

func (FieldDef) IsComponent

func (f FieldDef) IsComponent() bool

func (FieldDef) IsGroup

func (f FieldDef) IsGroup() bool

IsGroup is true if the field is a repeating group.

type FieldType

type FieldType struct {
	Name  string
	Tag   int
	Type  string
	Enums map[string]Enum
}

FieldType holds information relating to a field. Includes Tag, type, and enums, if defined.

type MessageDef

type MessageDef struct {
	Name                     string
	MsgType                  string
	Fields                   map[int]*FieldDef
	FieldsInDeclarationOrder []*FieldDef

	RequiredTags TagSet
	Tags         TagSet
}

MessageDef can apply to header, trailer, or body of a FIX Message.

type TagSet

type TagSet map[int]struct{}

TagSet is set for tags.

func (TagSet) Add

func (t TagSet) Add(tag int)

Add adds a tag to the tagset.

type XMLComponent

type XMLComponent struct {
	Name    string `xml:"name,attr"`
	MsgCat  string `xml:"msgcat,attr"`
	MsgType string `xml:"msgtype,attr"`

	Members []*XMLComponentMember `xml:",any"`
}

XMLComponent can represent header, trailer, messages/message, or components/component xml elements.

type XMLComponentMember

type XMLComponentMember struct {
	XMLName  xml.Name
	Name     string `xml:"name,attr"`
	Required string `xml:"required,attr"`

	Members []*XMLComponentMember `xml:",any"`
}

XMLComponentMember represents child elements of header, trailer, messages/message, and components/component elements

type XMLDoc

type XMLDoc struct {
	Type        string `xml:"type,attr"`
	Major       int    `xml:"major,attr"`
	Minor       int    `xml:"minor,attr"`
	ServicePack int    `xml:"servicepack,attr"`

	Header     *XMLComponent   `xml:"header"`
	Trailer    *XMLComponent   `xml:"trailer"`
	Messages   []*XMLComponent `xml:"messages>message"`
	Components []*XMLComponent `xml:"components>component"`
	Fields     []*XMLField     `xml:"fields>field"`
}

XMLDoc is the unmarshalled root of a FIX Dictionary.

type XMLField

type XMLField struct {
	Number int         `xml:"number,attr"`
	Name   string      `xml:"name,attr"`
	Type   string      `xml:"type,attr"`
	Values []*XMLValue `xml:"value"`
}

XMLField represents the fields/field xml element.

type XMLValue

type XMLValue struct {
	Enum        string `xml:"enum,attr"`
	Description string `xml:"description,attr"`
}

XMLValue represents the fields/field/value xml element.

Jump to

Keyboard shortcuts

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