Documentation
¶
Index ¶
- Constants
- Variables
- func CalcCheckSum(body []byte) []byte
- func CalcCheckSumOptimized(bytes []byte) []byte
- func CalcCheckSumOptimizedFromBuffer(buffer *bytes.Buffer) []byte
- func ValueByTag(msg []byte, tag string) ([]byte, error)
- type Bool
- type Component
- func (c *Component) AsComponent() *Component
- func (c *Component) AsTemplate() Items
- func (c *Component) Get(id int) Item
- func (c *Component) IsEmpty() bool
- func (c *Component) Items() Items
- func (c *Component) Set(id int, v Item)
- func (c *Component) SetComponent(id int, v *Component)
- func (c *Component) SetField(id int, v Item)
- func (c *Component) SetGroup(id int, v *Group)
- func (c *Component) String() string
- func (c *Component) ToBytes() []byte
- func (c *Component) WriteBytes(writer *bytes.Buffer) bool
- type ConvertableMessage
- type Float
- func (v *Float) FromBytes(d []byte) (err error)
- func (v *Float) IsEmpty() bool
- func (v *Float) IsNull() bool
- func (v *Float) Set(d interface{}) error
- func (v *Float) String() string
- func (v *Float) ToBytes() []byte
- func (v *Float) Value() interface{}
- func (v *Float) WriteBytes(writer *bytes.Buffer) bool
- type Group
- func (g *Group) AddEntry(v Items) *Group
- func (g *Group) AsTemplate() Items
- func (g *Group) Entries() []Items
- func (g *Group) Entry(id int) Item
- func (g *Group) IsEmpty() bool
- func (g *Group) NoTag() string
- func (g *Group) String() string
- func (g *Group) ToBytes() []byte
- func (g *Group) WriteBytes(writer *bytes.Buffer) bool
- type Int
- type Item
- type Items
- type KeyValue
- func (kv *KeyValue) AsTemplate() *KeyValue
- func (kv *KeyValue) FromBytes(d []byte) error
- func (kv *KeyValue) IsEmpty() bool
- func (kv *KeyValue) IsNull() bool
- func (kv *KeyValue) Load() Value
- func (kv *KeyValue) Set(value Value)
- func (kv *KeyValue) String() string
- func (kv *KeyValue) ToBytes() []byte
- func (kv *KeyValue) WriteBytes(writer *bytes.Buffer) bool
- type KeyValues
- type Message
- func (msg *Message) BeginString() *KeyValue
- func (msg *Message) BeginStringTag() string
- func (msg *Message) Body() (kvs Items)
- func (msg *Message) BodyLength() int
- func (msg *Message) BodyLengthTag() string
- func (msg *Message) BytesWithoutChecksum() []byte
- func (msg *Message) CalcBodyLength() int
- func (msg *Message) CheckSum() string
- func (msg *Message) CheckSumTag() string
- func (msg *Message) Get(id int) Item
- func (msg *Message) Header() *Component
- func (msg *Message) Items() Items
- func (msg *Message) MsgType() string
- func (msg *Message) Prepare() error
- func (msg *Message) Set(id int, item Item) *Message
- func (msg *Message) SetBody(body ...Item) *Message
- func (msg *Message) SetHeader(header *Component) *Message
- func (msg *Message) SetTrailer(trailer *Component) *Message
- func (msg *Message) String() string
- func (msg *Message) ToBytes() ([]byte, error)
- func (msg *Message) ToBytesBuffered(buffers *buffer.MessageByteBuffers) ([]byte, error)
- func (msg *Message) Trailer() *Component
- func (msg *Message) WriteBytesWithoutChecksum(buffers *buffer.MessageByteBuffers)
- type MessageByteConverter
- type Raw
- type StorageID
- type StorageSide
- type String
- func (v *String) FromBytes(d []byte) (err error)
- func (v *String) IsEmpty() bool
- func (v *String) IsNull() bool
- func (v *String) Set(d interface{}) error
- func (v *String) String() string
- func (v *String) ToBytes() []byte
- func (v *String) Value() interface{}
- func (v *String) WriteBytes(writer *bytes.Buffer) bool
- type Time
- type Uint
- type Value
Constants ¶
const ( // CountOfSOHSymbols // Deprecated: should not be used, count SOH symbols by yourself CountOfSOHSymbols = 3 // CountOfSOHSymbolsWithoutBody // Deprecated: should not be used, count SOH symbols by yourself CountOfSOHSymbolsWithoutBody = 2 )
const ( True = 'Y' False = 'N' )
const DelimiterChar = 1
const TimeLayout = "20060102-15:04:05.000"
Variables ¶
var Delimiter = []byte{1}
Functions ¶
func CalcCheckSum ¶
func CalcCheckSumOptimized ¶ added in v1.15.0
func CalcCheckSumOptimizedFromBuffer ¶ added in v1.15.0
Types ¶
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
Bool is a structure used for converting Boolean values.
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component is an array of various FIX entities. It may contain a KeyValue, a Group and another Component.
func NewComponent ¶
NewComponent is used to create a new Component instance.
func (*Component) AsComponent ¶
AsComponent returns a specified component. This is required for structures that integrate this component.
func (*Component) AsTemplate ¶
AsTemplate returns a new structure with the same set of items as in a specified component (these items are assigned empty values).
func (*Component) Get ¶
Get returns a specific component item identified by its sequence number. Such item may be a *KeyValue, *Component or *Group.
func (*Component) SetComponent ¶
SetComponent is used to define an internal component for an item.
type ConvertableMessage ¶ added in v1.15.0
type ConvertableMessage interface {
ToBytesBuffered(buffers *buffer.MessageByteBuffers) ([]byte, error)
}
type Float ¶
type Float struct {
// contains filtered or unexported fields
}
Float is a structure used for converting values to the float64 type.
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group is a structure used to implement FIX group types.
func NewGroup ¶
NewGroup is used to create a new group based on: - the tag value specifying the number of elements, and - the list of tags
func (*Group) AddEntry ¶
AddEntry adds a new entry with the same list of tags as in a specified group. To generate all tags for a newly created entry, use the AsTemplate method.
func (*Group) AsTemplate ¶
AsTemplate returns a list of group tags as an Items object.
func (*Group) Entries ¶
Entries returns all entries belonging to a group as an array of Items objects.
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
Int is a structure used for converting integer values.
type Item ¶
type Item interface {
ToBytes() []byte
WriteBytes(writer *bytes.Buffer) bool
String() string
IsEmpty() bool
}
Item is an interface providing a method required to implement basic FIX item functionality.
type Items ¶
type Items []Item
Items is an array of Item elements.
type KeyValue ¶
KeyValue is a basic structure used for FIX message implementation. It is used to specify the tag and value for each field.
func NewKeyValue ¶
NewKeyValue returns a new KeyValue object.
func (*KeyValue) AsTemplate ¶
AsTemplate returns a copy of a KeyValue object with an empty value assigned to it.
func (*KeyValue) FromBytes ¶
FromBytes replaces a KeyValue object specified in the form of a byte array.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is a structure providing functionality to FIX messages.
func NewMessage ¶
func NewMessage(beginStringTag, bodyLengthTag, checkSumTag, msgTypeTag, beginString, msgType string) *Message
NewMessage is called to create a new message.
func (*Message) BeginString ¶
BeginString returns the beginString field value.
func (*Message) BeginStringTag ¶ added in v1.13.0
func (*Message) BodyLength ¶
BodyLength returns the BodyLength field value.
func (*Message) BodyLengthTag ¶ added in v1.13.0
func (*Message) BytesWithoutChecksum ¶
func (*Message) CalcBodyLength ¶
func (*Message) CheckSumTag ¶ added in v1.13.0
func (*Message) Get ¶
Get returns an Item corresponding to the message body (identified by the item sequence number).
func (*Message) Set ¶
Set replaces an Item corresponding to the message body (identified by the item sequence number).
func (*Message) SetTrailer ¶
SetTrailer specifies the message trailer fields (except for checkSum).
func (*Message) ToBytesBuffered ¶ added in v1.15.0
func (msg *Message) ToBytesBuffered(buffers *buffer.MessageByteBuffers) ([]byte, error)
func (*Message) WriteBytesWithoutChecksum ¶ added in v1.15.0
func (msg *Message) WriteBytesWithoutChecksum(buffers *buffer.MessageByteBuffers)
type MessageByteConverter ¶ added in v1.15.0
type MessageByteConverter struct {
// contains filtered or unexported fields
}
func NewMessageByteConverter ¶ added in v1.15.0
func NewMessageByteConverter(bufferSize int) *MessageByteConverter
func (*MessageByteConverter) ConvertToBytes ¶ added in v1.15.0
func (m *MessageByteConverter) ConvertToBytes(message ConvertableMessage) ([]byte, error)
type Raw ¶
type Raw struct {
// contains filtered or unexported fields
}
Raw is a structure that is used to convert the message data to a byte array.
type StorageID ¶ added in v1.13.0
type StorageID struct {
Sender string
Target string
Side StorageSide
}
type StorageSide ¶ added in v1.14.0
type StorageSide string
const ( Incoming StorageSide = "incoming" Outgoing StorageSide = "outgoing" )
type String ¶
type String struct {
// contains filtered or unexported fields
}
String is a structure used for converting string values.
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
Time is a structure used for converting date-time values.
type Uint ¶
type Uint struct {
// contains filtered or unexported fields
}
Uint is a structure used for converting values to the uint64 type.
type Value ¶
type Value interface {
// ToBytes returns a byte representation of a field value.
ToBytes() []byte
WriteBytes(writer *bytes.Buffer) bool
// FromBytes parses values stored in a byte array.
FromBytes([]byte) error
// Value returns a field value.
Value() interface{}
// String returns a string representation of a value.
String() string
// IsNull is used to check whether a field value is not filled
IsNull() bool
// IsNull is used to check whether a field value is empty.
IsEmpty() bool
// Set replaces a specified field value with a value of a corresponding type.
Set(d interface{}) error
}
Value is an interface implementing all basic methods required to process field values of FIX messages.