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 { *ComponentType // contains filtered or unexported fields }
Component is a Component as it appears in a given MessageDef
type ComponentType ¶ added in v0.2.0
type ComponentType struct {
// contains filtered or unexported fields
}
ComponentType is a grouping of fields.
func NewComponentType ¶ added in v0.2.0
func NewComponentType(name string, parts []MessagePart) *ComponentType
NewComponentType returns an initialized component type
func (ComponentType) Fields ¶ added in v0.2.0
func (c ComponentType) Fields() []*FieldDef
Fields returns all fields contained in this component. Includes fields encapsulated in components of this component
func (ComponentType) Name ¶ added in v0.2.0
func (c ComponentType) Name() string
Name returns the name of this component type
func (ComponentType) Parts ¶ added in v0.2.0
func (c ComponentType) Parts() []MessagePart
Parts returns all parts in declaration order contained in this component
func (ComponentType) RequiredFields ¶ added in v0.2.0
func (c ComponentType) RequiredFields() []*FieldDef
RequiredFields returns those fields that are required for this component
func (ComponentType) RequiredParts ¶ added in v0.2.0
func (c ComponentType) RequiredParts() []MessagePart
RequiredParts returns those parts that are required for this component
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 ComponentTypes map[string]*ComponentType 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 FieldDef ¶
type FieldDef struct { *FieldType Parts []MessagePart ChildFields []*FieldDef // contains filtered or unexported fields }
FieldDef models a field or component belonging to a message.
func NewFieldDef ¶ added in v0.2.0
NewFieldDef returns an initialized FieldDef
func NewGroupFieldDef ¶ added in v0.2.0
func NewGroupFieldDef(fieldType *FieldType, required bool, parts []MessagePart) *FieldDef
NewGroupFieldDef returns an initialized FieldDef for a repeating group
func (FieldDef) Required ¶
Required returns true if this FieldDef is required for the containing MessageDef
func (FieldDef) RequiredFields ¶ added in v0.2.0
RequiredFields returns those fields that are required for this FieldDef. IsGroup must return true
func (FieldDef) RequiredParts ¶ added in v0.2.0
func (f FieldDef) RequiredParts() []MessagePart
RequiredParts returns those parts that are required for this FieldDef. IsGroup must return true
type FieldType ¶
type FieldType struct { Tag int Type string Enums map[string]Enum // contains filtered or unexported fields }
FieldType holds information relating to a field. Includes Tag, type, and enums, if defined.
func NewFieldType ¶ added in v0.2.0
NewFieldType returns a pointer to an initialized FieldType
type MessageDef ¶
type MessageDef struct { Name string MsgType string Fields map[int]*FieldDef //Parts are the MessageParts of contained in this MessageDef in declaration //order Parts []MessagePart RequiredTags TagSet Tags TagSet // contains filtered or unexported fields }
MessageDef can apply to header, trailer, or body of a FIX Message.
func NewMessageDef ¶ added in v0.2.0
func NewMessageDef(name, msgType string, parts []MessagePart) *MessageDef
NewMessageDef returns a pointer to an initialized MessageDef
func (MessageDef) RequiredParts ¶ added in v0.2.0
func (m MessageDef) RequiredParts() []MessagePart
RequiredParts returns those parts that are required for this Message
type MessagePart ¶ added in v0.2.0
MessagePart can represent a Field, Repeating Group, or Component
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.