Categorygithub.com/cryptogarageinc/quickfix-go
modulepackage
1.2.0
Repository: https://github.com/cryptogarageinc/quickfix-go.git
Documentation: pkg.go.dev

# README

QuickFIX/Go

Open Source FIX Protocol library implemented in Go

Getting Started and Documentation

Installation

To install QuickFIX/Go, use go get:

$ go get github.com/alpacahq/quickfix

Staying up to date

To update QuickFIX/Go to the latest version, use go get -u github.com/alpacahq/quickfix.

Example Apps

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

FIX Message Generation

QuickFIX/Go includes separate packages for tags, fields, enums, messages, and message components generated from the FIX 4.0 - FIX5.0SP2 specs. See:

For most FIX applications, these generated resources are sufficient. Custom FIX applications may generate source specific to the FIX spec of that application using the generate-fix tool included with QuickFIX/Go.

Following installation, generate-fix is installed to $GOPATH/bin/generate-fix. Run $GOPATH/bin/generate-fix --help for usage instructions.

Developing QuickFIX/Go

If you wish to work on QuickFIX/Go itself, you will first need Go installed on your machine (version 1.6+ is required).

For local dev first make sure Go is properly installed, including setting up a GOPATH.

Next, using Git, clone this repository into $GOPATH/src/github.com/alpacahq/quickfix.

Installing Dependencies

QuickFIX/Go uses dep to manage the vendored dependencies. Install dep with go get:

$ go get -u github.com/golang/dep/cmd/dep

Run dep ensure to install the correct versioned dependencies into vendor/, which Go 1.6+ automatically recognizes and loads.

$ $GOPATH/bin/dep ensure

Note: No vendored dependencies are included in the QuickFIX/Go source.

Build and Test

The default make target runs go vet and unit tests.

$ make

If this exits with exit status 0, then everything is working!

Generated Code

Generated code from the FIX40-FIX50SP2 specs are available as separate repos under the QuickFIX/Go organization. The source specifications for this generated code is located in spec/. Generated code can be identified by the .generated.go suffix. Any changes to generated code must be captured by changes to source in cmd/generate-fix. After making changes to the code generator source, run the following to re-generate the source

$ make generate-dist

If you are making changes to the generated code, please create Pull Requests for these changes for the affected repos.

Acceptance Tests

QuickFIX/Go has a comprehensive acceptance test suite covering the FIX protocol. These are the same tests used across all QuickFIX implementations.

QuickFIX/Go acceptance tests depend on ruby in path.

To run acceptance tests,

    # generate code locally
    make generate

	# build acceptance test rig
	make build-test-srv

	# run acceptance tests
	make accept

Dependencies

If you are developing QuickFIX/Go, there are a few tasks you might need to perform related to dependencies.

Adding a dependency

If you are adding a dependency, you will need to update the dep manifest in the same Pull Request as the code that depends on it. You should do this in a separate commit from your code, as this makes PR review easier and Git history simpler to read in the future.

To add a dependency:

  1. Add the dependency using dep:
$ dep ensure -add github.com/foo/bar
  1. Review the changes in git and commit them.

Updating a dependency

To update a dependency to the latest version allowed by constraints in Gopkg.toml:

  1. Run:
$ dep ensure -update github.com/foo/bar
  1. Review the changes in git and commit them.

To change the allowed version/branch/revision of a dependency:

  1. Manually edit Gopkg.toml
  2. Run:
$ dep ensure
  1. Review the changes in git and commit them.

Licensing

This software is available under the QuickFIX Software License. Please see the LICENSE.txt for the terms specified by the QuickFIX Software License.

# Packages

No description provided by the author
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.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

CleanupInvalidStoppedSession deletes stopped sessions that has expired.
ConditionallyRequiredFieldMissing indicates that the requested field could not be found in the FIX message.
GetAliveSessionIDs This function returns loggedOn sessionID list.
GetSessionIDs This function returns sessionID list.
GroupElement returns a GroupItem made up of a single field.
IncorrectDataFormatForValue returns an error indicating a field that cannot be parsed as the type required.
InvalidMessageType returns an error to indicate an invalid message type.
InvalidTagNumber returns a validation error for messages with invalid tags.
IsAliveSession This function checks if the session is a logged on session or not.
LogInt ...
LogInt64 ...
LogMessage ...
LogObject ...
LogString ...
LogStringWithSingleQuote ...
LogUint64 ...
NewAcceptor creates and initializes a new Acceptor.
NewBusinessMessageRejectError returns a MessageRejectError with the given error mesage, reject reason, and optional reftagid.
NewBusinessMessageRejectErrorWithRefID returns a MessageRejectError with the given error mesage, reject reason, refID, and optional reftagid.
NewCustomLogFactory creates an instance of LogFactory that logs messages and events using the provided log function.
NewErrorBySessionID This function returns NewErrorBySessionID object.
NewFileLogFactory creates an instance of LogFactory that writes messages and events to file.
NewFileStoreFactory returns a file-based implementation of MessageStoreFactory.
NewInitiator creates and initializes a new Initiator.
NewMemoryStoreFactory returns a MessageStoreFactory instance that created in-memory MessageStores.
NewMessage returns a newly initialized Message instance.
NewMessageRejectError returns a MessageRejectError with the given error message, reject reason, and optional reftagid.
NewMessageRouter returns an initialized MessageRouter instance.
NewMongoStoreFactory returns a mongo-based implementation of MessageStoreFactory.
NewMongoStoreFactoryPrefixed returns a mongo-based implementation of MessageStoreFactory, with prefix on collections.
NewNullLogFactory creates an instance of LogFactory that returns no-op loggers.
NewOtherBusinessRejectError returns a BusinessMessageRejectError with the given error message.
NewOtherRejectError returns a MessageRejectError with the given error message.
NewRepeatingGroup returns an initilized RepeatingGroup instance.
NewScreenLogFactory creates an instance of LogFactory that writes messages and events to stdout.
NewSessionSettings returns a newly initialized SessionSettings instance.
NewSettings creates a Settings instance.
NewSQLStoreFactory returns a sql-based implementation of MessageStoreFactory.
NewValidator creates a FIX message validator from the given data dictionaries.
ParseMessage constructs a Message from a byte slice wrapping a FIX message.
ParseMessageWithDataDictionary constructs a Message from a byte slice wrapping a FIX message using an optional session and application DataDictionary for reference.
ParseSettings creates and initializes a Settings instance with config parsed from a Reader.
RequiredTagMissing returns a validation error when a required field cannot be found in a message.
Send determines the session to send Messagable using header fields BeginString, TargetCompID, SenderCompID.
SendToAliveSession This function send message for logged on session.
SendToAliveSessions This function send messages for logged on sessions.
SendToSession This function send message on session.
SendToTarget sends a message based on the sessionID.
StoreMessageToSession stores a message on session.
TagNotDefinedForThisMessageType returns an error for an invalid tag appearing in a message.
TagSpecifiedWithoutAValue returns a validation error for when a field has no value.
UnregisterSession removes a session from the set of known sessions.
UnsupportedMessageType returns an error to indicate an unhandled message.
ValueIsIncorrect returns an error indicating a field with value that is not valid.
WaitForLogon returns channel to receive logon event by specific session.

# Constants

FIX ApplVerID string values.
FIX ApplVerID string values.
FIX ApplVerID string values.
FIX ApplVerID string values.
FIX ApplVerID string values.
FIX ApplVerID string values.
FIX ApplVerID string values.
FIX ApplVerID string values.
FIX ApplVerID string values.
FIX ApplVerID string values.
FIX BeginString string values.
FIX BeginString string values.
FIX BeginString string values.
FIX BeginString string values.
FIX BeginString string values.
FIX BeginString string values.
No description provided by the author
No description provided by the author
No description provided by the author
All TimestampPrecisions supported by FIX.
All TimestampPrecisions supported by FIX.
All TimestampPrecisions supported by FIX.
All TimestampPrecisions supported by FIX.

# Variables

ErrAccessToClosedStore defines error on accessing to closed message store.
ErrDoNotLoggedOnSession defines no loggedOn session error.
ErrDoNotSend is a convenience error to indicate a DoNotSend in ToApp.
ErrDuplicateSessionID defines duplicate SessionID.
ErrExistSession defines already exist session error.
ErrSendToStoppedSession defines error on sending to stopped session.
ErrUnknownSession defines unknown session.

# Structs

Acceptor accepts connections from FIX clients and manages the associated sessions.
Body is the primary application section of a FIX message.
BuildMessageInput stores for building message data.
BuildMessageOutput stores build message output data.
ConditionallyRequiredSetting indicates a missing setting.
ErrorBySessionID This struct has error map by sessionID.
FieldMap is a collection of fix fields that make up a fix message.
FIXDecimal is a FIX Float Value that implements an arbitrary precision fixed-point decimal.
FIXUTCTimestamp is a FIX UTC Timestamp value, implements FieldValue.
Group is a group of fields occurring in a repeating group.
Header is first section of a FIX Message.
IncorrectFormatForSetting indicates a setting that is incorrectly formatted.
Initiator initiates connections and processes messages for all sessions.
LogParam ...
Message is a FIX Message abstraction.
A MessageRouter is a mutex for MessageRoutes.
RejectLogon indicates the application is rejecting permission to logon.
RepeatingGroup is a FIX Repeating Group type.
SessionID is a unique identifier of a Session.
SessionSettings maps session settings to values with typed accessors.
The Settings type represents a collection of global and session settings.
TagValue is a low-level FIX field abstraction.
Trailer is the last section of a FIX message.
ValidatorSettings describe validation behavior.

# Interfaces

Application interface should be implemented by FIX Applications.
ConnectionValidator is an interface allowing to implement a custom authentication logic.
Field is the interface implemented by all typed Fields in a Message.
FieldGroup is the interface implemented by all typed Groups in a Message.
FieldGroupReader is an interface for reading a FieldGroup.
FieldGroupWriter is an interface for writing a FieldGroup.
The FieldValue interface is used to write/extract typed field values to/from raw bytes.
FieldValueReader is an interface for reading field values.
FieldValueWriter is an interface for writing field values.
FieldWriter is an interface for a writing a field.
GroupItem interface is used to construct repeating group templates.
Log is a generic interface for logging FIX messages and events.
The LogFactory interface creates global and session specific Log instances.
Messagable is a Message or something that can be converted to a Message.
MessageRejectError is a type of error that can correlate to a message reject.
The MessageStore interface provides methods to record and retrieve messages for resend purposes.
The MessageStoreFactory interface is used by session to create a session specific message store.
MsgSeqNumCursor interface provides methods for referencing/resetting the SeqNum position.
Validator validates a FIX message.

# Type aliases

FIXBoolean is a FIX Boolean value, implements FieldValue.
FIXBytes is a generic FIX field value, implements FieldValue.
FIXFloat is a FIX Float Value, implements FieldValue.
FIXInt is a FIX Int Value, implements FieldValue.
FIXString is a FIX String Value, implements FieldValue.
GroupTemplate specifies the group item order for a RepeatingGroup.
A MessageRoute is a function that can process a fromApp/fromAdmin callback.
Tag is a typed int representing a FIX tag.
TimestampPrecision defines the precision used by FIXUTCTimestamp.