Skip to content

Commit 9a59f46

Browse files
Making it easier to read.
1 parent de4229c commit 9a59f46

File tree

9 files changed

+42
-32
lines changed

9 files changed

+42
-32
lines changed

application.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
package quickfix
22

3-
//The Application interface should be implemented by FIX Applications.
3+
//Application interface should be implemented by FIX Applications.
44
//This is the primary interface for processing messages from a FIX Session.
55
type Application interface {
6-
//Notification of a session begin created.
6+
//OnCreate notification of a session begin created.
77
OnCreate(sessionID SessionID)
88

9-
//Notification of a session successfully logging on.
9+
//OnLogon notification of a session successfully logging on.
1010
OnLogon(sessionID SessionID)
1111

12-
//Notification of a session logging off or disconnecting.
12+
//OnLogout notification of a session logging off or disconnecting.
1313
OnLogout(sessionID SessionID)
1414

15-
//Notification of admin message being sent to target.
15+
//ToAdmin notification of admin message being sent to target.
1616
ToAdmin(message *Message, sessionID SessionID)
1717

18-
//Notification of app message being sent to target.
18+
//ToApp notification of app message being sent to target.
1919
ToApp(message *Message, sessionID SessionID) error
2020

21-
//Notification of admin message being received from target.
21+
//FromAdmin notification of admin message being received from target.
2222
FromAdmin(message *Message, sessionID SessionID) MessageRejectError
2323

24-
//Notification of app message being received from target.
24+
//FromApp notification of app message being received from target.
2525
FromApp(message *Message, sessionID SessionID) MessageRejectError
2626
}

field.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package quickfix
22

33
//FieldValueWriter is an interface for writing field values
44
type FieldValueWriter interface {
5-
//Writes out the contents of the FieldValue to a []byte
5+
//Write writes out the contents of the FieldValue to a []byte
66
Write() []byte
77
}
88

99
//FieldValueReader is an interface for reading field values
1010
type FieldValueReader interface {
11-
//Reads the contents of the []byte into FieldValue. Returns an error if there are issues in the data processing
11+
//Read reads the contents of the []byte into FieldValue.
12+
//Returns an error if there are issues in the data processing
1213
Read([]byte) error
1314
}
1415

filestore.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"time"
1111

1212
"github.com/pkg/errors"
13+
1314
"github.com/quickfixgo/quickfix/config"
1415
)
1516

@@ -275,11 +276,11 @@ func (store *fileStore) CreationTime() time.Time {
275276
}
276277

277278
func (store *fileStore) SaveMessage(seqNum int, msg []byte) error {
278-
offset, err := store.bodyFile.Seek(0, os.SEEK_END)
279+
offset, err := store.bodyFile.Seek(0, io.SeekEnd)
279280
if err != nil {
280281
return fmt.Errorf("unable to seek to end of file: %s: %s", store.bodyFname, err.Error())
281282
}
282-
if _, err := store.headerFile.Seek(0, os.SEEK_END); err != nil {
283+
if _, err := store.headerFile.Seek(0, io.SeekEnd); err != nil {
283284
return fmt.Errorf("unable to seek to end of file: %s: %s", store.headerFname, err.Error())
284285
}
285286
if _, err := fmt.Fprintf(store.headerFile, "%d,%d,%d\n", seqNum, offset, len(msg)); err != nil {

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ require (
88
github.com/kr/text v0.2.0 // indirect
99
github.com/mattn/go-sqlite3 v1.14.7
1010
github.com/pkg/errors v0.9.1
11-
github.com/shopspring/decimal v1.2.0
11+
github.com/shopspring/decimal v1.3.1
1212
github.com/stretchr/objx v0.3.0 // indirect
1313
github.com/stretchr/testify v1.7.0
14-
golang.org/x/net v0.0.0-20210614182718-04defd469f4e
14+
golang.org/x/net v0.0.0-20220225172249-27dd8689420f
1515
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
1616
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
1717
)

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
2020
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
2121
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
2222
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
23+
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
24+
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
2325
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
2426
github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As=
2527
github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
@@ -28,10 +30,16 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
2830
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
2931
golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q=
3032
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
33+
golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
34+
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
3135
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
3236
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
37+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
38+
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3339
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
40+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
3441
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
42+
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
3543
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
3644
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3745
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=

log.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ package quickfix
22

33
//Log is a generic interface for logging FIX messages and events.
44
type Log interface {
5-
//log incoming fix message
5+
//OnIncoming log incoming fix message
66
OnIncoming([]byte)
77

8-
//log outgoing fix message
8+
//OnOutgoing log outgoing fix message
99
OnOutgoing([]byte)
1010

11-
//log fix event
11+
//OnEvent log fix event
1212
OnEvent(string)
1313

14-
//log fix event according to format specifier
14+
//OnEventf log fix event according to format specifier
1515
OnEventf(string, ...interface{})
1616
}
1717

1818
//The LogFactory interface creates global and session specific Log instances
1919
type LogFactory interface {
20-
//global log
20+
//Create global log
2121
Create() (Log, error)
2222

23-
//session specific log
23+
//CreateSessionLog session specific log
2424
CreateSessionLog(sessionID SessionID) (Log, error)
2525
}

repeating_group.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type GroupItem interface {
1111
//Tag returns the tag identifying this GroupItem
1212
Tag() Tag
1313

14-
//Parameter to Read is tagValues. For most fields, only the first tagValue will be required.
14+
//Read Parameter to Read is tagValues. For most fields, only the first tagValue will be required.
1515
//The length of the slice extends from the tagValue mapped to the field to be read through the
1616
//following fields. This can be useful for GroupItems made up of repeating groups.
1717
//

session_state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ type sessionState interface {
218218
//Stop triggers a clean stop
219219
Stop(*session) (nextState sessionState)
220220

221-
//debugging convenience
221+
//Stringer debugging convenience
222222
fmt.Stringer
223223
}
224224

store_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,22 @@ func (s *MessageStoreTestSuite) TestMessageStore_SaveMessage_GetMessage() {
113113
s.Equal(expectedMsgsBySeqNum[3], string(actualMsgs[2]))
114114
}
115115

116-
func (suite *MessageStoreTestSuite) TestMessageStore_GetMessages_EmptyStore() {
116+
func (s *MessageStoreTestSuite) TestMessageStore_GetMessages_EmptyStore() {
117117
// When messages are retrieved from an empty store
118-
messages, err := suite.msgStore.GetMessages(1, 2)
119-
require.Nil(suite.T(), err)
118+
messages, err := s.msgStore.GetMessages(1, 2)
119+
require.Nil(s.T(), err)
120120

121121
// Then no messages should be returned
122-
require.Empty(suite.T(), messages, "Did not expect messages from empty store")
122+
require.Empty(s.T(), messages, "Did not expect messages from empty store")
123123
}
124124

125-
func (suite *MessageStoreTestSuite) TestMessageStore_GetMessages_VariousRanges() {
126-
t := suite.T()
125+
func (s *MessageStoreTestSuite) TestMessageStore_GetMessages_VariousRanges() {
126+
t := s.T()
127127

128128
// Given the following saved messages
129-
require.Nil(t, suite.msgStore.SaveMessage(1, []byte("hello")))
130-
require.Nil(t, suite.msgStore.SaveMessage(2, []byte("cruel")))
131-
require.Nil(t, suite.msgStore.SaveMessage(3, []byte("world")))
129+
require.Nil(t, s.msgStore.SaveMessage(1, []byte("hello")))
130+
require.Nil(t, s.msgStore.SaveMessage(2, []byte("cruel")))
131+
require.Nil(t, s.msgStore.SaveMessage(3, []byte("world")))
132132

133133
// When the following requests are made to the store
134134
var testCases = []struct {
@@ -148,7 +148,7 @@ func (suite *MessageStoreTestSuite) TestMessageStore_GetMessages_VariousRanges()
148148

149149
// Then the returned messages should be
150150
for _, tc := range testCases {
151-
actualMsgs, err := suite.msgStore.GetMessages(tc.beginSeqNo, tc.endSeqNo)
151+
actualMsgs, err := s.msgStore.GetMessages(tc.beginSeqNo, tc.endSeqNo)
152152
require.Nil(t, err)
153153
require.Len(t, actualMsgs, len(tc.expectedBytes))
154154
for i, expectedMsg := range tc.expectedBytes {

0 commit comments

Comments
 (0)