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.
func NewComponent ¶
func NewComponent(ct *ComponentType, required bool) *Component
NewComponent returns an initialized Component instance.
type ComponentType ¶
type ComponentType struct {
// contains filtered or unexported fields
}
ComponentType is a grouping of fields.
func NewComponentType ¶
func NewComponentType(name string, parts []MessagePart) *ComponentType
NewComponentType returns an initialized component type.
func (ComponentType) Fields ¶
func (c ComponentType) Fields() []*FieldDef
Fields returns all fields contained in this component. Includes fields encapsulated in components of this component.
func (ComponentType) Name ¶
func (c ComponentType) Name() string
Name returns the name of this component type.
func (ComponentType) Parts ¶
func (c ComponentType) Parts() []MessagePart
Parts returns all parts in declaration order contained in this component.
func (ComponentType) RequiredFields ¶
func (c ComponentType) RequiredFields() []*FieldDef
RequiredFields returns those fields that are required for this component.
func (ComponentType) RequiredParts ¶
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 build a datadictionary instance from an xml file.
type Field ¶
type Field interface {
Tag() int
}
Field models a field or repeating group in a message.
type FieldDef ¶
type FieldDef struct { *FieldType Parts []MessagePart Fields []*FieldDef // contains filtered or unexported fields }
FieldDef models a field belonging to a message.
func NewFieldDef ¶
NewFieldDef returns an initialized FieldDef.
func NewGroupFieldDef ¶
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 ¶
RequiredFields returns those fields that are required for this FieldDef. IsGroup must return true.
func (FieldDef) RequiredParts ¶
func (f FieldDef) RequiredParts() []MessagePart
RequiredParts returns those parts that are required for this FieldDef. IsGroup must return true.
type FieldType ¶
type FieldType struct { 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 ¶
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 ¶
func NewMessageDef(name, msgType string, parts []MessagePart) *MessageDef
NewMessageDef returns a pointer to an initialized MessageDef.
func (MessageDef) RequiredParts ¶
func (m MessageDef) RequiredParts() []MessagePart
RequiredParts returns those parts that are required for this Message.
type MessagePart ¶
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 string `xml:"major,attr"` Minor string `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.