quickfix

package module
v0.4.0 Latest Latest
Warning

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

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

README ¶

QuickFIX/Go GoDoc Build Status

Open Source FIX Protocol library implemented in Go

FIX versions 4.0-5.0

Example Apps

See examples for some simple examples of using QuickFIX/Go.

Build and Test

The default make target runs go vet and unit tests.

QuickFIX/Go acceptance tests depend on ruby in path.

To run acceptance tests,

	# build acceptance test rig
	make build_accept

	# run acceptance tests
	make accept

Documentation ¶

Overview ¶

Package quickfix is a full featured messaging engine for the FIX protocol. It is a 100% Go open source implementation of the popular C++ QuickFIX engine (http://quickfixengine.org).

Creating your QuickFIX Application ¶

Creating a FIX application is as easy as implementing the QuickFIX Application interface. By implementing these interface methods in your derived type, you are requesting to be notified of events that occur on the FIX engine. The function that you should be most aware of is fromApp.

Here are explanations of what these callback functions provide for you.

OnCreate(sessionID SessionID)

OnCreate is called when quickfix creates a new session. A session comes into and remains in existence for the life of the application. Sessions exist whether or not a counter party is connected to it. As soon as a session is created, you can begin sending messages to it. If no one is logged on, the messages will be sent at the time a connection is established with the counterparty.

OnLogon(sessionID SessionID)

OnLogon notifies you when a valid logon has been established with a counter party. This is called when a connection has been established and the FIX logon process has completed with both parties exchanging valid logon messages.

OnLogout(sessionID SessionID)

OnLogout notifies you when an FIX session is no longer online. This could happen during a normal logout exchange or because of a forced termination or a loss of network connection.

ToAdmin(message Message, sessionID SessionID)

ToAdmin provides you with a peak at the administrative messages that are being sent from your FIX engine to the counter party. This is normally not useful for an application however it is provided for any logging you may wish to do. Notice that the Message is not const. This allows you to add fields before an administrative message is sent out.

ToApp(message Message, sessionID SessionID) error

ToApp notifies you of application messages that you are being sent to a counterparty. Notice that the Message is not const. This allows you to add fields before an application message before it is sent out.

FromAdmin(message Message, sessionID SessionID) MessageRejectError

FromAdmin notifies you when an administrative message is sent from a counterparty to your FIX engine. This can be usefull for doing extra validation on logon messages such as for checking passwords.

FromApp(msg Message, sessionID SessionID) MessageRejectError

FromApp is one of the core entry points for your FIX application. Every application level request will come through here. If, for example, your application is a sell-side OMS, this is where you will get your new order requests. If you were a buy side, you would get your execution reports here.

The sample code below shows how you might start up a FIX acceptor which listens on a socket. If you wanted an initiator, you would simply replace NewAcceptor in this code fragment with NewInitiator.

 package main

 import (
	"flag"
	"github.com/quickfixgo/quickfix"
	"os"
 )

 func main() {
	flag.Parse()
	fileName := flag.Arg(0)

	//FooApplication is your type that implements the Application interface
	var app FooApplication

	cfg, _ := os.Open(fileName)
	appSettings, _ := quickfix.ParseSettings(cfg)
	storeFactory := quickfix.NewMemoryStoreFactory()
	logFactory, _ := quickfix.NewFileLogFactory(appSettings)
	acceptor, _ := quickfix.NewAcceptor(app, storeFactory, appSettings, logFactory)

	acceptor.Start()
	//for condition == true { do something }
	acceptor.Stop()
 }

Configuring QuickFIX ¶

A QuickFIXGo acceptor or initiator can maintain as many FIX sessions as you would like. A FIX session is identified by a group of settings defined within the configuration section for a session (or inherited from the default section). The identification settings are:

| Setting      | Required? |
|--------------|-----------|
| BeginString  |     Y     |
| SenderCompID |     Y     |
| SenderSubID  |     N     |
| TargetCompID |     Y     |
| TargetSubID  |     N     |

The sender settings are your identification and the target settings are for the counterparty. A SessionQualifier can also be use to disambiguate otherwise identical sessions.

Each of the sessions can have several settings associated with them. Some of these settings may not be known at compile time and are therefore passed around in a struct called SessionSettings.

SessionSettings can be read in from any input stream such as a file stream. If you decide to write your own components, (storage for a particular database, a new kind of connector etc...), you may also use the session settings to store settings for your custom component.

A settings file is set up with two types of heading, a [DEFAULT] and a [SESSION] heading. [SESSION] tells QuickFIX/Go that a new Session is being defined. [DEFAULT] is a place that you can define settings which will be inherited by sessions that don't explicitly define them. If you do not provide a setting that QuickFIX/Go needs, it will return an error indicating that a setting is missing or improperly formatted.

See the quickfix/config package for settings you can associate with a session based on the default components provided with QuickFIX/Go.

Here is a typical initiator settings file you might find for a firm that wants to connect to several ECNs.

# default settings for sessions
[DEFAULT]
FileLogPath=log
SenderCompID=TW

# session definition
[SESSION]
# inherit FileLogPath, SenderCompID from default
BeginString=FIX.4.1
TargetCompID=ARCA
HeartBtInt=20
SocketConnectPort=9823
SocketConnectHost=123.123.123.123
DataDictionary=somewhere/FIX41.xml

[SESSION]
BeginString=FIX.4.0
TargetCompID=ISLD
HeartBtInt=30
SocketConnectPort=8323
SocketConnectHost=23.23.23.23
DataDictionary=somewhere/FIX40.xml

[SESSION]
BeginString=FIX.4.2
TargetCompID=INCA
HeartBtInt=30
SocketConnectPort=6523
SocketConnectHost=3.3.3.3
DataDictionary=somewhere/FIX42.xml

Receiving Messages ¶

Most of the messages you will be interested in looking at will be arriving in your FromApp function of your application. All messages have a header and trailer. If you want to get Header or Trailer fields, you must access those fields from the Header or Trailer embedded Struct. All other fields are accessible in the Body embedded struct.

QuickFIX/Go has a type for all messages and fields defined in the standard spec. The easiest and most typesafe method of receiving messages is by using the quickfix MessageRouter generated message types. Any messages you do not establish routes for will by default return an UnsupportedMessageType reject.

 import (
	"github.com/quickfixgo/quickfix"
	"github.com/quickfixgo/quickfix/field"
	"github.com/quickfixgo/quickfix/fix41/newordersingle"
 )

 type MyApplication struct {
	*quickfix.MessageRouter
 }

 func (m *MyApplication) init() {
	m.MessageRouter=quickfix.NewMessageRouter()
	m.AddRoute(newordersingle.Route(m.onNewOrderSingle))
 }

 func (m *MyApplication) FromApp(msg quickfix.Message, sessionID quickfix.SessionID) (err quickfix.MessageRejectError) {
	return m.Route(msg, sessionID)
 }

 func (m *MyApplication) onNewOrderSingle(msg newordersingle.NewOrderSingle, sessionID quickfix.SessionID) (err quickfix.MessageRejectError) {
	var clOrdID field.ClOrdIDField
	if clOrdID, err = msg.GetClOrdID(); err!=nil {
		return
	}

	//compile time error!! field not defined in FIX41
	var clearingAccount field.ClearingAccountField
	clearingAccount, err = msg.GetClearingAccount()

	...
	return
 }

You can also bypass the MessageRouter and type safe classes by inspecting the Message directly. The preferred way of doing this is to use the quickfix generated Field types.

 func (m *MyApplication) FromApp(msg quickfix.Message, sessionID quickfix.SessionID) (err quickfix.MessageRejectError) {
	var price field.PriceField
	if err = msg.Body.Get(&field); err!=nil {
		return
	}

	...
	return
 }

Or you can go the least type safe route.

 func (m *MyApplication) FromApp(msg quickfix.Message, sessionID quickfix.SessionID) (err quickfix.MessageRejectError) {
	var field quickfix.FIXString
	if err = msg.Body.GetField(quickfix.Tag(44), &field); err!=nil {
		return
	}

	...
	return
 }

Sending Messages ¶

Messages can be sent to the counter party with the Send and SendToTarget functions.

//Send determines the session to send Messagable using header fields BeginString, TargetCompID, SenderCompID
func Send(m Messagable) error

//SendToTarget sends Messagable based on the sessionID. Convenient for use in FromApp since it provides a session ID for incoming messages
func SendToTarget(m Messagable, sessionID SessionID) error

Index ¶

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

func Send ¶

func Send(m Messagable) (err error)

Send determines the session to send Messagable using header fields BeginString, TargetCompID, SenderCompID

func SendToTarget ¶

func SendToTarget(m Messagable, sessionID SessionID) error

SendToTarget sends a message based on the sessionID. Convenient for use in FromApp since it provides a session ID for incoming messages

Types ¶

type Acceptor ¶

type Acceptor struct {
	// contains filtered or unexported fields
}

Acceptor accepts connections from FIX clients and manages the associated sessions.

func NewAcceptor ¶

func NewAcceptor(app Application, storeFactory MessageStoreFactory, settings *Settings, logFactory LogFactory) (*Acceptor, error)

NewAcceptor creates and initializes a new Acceptor.

func (*Acceptor) Start ¶

func (a *Acceptor) Start() (e error)

Start accepting connections.

func (*Acceptor) Stop ¶

func (a *Acceptor) Stop()

Stop logs out existing sessions, close their connections, and stop accepting new connections.

type Application ¶

type Application interface {
	//Notification of a session begin created.
	OnCreate(sessionID SessionID)

	//Notification of a session successfully logging on.
	OnLogon(sessionID SessionID)

	//Notification of a session logging off or disconnecting.
	OnLogout(sessionID SessionID)

	//Notification of admin message being sent to target.
	ToAdmin(message Message, sessionID SessionID)

	//Notification of app message being sent to target.
	ToApp(message Message, sessionID SessionID) error

	//Notification of admin message being received from target.
	FromAdmin(message Message, sessionID SessionID) MessageRejectError

	//Notification of app message being received from target.
	FromApp(message Message, sessionID SessionID) MessageRejectError
}

The Application interface should be implemented by FIX Applications. This is the primary interface for processing messages from a FIX Session.

type Body ¶ added in v0.3.0

type Body struct{ FieldMap }

Body is the primary application section of a FIX message

func (*Body) Init ¶ added in v0.3.0

func (b *Body) Init()

Init initializes the FIX message

type FIXBoolean ¶

type FIXBoolean bool

FIXBoolean is a FIX Boolean value, implements FieldValue.

func (FIXBoolean) Bool ¶ added in v0.4.0

func (f FIXBoolean) Bool() bool

Bool converts the FIXBoolean value to bool

func (*FIXBoolean) Read ¶

func (f *FIXBoolean) Read(bytes []byte) error

func (FIXBoolean) Write ¶

func (f FIXBoolean) Write() []byte

type FIXFloat ¶

type FIXFloat float64

FIXFloat is a FIX Float Value, implements FieldValue

func (FIXFloat) Float64 ¶ added in v0.4.0

func (f FIXFloat) Float64() float64

Float64 converts the FIXFloat value to float64

func (*FIXFloat) Read ¶

func (f *FIXFloat) Read(bytes []byte) error

func (FIXFloat) Write ¶

func (f FIXFloat) Write() []byte

type FIXInt ¶

type FIXInt int

FIXInt is a FIX Int Value, implements FieldValue

func (FIXInt) Int ¶ added in v0.4.0

func (f FIXInt) Int() int

Int converts the FIXInt value to int

func (*FIXInt) Read ¶

func (f *FIXInt) Read(bytes []byte) error

func (FIXInt) Write ¶

func (f FIXInt) Write() []byte

type FIXString ¶

type FIXString string

FIXString is a FIX String Value, implements FieldValue

func (*FIXString) Read ¶

func (f *FIXString) Read(bytes []byte) (err error)

func (FIXString) String ¶

func (f FIXString) String() string

func (FIXString) Write ¶

func (f FIXString) Write() []byte

type FIXUTCTimestamp ¶

type FIXUTCTimestamp struct {
	time.Time
	NoMillis bool
}

FIXUTCTimestamp is a FIX UTC Timestamp value, implements FieldValue

func (*FIXUTCTimestamp) Read ¶

func (f *FIXUTCTimestamp) Read(bytes []byte) error

func (FIXUTCTimestamp) Write ¶

func (f FIXUTCTimestamp) Write() []byte

type Field ¶

type Field interface {
	FieldWriter
	FieldValueReader
}

Field is the interface implemented by all typed Fields in a Message

type FieldGroup ¶ added in v0.3.0

type FieldGroup interface {
	Tag() Tag
	Write() TagValues
	Read(TagValues) (TagValues, error)
}

FieldGroup is the interface implemented by all typed Groups in a Message

type FieldGroupReader ¶ added in v0.3.0

type FieldGroupReader interface {
	Tag() Tag
	Read(TagValues) (TagValues, error)
}

FieldGroupReader is an interface for reading a FieldGroup

type FieldGroupWriter ¶ added in v0.3.0

type FieldGroupWriter interface {
	Tag() Tag
	Write() TagValues
}

FieldGroupWriter is an interface for writing a FieldGroup

type FieldMap ¶

type FieldMap struct {
	// contains filtered or unexported fields
}

FieldMap is a collection of fix fields that make up a fix message.

func (*FieldMap) Clear ¶

func (m *FieldMap) Clear()

Clear purges all fields from field map

func (FieldMap) Get ¶

func (m FieldMap) Get(parser Field) MessageRejectError

Get parses out a field in this FieldMap. Returned reject may indicate the field is not present, or the field value is invalid.

func (FieldMap) GetField ¶

func (m FieldMap) GetField(tag Tag, parser FieldValueReader) MessageRejectError

GetField parses of a field with Tag tag. Returned reject may indicate the field is not present, or the field value is invalid.

func (FieldMap) GetGroup ¶

func (m FieldMap) GetGroup(parser FieldGroupReader) MessageRejectError

GetGroup is a Get function specific to Group Fields.

func (FieldMap) GetInt ¶ added in v0.2.0

func (m FieldMap) GetInt(tag Tag) (int, MessageRejectError)

GetInt is a GetField wrapper for int fields

func (FieldMap) GetString ¶ added in v0.2.0

func (m FieldMap) GetString(tag Tag) (string, MessageRejectError)

GetString is a GetField wrapper for string fields

func (FieldMap) Has ¶

func (m FieldMap) Has(tag Tag) bool

Has returns true if the Tag is present in this FieldMap

func (FieldMap) Set ¶

func (m FieldMap) Set(field FieldWriter) FieldMap

Set is a setter for fields

func (FieldMap) SetField ¶

func (m FieldMap) SetField(tag Tag, field FieldValueWriter) FieldMap

SetField sets the field with Tag tag

func (FieldMap) SetGroup ¶

func (m FieldMap) SetGroup(field FieldGroupWriter) FieldMap

SetGroup is a setter specific to group fields

func (FieldMap) Tags ¶

func (m FieldMap) Tags() []Tag

Tags returns all of the Field Tags in this FieldMap

type FieldValue ¶

type FieldValue interface {
	FieldValueWriter
	FieldValueReader
}

The FieldValue interface is used to write/extract typed field values to/from raw bytes

type FieldValueReader ¶

type FieldValueReader interface {
	//Reads the contents of the []byte into FieldValue.  Returns an error if there are issues in the data processing
	Read([]byte) error
}

FieldValueReader is an interface for reading field values

type FieldValueWriter ¶

type FieldValueWriter interface {
	//Writes out the contents of the FieldValue to a []byte
	Write() []byte
}

FieldValueWriter is an interface for writing field values

type FieldWriter ¶

type FieldWriter interface {
	Tag() Tag
	FieldValueWriter
}

FieldWriter is an interface for a writing a field

type Group ¶

type Group struct{ FieldMap }

Group is a group of fields occuring in a repeating group

type GroupItem ¶

type GroupItem interface {
	//Tag returns the tag identifying this GroupItem
	Tag() Tag

	//Parameter to Read is tagValues.  For most fields, only the first tagValue will be required.
	//The length of the slice extends from the tagValue mapped to the field to be read through the
	//following fields. This can be useful for GroupItems made up of repeating groups.
	//
	//The Read function returns the remaining tagValues not processed by the GroupItem. If there was a
	//problem reading the field, an error may be returned
	Read(TagValues) (TagValues, error)

	//Clone makes a copy of this GroupItem
	Clone() GroupItem
}

GroupItem interface is used to construct repeating group templates

func GroupElement ¶

func GroupElement(tag Tag) GroupItem

GroupElement returns a GroupItem made up of a single field

type GroupTemplate ¶

type GroupTemplate []GroupItem

GroupTemplate specifies the group item order for a RepeatingGroup

func (GroupTemplate) Clone ¶ added in v0.4.0

func (gt GroupTemplate) Clone() GroupTemplate

Clone makes a copy of this GroupTemplate

type Header struct{ FieldMap }

Header is first section of a FIX Message

func (*Header) Init ¶ added in v0.3.0

func (h *Header) Init()

Init initializes the Header instance

type Initiator ¶

type Initiator struct {
	// contains filtered or unexported fields
}

Initiator initiates connections and processes messages for all sessions.

func NewInitiator ¶

func NewInitiator(app Application, storeFactory MessageStoreFactory, appSettings *Settings, logFactory LogFactory) (*Initiator, error)

NewInitiator creates and initializes a new Initiator.

func (*Initiator) Start ¶

func (i *Initiator) Start() error

Start Initiator.

func (*Initiator) Stop ¶

func (i *Initiator) Stop()

Stop Initiator.

type Log ¶

type Log interface {
	//log incoming fix message
	OnIncoming(string)

	//log outgoing fix message
	OnOutgoing(string)

	//log fix event
	OnEvent(string)

	//log fix event according to format specifier
	OnEventf(string, ...interface{})
}

Log is a generic interface for logging FIX messages and events.

type LogFactory ¶

type LogFactory interface {
	//global log
	Create() (Log, error)

	//session specific log
	CreateSessionLog(sessionID SessionID) (Log, error)
}

The LogFactory interface creates global and session specific Log instances

func NewFileLogFactory ¶

func NewFileLogFactory(settings *Settings) (LogFactory, error)

NewFileLogFactory creates an instance of LogFactory that writes messages and events to file. The location of global and session log files is configured via FileLogPath.

func NewNullLogFactory ¶

func NewNullLogFactory() LogFactory

NewNullLogFactory creates an instance of LogFactory that returns no-op loggers.

func NewScreenLogFactory ¶

func NewScreenLogFactory() LogFactory

NewScreenLogFactory creates an instance of LogFactory that writes messages and events to stdout.

type Messagable ¶ added in v0.4.0

type Messagable interface {
	ToMessage() Message
}

Messagable is a Message or something that can be converted to a Message

type Message ¶

type Message struct {
	Header  Header
	Trailer Trailer
	Body    Body

	//ReceiveTime is the time that this message was read from the socket connection
	ReceiveTime time.Time
	// contains filtered or unexported fields
}

Message is a FIX Message abstraction.

func NewMessage ¶

func NewMessage() (m Message)

NewMessage returns a newly initialized Message instance

func ParseMessage ¶ added in v0.3.0

func ParseMessage(rawMessage []byte) (Message, error)

ParseMessage constructs a Message from a byte slice wrapping a FIX message.

func (*Message) Build ¶

func (m *Message) Build() ([]byte, error)

Build constructs a []byte from a Message instance

func (*Message) String ¶

func (m *Message) String() string

func (Message) ToMessage ¶ added in v0.4.0

func (m Message) ToMessage() Message

ToMessage returns the message itself

type MessageRejectError ¶

type MessageRejectError interface {
	error

	//RejectReason, tag 373 for session rejects, tag 380 for business rejects.
	RejectReason() int
	RefTagID() *Tag
	IsBusinessReject() bool
}

MessageRejectError is a type of error that can correlate to a message reject.

func ConditionallyRequiredFieldMissing ¶

func ConditionallyRequiredFieldMissing(tag Tag) MessageRejectError

ConditionallyRequiredFieldMissing indicates that the requested field could not be found in the FIX message.

func IncorrectDataFormatForValue ¶ added in v0.3.0

func IncorrectDataFormatForValue(tag Tag) MessageRejectError

IncorrectDataFormatForValue returns an error indicating a field that cannot be parsed as the type required.

func InvalidMessageType ¶ added in v0.3.0

func InvalidMessageType() MessageRejectError

InvalidMessageType returns an error to indicate an invalid message type

func InvalidTagNumber ¶ added in v0.3.0

func InvalidTagNumber(tag Tag) MessageRejectError

InvalidTagNumber returns a validation error for messages with invalid tags.

func NewBusinessMessageRejectError ¶

func NewBusinessMessageRejectError(err string, rejectReason int, refTagID *Tag) MessageRejectError

NewBusinessMessageRejectError returns a MessageRejectError with the given error mesage, reject reason, and optional reftagid. Reject is treated as a business level reject

func NewMessageRejectError ¶

func NewMessageRejectError(err string, rejectReason int, refTagID *Tag) MessageRejectError

NewMessageRejectError returns a MessageRejectError with the given error message, reject reason, and optional reftagid

func RequiredTagMissing ¶ added in v0.3.0

func RequiredTagMissing(tag Tag) MessageRejectError

RequiredTagMissing returns a validation error when a required field cannot be found in a message.

func TagNotDefinedForThisMessageType ¶ added in v0.3.0

func TagNotDefinedForThisMessageType(tag Tag) MessageRejectError

TagNotDefinedForThisMessageType returns an error for an invalid tag appearing in a message.

func TagSpecifiedWithoutAValue ¶ added in v0.3.0

func TagSpecifiedWithoutAValue(tag Tag) MessageRejectError

TagSpecifiedWithoutAValue returns a validation error for when a field has no value.

func UnsupportedMessageType ¶ added in v0.3.0

func UnsupportedMessageType() MessageRejectError

UnsupportedMessageType returns an error to indicate an unhandled message.

func ValueIsIncorrect ¶

func ValueIsIncorrect(tag Tag) MessageRejectError

ValueIsIncorrect returns an error indicating a field with value that is not valid.

type MessageRoute ¶

type MessageRoute func(msg Message, sessionID SessionID) MessageRejectError

A MessageRoute is a function that can process a fromApp/fromAdmin callback

type MessageRouter ¶

type MessageRouter struct {
	// contains filtered or unexported fields
}

A MessageRouter is a mutex for MessageRoutes

func NewMessageRouter ¶

func NewMessageRouter() *MessageRouter

NewMessageRouter returns an initialized MessageRouter instance

func (MessageRouter) AddRoute ¶

func (c MessageRouter) AddRoute(beginString string, msgType string, router MessageRoute)

AddRoute adds a route to the MessageRouter instance keyed to begin string and msgType.

func (MessageRouter) Route ¶

func (c MessageRouter) Route(msg Message, sessionID SessionID) MessageRejectError

Route may be called from the fromApp/fromAdmin callbacks. Messages that cannot be routed will be rejected with UnsupportedMessageType.

type MessageStore ¶

type MessageStore interface {
	NextSenderMsgSeqNum() int
	NextTargetMsgSeqNum() int

	IncrNextSenderMsgSeqNum() error
	IncrNextTargetMsgSeqNum() error

	SetNextSenderMsgSeqNum(next int) error
	SetNextTargetMsgSeqNum(next int) error

	CreationTime() time.Time

	SaveMessage(seqNum int, msg []byte) error
	GetMessages(beginSeqNum, endSeqNum int) ([][]byte, error)

	Refresh() error
	Reset() error

	Close() error
}

The MessageStore interface provides methods to record and retrieve messages for resend purposes

type MessageStoreFactory ¶

type MessageStoreFactory interface {
	Create(sessionID SessionID) (MessageStore, error)
}

The MessageStoreFactory interface is used by session to create a session specific message store

func NewFileStoreFactory ¶ added in v0.2.0

func NewFileStoreFactory(settings *Settings) MessageStoreFactory

NewFileStoreFactory returns a file-based implementation of MessageStoreFactory

func NewMemoryStoreFactory ¶

func NewMemoryStoreFactory() MessageStoreFactory

NewMemoryStoreFactory returns a MessageStoreFactory instance that created in-memory MessageStores

func NewSQLStoreFactory ¶ added in v0.2.0

func NewSQLStoreFactory(settings *Settings) MessageStoreFactory

NewSQLStoreFactory returns a sql-based implementation of MessageStoreFactory

type RepeatingGroup ¶

type RepeatingGroup struct {
	// contains filtered or unexported fields
}

RepeatingGroup is a FIX Repeating Group type

func NewRepeatingGroup ¶ added in v0.3.0

func NewRepeatingGroup(tag Tag, template GroupTemplate) *RepeatingGroup

NewRepeatingGroup returns an initilized RepeatingGroup instance

func (*RepeatingGroup) Add ¶

func (f *RepeatingGroup) Add() Group

Add appends a new group to the RepeatingGroup and returns the new Group

func (RepeatingGroup) Clone ¶ added in v0.4.0

func (f RepeatingGroup) Clone() GroupItem

Clone makes a copy of this RepeatingGroup (tag, template)

func (RepeatingGroup) Get ¶ added in v0.3.0

func (f RepeatingGroup) Get(i int) Group

Get returns the ith group in this RepeatingGroup

func (RepeatingGroup) Len ¶ added in v0.3.0

func (f RepeatingGroup) Len() int

Len returns the number of Groups in this RepeatingGroup

func (*RepeatingGroup) Read ¶ added in v0.3.0

func (f *RepeatingGroup) Read(tv TagValues) (TagValues, error)

func (RepeatingGroup) Tag ¶ added in v0.3.0

func (f RepeatingGroup) Tag() Tag

Tag returns the Tag for this repeating Group

func (RepeatingGroup) Write ¶ added in v0.3.0

func (f RepeatingGroup) Write() TagValues

Write returns tagValues for all Items in the repeating group ordered by Group sequence and Group template order

type SessionID ¶

type SessionID struct {
	BeginString, TargetCompID, TargetSubID, TargetLocationID, SenderCompID, SenderSubID, SenderLocationID, Qualifier string
}

SessionID is a unique identifer of a Session

func (SessionID) IsFIXT ¶ added in v0.3.0

func (s SessionID) IsFIXT() bool

IsFIXT returns true if the SessionID has a FIXT BeginString

func (SessionID) String ¶

func (s SessionID) String() string

type SessionSettings ¶

type SessionSettings struct {
	// contains filtered or unexported fields
}

SessionSettings maps session settings to values with typed accessors.

func NewSessionSettings ¶

func NewSessionSettings() *SessionSettings

NewSessionSettings returns a newly initialized SessionSettings instance

func (SessionSettings) BoolSetting ¶

func (s SessionSettings) BoolSetting(setting string) (bool, error)

BoolSetting returns the requested setting parsed as a boolean. Returns an errror if the setting is not set or cannot be parsed as a bool.

func (*SessionSettings) DurationSetting ¶ added in v0.3.0

func (s *SessionSettings) DurationSetting(setting string) (val time.Duration, err error)

DurationSetting returns the requested setting parsed as a time.Duration. Returns an error if the setting is not set or cannot be parsed as a time.Duration.

func (*SessionSettings) HasSetting ¶

func (s *SessionSettings) HasSetting(setting string) bool

HasSetting returns true if a setting is set, false if not

func (*SessionSettings) Init ¶

func (s *SessionSettings) Init()

Init initializes or resets SessionSettings

func (*SessionSettings) IntSetting ¶

func (s *SessionSettings) IntSetting(setting string) (int, error)

IntSetting returns the requested setting parsed as an int. Returns an errror if the setting is not set or cannot be parsed as an int.

func (*SessionSettings) Set ¶

func (s *SessionSettings) Set(setting string, val string)

Set assigns a value to a setting on SessionSettings.

func (*SessionSettings) Setting ¶

func (s *SessionSettings) Setting(setting string) (string, error)

Setting is a settings string accessor. Returns an error if the setting is missing.

type Settings ¶

type Settings struct {
	// contains filtered or unexported fields
}

The Settings type represents a collection of global and session settings.

func NewSettings ¶

func NewSettings() *Settings

NewSettings creates a Settings instance

func ParseSettings ¶

func ParseSettings(reader io.Reader) (*Settings, error)

ParseSettings creates and initializes a Settings instance with config parsed from a Reader. Returns error if the config is has parse errors

func (*Settings) AddSession ¶

func (s *Settings) AddSession(sessionSettings *SessionSettings) (SessionID, error)

AddSession adds Session Settings to Settings instance. Returns an error if session settings with duplicate sessionID has already been added

func (*Settings) GlobalSettings ¶

func (s *Settings) GlobalSettings() *SessionSettings

GlobalSettings are default setting inherited by all session settings.

func (*Settings) Init ¶

func (s *Settings) Init()

Init initializes or resets a Settings instance

func (*Settings) SessionSettings ¶

func (s *Settings) SessionSettings() map[SessionID]*SessionSettings

SessionSettings return all session settings overlaying globalsettings.

type Tag ¶

type Tag int

Tag is a typed int representing a FIX tag

func (Tag) IsHeader ¶

func (t Tag) IsHeader() bool

IsHeader returns true if tag belongs in the message header

func (Tag) IsTrailer ¶

func (t Tag) IsTrailer() bool

IsTrailer returns true if tag belongs in the message trailer

type TagValue ¶ added in v0.3.0

type TagValue struct {
	// contains filtered or unexported fields
}

TagValue is a low-level FIX field abstraction

func (TagValue) String ¶ added in v0.3.0

func (tv TagValue) String() string

type TagValues ¶ added in v0.3.0

type TagValues []TagValue

TagValues is a slice of TagValue

type Trailer ¶ added in v0.3.0

type Trailer struct{ FieldMap }

Trailer is the last section of a FIX message

func (*Trailer) Init ¶ added in v0.3.0

func (t *Trailer) Init()

Init initializes the FIX message

Directories ¶

Path Synopsis
cmd
Package config declares application and session settings for QuickFIX/Go BeginString Version of FIX this session should use.
Package config declares application and session settings for QuickFIX/Go BeginString Version of FIX this session should use.
Package datadictionary provides support for parsing and organizing FIX Data Dictionaries
Package datadictionary provides support for parsing and organizing FIX Data Dictionaries
Package enum declares standard FIX enum values.
Package enum declares standard FIX enum values.
Package field declares standard FIX fields.
Package field declares standard FIX fields.
ioi
ioi
fix50
ioi
fix50sp1
ioi
fix50sp2
ioi

Jump to

Keyboard shortcuts

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