Skip to content

Commit c24ccbb

Browse files
author
chris busbey
committed
linting mongostore
1 parent 27b642e commit c24ccbb

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

mongostore.go

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package quickfix
22

33
import (
44
"fmt"
5+
"time"
6+
57
"github.com/globalsign/mgo"
68
"github.com/globalsign/mgo/bson"
7-
"time"
89

910
"github.com/quickfixgo/quickfix/config"
1011
)
@@ -18,7 +19,7 @@ type mongoStoreFactory struct {
1819
type mongoStore struct {
1920
sessionID SessionID
2021
cache *memoryStore
21-
mongoUrl string
22+
mongoURL string
2223
mongoDatabase string
2324
db *mgo.Session
2425
messagesCollection string
@@ -45,29 +46,29 @@ func (f mongoStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, e
4546
if !ok {
4647
return nil, fmt.Errorf("unknown session: %v", sessionID)
4748
}
48-
mongoConnectionUrl, err := sessionSettings.Setting(config.MongoStoreConnection)
49+
mongoConnectionURL, err := sessionSettings.Setting(config.MongoStoreConnection)
4950
if err != nil {
5051
return nil, err
5152
}
5253
mongoDatabase, err := sessionSettings.Setting(config.MongoStoreDatabase)
5354
if err != nil {
5455
return nil, err
5556
}
56-
return newMongoStore(sessionID, mongoConnectionUrl, mongoDatabase, f.messagesCollection, f.sessionsCollection)
57+
return newMongoStore(sessionID, mongoConnectionURL, mongoDatabase, f.messagesCollection, f.sessionsCollection)
5758
}
5859

59-
func newMongoStore(sessionID SessionID, mongoUrl string, mongoDatabase string, messagesCollection string, sessionsCollection string) (store *mongoStore, err error) {
60+
func newMongoStore(sessionID SessionID, mongoURL string, mongoDatabase string, messagesCollection string, sessionsCollection string) (store *mongoStore, err error) {
6061
store = &mongoStore{
6162
sessionID: sessionID,
6263
cache: &memoryStore{},
63-
mongoUrl: mongoUrl,
64+
mongoURL: mongoURL,
6465
mongoDatabase: mongoDatabase,
6566
messagesCollection: messagesCollection,
6667
sessionsCollection: sessionsCollection,
6768
}
6869
store.cache.Reset()
6970

70-
if store.db, err = mgo.Dial(mongoUrl); err != nil {
71+
if store.db, err = mgo.Dial(mongoURL); err != nil {
7172
return
7273
}
7374
err = store.populateCache()
@@ -79,12 +80,12 @@ func generateMessageFilter(s *SessionID) (messageFilter *mongoQuickFixEntryData)
7980
messageFilter = &mongoQuickFixEntryData{
8081
BeginString: s.BeginString,
8182
SessionQualifier: s.Qualifier,
82-
SenderCompId: s.SenderCompID,
83-
SenderSubId: s.SenderSubID,
84-
SenderLocId: s.SenderLocationID,
85-
TargetCompId: s.TargetCompID,
86-
TargetSubId: s.TargetSubID,
87-
TargetLocId: s.TargetLocationID,
83+
SenderCompID: s.SenderCompID,
84+
SenderSubID: s.SenderSubID,
85+
SenderLocID: s.SenderLocationID,
86+
TargetCompID: s.TargetCompID,
87+
TargetSubID: s.TargetSubID,
88+
TargetLocID: s.TargetLocationID,
8889
}
8990
return
9091
}
@@ -100,12 +101,12 @@ type mongoQuickFixEntryData struct {
100101
//Indexed data
101102
BeginString string `bson:"begin_string"`
102103
SessionQualifier string `bson:"session_qualifier"`
103-
SenderCompId string `bson:"sender_comp_id"`
104-
SenderSubId string `bson:"sender_sub_id"`
105-
SenderLocId string `bson:"sender_loc_id"`
106-
TargetCompId string `bson:"target_comp_id"`
107-
TargetSubId string `bson:"target_sub_id"`
108-
TargetLocId string `bson:"target_loc_id"`
104+
SenderCompID string `bson:"sender_comp_id"`
105+
SenderSubID string `bson:"sender_sub_id"`
106+
SenderLocID string `bson:"sender_loc_id"`
107+
TargetCompID string `bson:"target_comp_id"`
108+
TargetSubID string `bson:"target_sub_id"`
109+
TargetLocID string `bson:"target_loc_id"`
109110
}
110111

111112
// Reset deletes the store records and sets the seqnums back to 1

0 commit comments

Comments
 (0)