From e218eb9e9ef20f707d14fa7d2bb74b9981b8efc8 Mon Sep 17 00:00:00 2001 From: Matt Lane Date: Fri, 19 Jan 2018 12:08:20 -0600 Subject: [PATCH 001/139] added new exported unregister session call --- registry.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/registry.go b/registry.go index ac074d2da..3c1fb2af8 100644 --- a/registry.go +++ b/registry.go @@ -50,6 +50,19 @@ func SendToTarget(m Messagable, sessionID SessionID) error { return session.queueForSend(msg) } +//UnregisterSession removes a session from the set of known sessions +func UnregisterSession(sessionID SessionID) error { + sessionsLock.Lock() + defer sessionsLock.Unlock() + + if _, ok := sessions[sessionID]; ok { + delete(sessions, sessionID) + return nil + } + + return errUnknownSession +} + func registerSession(s *session) error { sessionsLock.Lock() defer sessionsLock.Unlock() From 5c51bd06abb2dbbc7007ce3aadc2c1929c04f999 Mon Sep 17 00:00:00 2001 From: CCI_elmasm Date: Tue, 27 Feb 2018 10:44:13 +0000 Subject: [PATCH 002/139] importPathRoot function can now support linux and windows file path syntax --- cmd/generate-fix/internal/helpers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/generate-fix/internal/helpers.go b/cmd/generate-fix/internal/helpers.go index 13d94bf7f..7b4a96fe1 100644 --- a/cmd/generate-fix/internal/helpers.go +++ b/cmd/generate-fix/internal/helpers.go @@ -2,7 +2,7 @@ package internal import ( "os" - "path" + "path/filepath" "strings" ) @@ -15,7 +15,7 @@ func getImportPathRoot() string { if err != nil { panic(err) } - goSrcPath := path.Join(os.Getenv("GOPATH"), "src") - importPathRoot := strings.Replace(pwd, goSrcPath, "", 1) + goSrcPath := filepath.Join(os.Getenv("GOPATH"), "src") + importPathRoot := filepath.ToSlash(strings.Replace(pwd, goSrcPath, "", 1)) return strings.TrimLeft(importPathRoot, "/") -} +} \ No newline at end of file From d6236b06cdd7b02949e86eb36bbfefae392be8e4 Mon Sep 17 00:00:00 2001 From: John Dydo Date: Wed, 21 Mar 2018 23:24:52 -0400 Subject: [PATCH 003/139] change EventTimer to reset its Timer without requiring a reset channel EventTimer.Reset implemented using a channel would deadlock if thread A calls Reset more than once while the EventTimer is invoking its action and the action blocks on thread A (i.e. sending to an unbuffered channel that thread A must receive from) --- internal/event_timer.go | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/internal/event_timer.go b/internal/event_timer.go index 2913684c5..0b7630cbc 100644 --- a/internal/event_timer.go +++ b/internal/event_timer.go @@ -8,38 +8,31 @@ import ( type EventTimer struct { f func() timer *time.Timer - reset chan time.Duration + done chan struct{} wg sync.WaitGroup } func NewEventTimer(task func()) *EventTimer { t := &EventTimer{ f: task, - reset: make(chan time.Duration, 1), + timer: newStoppedTimer(), + done: make(chan struct{}), } t.wg.Add(1) go func() { defer t.wg.Done() - var c <-chan time.Time for { select { - case <-c: + case <-t.timer.C: t.f() - case d, ok := <-t.reset: - if !ok { - return - } + case <-t.done: + t.timer.Stop() + return - if t.timer != nil { - t.timer.Reset(d) - } else { - t.timer = time.NewTimer(d) - c = t.timer.C - } } } }() @@ -52,7 +45,7 @@ func (t *EventTimer) Stop() { return } - close(t.reset) + close(t.done) t.wg.Wait() } @@ -61,5 +54,13 @@ func (t *EventTimer) Reset(timeout time.Duration) { return } - t.reset <- timeout + t.timer.Reset(timeout) +} + +func newStoppedTimer() *time.Timer { + timer := time.NewTimer(time.Second) + if !timer.Stop() { + <-timer.C + } + return timer } From c6b4c59eea22e045e9e706905c8133958c6b60f5 Mon Sep 17 00:00:00 2001 From: Chris Busbey Date: Fri, 23 Mar 2018 06:45:59 -0500 Subject: [PATCH 004/139] link to mailing list in CONTRIBUTING --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d87ed08c1..2f86a01d9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,8 @@ We welcome pull requests, bug fixes and issue reports. +Please direct questions about using the library to the [Mailing List](https://groups.google.com/forum/#!forum/quickfixgo). + Before proposing a large change, please discuss your change by raising an issue. ## Submitting Changes From 91c418c293bdf03208224c325a35b4b324fc4366 Mon Sep 17 00:00:00 2001 From: Darwayne Date: Sat, 28 Jul 2018 21:00:08 -0400 Subject: [PATCH 005/139] Adds support for RejectInvalidMessage configuration. --- config/configuration.go | 1 + config/doc.go | 8 ++++++++ session_factory.go | 6 ++++++ validation.go | 17 ++++++++++++----- validation_test.go | 39 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 66 insertions(+), 5 deletions(-) diff --git a/config/configuration.go b/config/configuration.go index a8b5ae2cf..cf208cfa7 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -48,4 +48,5 @@ const ( TimeStampPrecision string = "TimeStampPrecision" MaxLatency string = "MaxLatency" PersistMessages string = "PersistMessages" + RejectInvalidMessage string = "RejectInvalidMessage" ) diff --git a/config/doc.go b/config/doc.go index 48b4113b7..2338543f0 100644 --- a/config/doc.go +++ b/config/doc.go @@ -202,6 +202,14 @@ If set to N, fields that are out of order (i.e. body fields in the header, or he Defaults to Y. +RejectInvalidMessage + +If RejectInvalidMessage is set to N, zero errors will be thrown on reception of message that fails data dictionary validation. Valid Values: + Y + N + +Defaults to Y. + CheckLatency If set to Y, messages must be received from the counterparty within a defined number of seconds. It is useful to turn this off if a system uses localtime for it's timestamps instead of GMT. Valid Values: diff --git a/session_factory.go b/session_factory.go index 90e118290..36e294837 100644 --- a/session_factory.go +++ b/session_factory.go @@ -76,6 +76,12 @@ func (f sessionFactory) newSession( } } + if settings.HasSetting(config.RejectInvalidMessage) { + if validatorSettings.RejectInvalidMessage, err = settings.BoolSetting(config.RejectInvalidMessage); err != nil { + return + } + } + if sessionID.IsFIXT() { if s.DefaultApplVerID, err = settings.Setting(config.DefaultApplVerID); err != nil { return diff --git a/validation.go b/validation.go index 92aed28d5..6e28b8cd0 100644 --- a/validation.go +++ b/validation.go @@ -10,12 +10,15 @@ type validator interface { type validatorSettings struct { CheckFieldsOutOfOrder bool + RejectInvalidMessage bool + } //Default configuration for message validation. //See http://www.quickfixengine.org/quickfix/doc/html/configuration.html. var defaultValidatorSettings = validatorSettings{ CheckFieldsOutOfOrder: true, + RejectInvalidMessage: true, } type fixValidator struct { @@ -74,14 +77,18 @@ func validateFIX(d *datadictionary.DataDictionary, settings validatorSettings, m } } - if err := validateFields(d, d, msgType, msg); err != nil { - return err - } + if settings.RejectInvalidMessage { + if err := validateFields(d, d, msgType, msg); err != nil { + return err + } - if err := validateWalk(d, d, msgType, msg); err != nil { - return err + if err := validateWalk(d, d, msgType, msg); err != nil { + return err + } } + + return nil } diff --git a/validation_test.go b/validation_test.go index 1bc7c7000..7e5a7a3bc 100644 --- a/validation_test.go +++ b/validation_test.go @@ -37,6 +37,8 @@ func TestValidate(t *testing.T) { tcTagIsDefinedForMessage(), tcFieldNotFoundBody(), tcFieldNotFoundHeader(), + tcInvalidTagCheckDisabled(), + tcInvalidTagCheckEnabled(), } msg := NewMessage() @@ -378,6 +380,43 @@ func tcTagSpecifiedOutOfRequiredOrderTrailer() validateTest { } } +func tcInvalidTagCheckDisabled() validateTest { + dict, _ := datadictionary.Parse("spec/FIX40.xml") + validator := &fixValidator{dict, defaultValidatorSettings} + validator.settings.RejectInvalidMessage = false + + builder := createFIX40NewOrderSingle() + tag := Tag(9999) + builder.Body.SetField(tag, FIXString("hello")) + msgBytes := builder.build() + + return validateTest{ + TestName: "Invalid Tag Check - Disabled", + Validator: validator, + MessageBytes: msgBytes, + DoNotExpectReject: true, + } +} + +func tcInvalidTagCheckEnabled() validateTest { + dict, _ := datadictionary.Parse("spec/FIX40.xml") + validator := &fixValidator{dict, defaultValidatorSettings} + validator.settings.RejectInvalidMessage = true + + builder := createFIX40NewOrderSingle() + tag := Tag(9999) + builder.Body.SetField(tag, FIXString("hello")) + msgBytes := builder.build() + + return validateTest{ + TestName: "Invalid Tag Check - Enabled", + Validator: validator, + MessageBytes: msgBytes, + DoNotExpectReject: false, + ExpectedRefTagID: &tag, + } +} + func tcTagSpecifiedOutOfRequiredOrderDisabledHeader() validateTest { dict, _ := datadictionary.Parse("spec/FIX40.xml") validator := &fixValidator{dict, defaultValidatorSettings} From ad10c6950f4da504094d5d5187c9d35a8abdaf41 Mon Sep 17 00:00:00 2001 From: Federico Paolinelli Date: Thu, 11 Oct 2018 21:22:32 +0200 Subject: [PATCH 006/139] Added CopyInto method to clone a message into another one --- message.go | 30 ++++++++++++++++++++++++++++++ message_test.go | 13 +++++++++++++ 2 files changed, 43 insertions(+) diff --git a/message.go b/message.go index 8d67c4736..344c961a8 100644 --- a/message.go +++ b/message.go @@ -114,6 +114,25 @@ func NewMessage() *Message { return m } +// CopyInto erases the dest messages and copies the curreny message content +// into it. +func (m *Message) CopyInto(to *Message) error { + to.Header.Clear() + to.Body.Clear() + to.Trailer.Clear() + + to.Header.FieldMap = cloneFieldMap(m.Header.FieldMap) + to.Body.FieldMap = cloneFieldMap(m.Body.FieldMap) + to.Trailer.FieldMap = cloneFieldMap(m.Trailer.FieldMap) + + to.rawMessage = m.rawMessage + to.ReceiveTime = m.ReceiveTime + to.bodyBytes = make([]byte, len(m.bodyBytes)) + + to.cook() + return nil +} + //ParseMessage constructs a Message from a byte slice wrapping a FIX message. func ParseMessage(msg *Message, rawMessage *bytes.Buffer) (err error) { return ParseMessageWithDataDictionary(msg, rawMessage, nil, nil) @@ -363,3 +382,14 @@ func (m *Message) cook() { checkSum := (m.Header.total() + m.Body.total() + m.Trailer.total()) % 256 m.Trailer.SetString(tagCheckSum, formatCheckSum(checkSum)) } + +func cloneFieldMap(f FieldMap) FieldMap { + res := FieldMap{} + res.tagLookup = make(map[Tag]field) + for tag, field := range f.tagLookup { + res.tagLookup[tag] = field + } + res.tags = make([]Tag, len(f.tags)) + copy(res.tags, f.tags) + return res +} diff --git a/message_test.go b/message_test.go index fb7caf9a9..78041c537 100644 --- a/message_test.go +++ b/message_test.go @@ -166,3 +166,16 @@ func (s *MessageSuite) TestReverseRouteFIX40() { s.False(builder.Header.Has(tagOnBehalfOfLocationID), "onbehalfof location id not supported in fix40") } + +func (s *MessageSuite) TestCopyIntoMessage() { + //onbehalfof/deliverto location id not supported in fix 4.0 + s.Nil(ParseMessage(s.msg, bytes.NewBufferString("8=FIX.4.09=17135=D34=249=TW50=KK52=20060102-15:04:0556=ISLD57=AP144=BB115=JCD116=CS128=MG129=CB142=JV143=RY145=BH11=ID21=338=10040=w54=155=INTC60=20060102-15:04:0510=123"))) + + dest := NewMessage() + s.msg.CopyInto(dest) + seqNum, _ := dest.Header.GetInt(tagMsgSeqNum) + s.Equal(2, seqNum) + + handInst, _ := dest.Body.GetInt(21) + s.Equal(3, handInst) +} From 55d5590052f5515041365de14d51fdab84f7dd07 Mon Sep 17 00:00:00 2001 From: Federico Paolinelli Date: Fri, 12 Oct 2018 22:56:18 +0200 Subject: [PATCH 007/139] Final changes & test --- message.go | 8 ++++++-- message_test.go | 28 ++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/message.go b/message.go index 344c961a8..4833aa6c7 100644 --- a/message.go +++ b/message.go @@ -128,8 +128,12 @@ func (m *Message) CopyInto(to *Message) error { to.rawMessage = m.rawMessage to.ReceiveTime = m.ReceiveTime to.bodyBytes = make([]byte, len(m.bodyBytes)) - - to.cook() + copy(to.bodyBytes, m.bodyBytes) + to.fields = make([]TagValue, len(m.fields)) + for i := range to.fields { + to.fields[i].init(m.fields[i].tag, m.fields[i].value) + fmt.Println(i) + } return nil } diff --git a/message_test.go b/message_test.go index 78041c537..3cbdb52ad 100644 --- a/message_test.go +++ b/message_test.go @@ -2,6 +2,7 @@ package quickfix import ( "bytes" + "reflect" "testing" "github.com/quickfixgo/quickfix/datadictionary" @@ -168,14 +169,29 @@ func (s *MessageSuite) TestReverseRouteFIX40() { } func (s *MessageSuite) TestCopyIntoMessage() { - //onbehalfof/deliverto location id not supported in fix 4.0 - s.Nil(ParseMessage(s.msg, bytes.NewBufferString("8=FIX.4.09=17135=D34=249=TW50=KK52=20060102-15:04:0556=ISLD57=AP144=BB115=JCD116=CS128=MG129=CB142=JV143=RY145=BH11=ID21=338=10040=w54=155=INTC60=20060102-15:04:0510=123"))) + s.Nil(ParseMessage(s.msg, bytes.NewBufferString("8=FIX.4.29=17135=D34=249=TW50=KK52=20060102-15:04:0556=ISLD57=AP144=BB115=JCD116=CS128=MG129=CB142=JV143=RY145=BH11=ID21=338=10040=w54=155=INTC60=20060102-15:04:0510=123"))) dest := NewMessage() s.msg.CopyInto(dest) - seqNum, _ := dest.Header.GetInt(tagMsgSeqNum) - s.Equal(2, seqNum) + checkFieldInt(s, dest.Header.FieldMap, int(tagMsgSeqNum), 2) + checkFieldInt(s, dest.Body.FieldMap, 21, 3) + checkFieldString(s, dest.Body.FieldMap, 11, "ID") + s.Equal(len(dest.bodyBytes), len(s.msg.bodyBytes)) + + s.True(reflect.DeepEqual(s.msg.bodyBytes, dest.bodyBytes)) + s.True(s.msg.IsMsgTypeOf("D")) + s.Equal(s.msg.ReceiveTime, dest.ReceiveTime) + + s.True(reflect.DeepEqual(s.msg.fields, dest.fields)) +} + +func checkFieldInt(s *MessageSuite, fields FieldMap, tag, expected int) { + toCheck, _ := fields.GetInt(Tag(tag)) + s.Equal(expected, toCheck) +} - handInst, _ := dest.Body.GetInt(21) - s.Equal(3, handInst) +func checkFieldString(s *MessageSuite, fields FieldMap, tag int, expected string) { + toCheck, err := fields.GetString(Tag(tag)) + s.NoError(err) + s.Equal(expected, toCheck) } From 8653e13cd820d5a5993f8218708e81e85f0c64e2 Mon Sep 17 00:00:00 2001 From: Federico Paolinelli Date: Sat, 20 Oct 2018 23:28:52 +0200 Subject: [PATCH 008/139] Removed debug print --- message.go | 1 - 1 file changed, 1 deletion(-) diff --git a/message.go b/message.go index 4833aa6c7..5f200d6f6 100644 --- a/message.go +++ b/message.go @@ -132,7 +132,6 @@ func (m *Message) CopyInto(to *Message) error { to.fields = make([]TagValue, len(m.fields)) for i := range to.fields { to.fields[i].init(m.fields[i].tag, m.fields[i].value) - fmt.Println(i) } return nil } From 66d0114c4cffcd0867b27f341db5e4cd34f951a8 Mon Sep 17 00:00:00 2001 From: Michael Wilner Date: Tue, 30 Oct 2018 08:57:34 -0500 Subject: [PATCH 009/139] Implement Mongo backing store for persistence --- Gopkg.lock | 46 +++++++- config/configuration.go | 2 + mongostore.go | 249 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 295 insertions(+), 2 deletions(-) create mode 100644 mongostore.go diff --git a/Gopkg.lock b/Gopkg.lock index 156d40f26..4d6e80a80 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,50 +2,92 @@ [[projects]] + digest = "1:56c130d885a4aacae1dd9c7b71cfe39912c7ebc1ff7d2b46083c8812996dc43b" name = "github.com/davecgh/go-spew" packages = ["spew"] + pruneopts = "" revision = "346938d642f2ec3594ed81d874461961cd0faa76" version = "v1.1.0" [[projects]] + branch = "master" + digest = "1:e9ffb9315dce0051beb757d0f0fc25db57c4da654efc4eada4ea109c2d9da815" + name = "github.com/globalsign/mgo" + packages = [ + ".", + "bson", + "internal/json", + "internal/sasl", + "internal/scram", + ] + pruneopts = "" + revision = "eeefdecb41b842af6dc652aaea4026e8403e62df" + +[[projects]] + digest = "1:1cc12f4618ce8d71ca28ef3708f4e98e1318ab6f06ecfffb6781b893f271c89c" name = "github.com/mattn/go-sqlite3" packages = ["."] + pruneopts = "" revision = "ca5e3819723d8eeaf170ad510e7da1d6d2e94a08" version = "v1.2.0" [[projects]] + digest = "1:256484dbbcd271f9ecebc6795b2df8cad4c458dd0f5fd82a8c2fa0c29f233411" name = "github.com/pmezard/go-difflib" packages = ["difflib"] + pruneopts = "" revision = "792786c7400a136282c1664665ae0a8db921c6c2" version = "v1.0.0" [[projects]] branch = "master" + digest = "1:68a81aa25065b50a4bf1ffd115ff3634704f61f675d0140b31492e9fcca55421" name = "github.com/shopspring/decimal" packages = ["."] + pruneopts = "" revision = "aed1bfe463fa3c9cc268d60dcc1491db613bff7e" [[projects]] branch = "master" + digest = "1:ed7ac53c7d59041f27964d3f04e021b45ecb5f23c842c84d778a7f1fb67e2ce9" name = "github.com/stretchr/objx" packages = ["."] + pruneopts = "" revision = "1a9d0bb9f541897e62256577b352fdbc1fb4fd94" [[projects]] + digest = "1:3926a4ec9a4ff1a072458451aa2d9b98acd059a45b38f7335d31e06c3d6a0159" name = "github.com/stretchr/testify" - packages = ["assert","mock","require","suite"] + packages = [ + "assert", + "mock", + "require", + "suite", + ] + pruneopts = "" revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" version = "v1.1.4" [[projects]] branch = "master" + digest = "1:898bc7c802c1e0c20cecd65811e90b7b9bc5651b4a07aefd159451bfb200b2b3" name = "golang.org/x/net" packages = ["context"] + pruneopts = "" revision = "a04bdaca5b32abe1c069418fb7088ae607de5bd0" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "6efc9f467166be5af0c9b9f4b98d7860ba12b50ce641a2fba765049bd1ea4f27" + input-imports = [ + "github.com/globalsign/mgo", + "github.com/globalsign/mgo/bson", + "github.com/mattn/go-sqlite3", + "github.com/shopspring/decimal", + "github.com/stretchr/testify/assert", + "github.com/stretchr/testify/mock", + "github.com/stretchr/testify/require", + "github.com/stretchr/testify/suite", + ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/config/configuration.go b/config/configuration.go index cf208cfa7..dbc74e86c 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -41,6 +41,8 @@ const ( SQLStoreDriver string = "SQLStoreDriver" SQLStoreDataSourceName string = "SQLStoreDataSourceName" SQLStoreConnMaxLifetime string = "SQLStoreConnMaxLifetime" + MongoStoreConnection string = "MongoStoreConnection" + MongoStoreDatabase string = "MongoStoreDatabase" ValidateFieldsOutOfOrder string = "ValidateFieldsOutOfOrder" ResendRequestChunkSize string = "ResendRequestChunkSize" EnableLastMsgSeqNumProcessed string = "EnableLastMsgSeqNumProcessed" diff --git a/mongostore.go b/mongostore.go new file mode 100644 index 000000000..c22ab0af6 --- /dev/null +++ b/mongostore.go @@ -0,0 +1,249 @@ +package quickfix + +import ( + "fmt" + "github.com/globalsign/mgo" + "github.com/globalsign/mgo/bson" + "time" + + "github.com/quickfixgo/quickfix/config" +) + +type mongoStoreFactory struct { + settings *Settings +} + +type mongoStore struct { + sessionID SessionID + cache *memoryStore + mongoUrl string + mongoDatabase string + db *mgo.Session +} + +// NewMongoStoreFactory returns a mongo-based implementation of MessageStoreFactory +func NewMongoStoreFactory(settings *Settings) MessageStoreFactory { + return mongoStoreFactory{settings: settings} +} + +// Create creates a new MongoStore implementation of the MessageStore interface +func (f mongoStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, err error) { + sessionSettings, ok := f.settings.SessionSettings()[sessionID] + if !ok { + return nil, fmt.Errorf("unknown session: %v", sessionID) + } + mongoConnectionUrl, err := sessionSettings.Setting(config.MongoStoreConnection) + if err != nil { + return nil, err + } + mongoDatabase, err := sessionSettings.Setting(config.MongoStoreDatabase) + if err != nil { + return nil, err + } + return newMongoStore(sessionID, mongoConnectionUrl, mongoDatabase) +} + +func newMongoStore(sessionID SessionID, mongoUrl string, mongoDatabase string) (*mongoStore, error) { + store := &mongoStore{ + sessionID: sessionID, + cache: &memoryStore{}, + mongoUrl: mongoUrl, + mongoDatabase: mongoDatabase, + } + store.cache.Reset() + + if conn, err := mgo.Dial(mongoUrl); err != nil { + return nil, err + } else { + store.db = conn + } + + if err := store.populateCache(); err != nil { + return nil, err + } + + return store, nil +} + +func generateMessageFilter(s *SessionID) (messageFilter *MongoQuickFixEntryData) { + messageFilter = &MongoQuickFixEntryData{ + BeginString: s.BeginString, + SessionQualifier: s.Qualifier, + SenderCompId: s.SenderCompID, + SenderSubId: s.SenderSubID, + SenderLocId: s.SenderLocationID, + TargetCompId: s.TargetCompID, + TargetSubId: s.TargetSubID, + TargetLocId: s.TargetLocationID, + } + return +} + +type MongoQuickFixEntryData struct { + //Message specific data + Msgseq int `bson:"msgseq,omitempty"` + Message []byte `bson:"message,omitempty"` + //Session specific data + CreationTime time.Time `bson:"creation_time,omitempty"` + IncomingSeqNum int `bson:"incoming_seq_num,omitempty"` + OutgoingSeqNum int `bson:"outgoing_seq_num,omitempty"` + //Indexed data + BeginString string `bson:"begin_string"` + SessionQualifier string `bson:"session_qualifier"` + SenderCompId string `bson:"sender_comp_id"` + SenderSubId string `bson:"sender_sub_id"` + SenderLocId string `bson:"sender_loc_id"` + TargetCompId string `bson:"target_comp_id"` + TargetSubId string `bson:"target_sub_id"` + TargetLocId string `bson:"target_loc_id"` +} + +// Reset deletes the store records and sets the seqnums back to 1 +func (store *mongoStore) Reset() error { + msgFilter := generateMessageFilter(&store.sessionID) + _, err := store.db.DB(store.mongoDatabase).C("messages").RemoveAll(msgFilter) + + if err != nil { + return err + } + + if err = store.cache.Reset(); err != nil { + return err + } + + sessionUpdate := generateMessageFilter(&store.sessionID) + sessionUpdate.CreationTime = store.cache.CreationTime() + sessionUpdate.IncomingSeqNum = store.cache.NextTargetMsgSeqNum() + sessionUpdate.OutgoingSeqNum = store.cache.NextSenderMsgSeqNum() + err = store.db.DB(store.mongoDatabase).C("sessions").Update(msgFilter, sessionUpdate) + + return err +} + +// Refresh reloads the store from the database +func (store *mongoStore) Refresh() error { + if err := store.cache.Reset(); err != nil { + return err + } + return store.populateCache() +} + +func (store *mongoStore) populateCache() (err error) { + msgFilter := generateMessageFilter(&store.sessionID) + query := store.db.DB(store.mongoDatabase).C("sessions").Find(msgFilter) + + if cnt, err := query.Count(); err == nil && cnt > 0 { + // session record found, load it + sessionData := &MongoQuickFixEntryData{} + err = query.One(&sessionData) + if err == nil { + store.cache.creationTime = sessionData.CreationTime + store.cache.SetNextTargetMsgSeqNum(sessionData.IncomingSeqNum) + store.cache.SetNextSenderMsgSeqNum(sessionData.OutgoingSeqNum) + } + } else if err == nil && cnt == 0 { + // session record not found, create it + msgFilter.CreationTime = store.cache.creationTime + msgFilter.IncomingSeqNum = store.cache.NextTargetMsgSeqNum() + msgFilter.OutgoingSeqNum = store.cache.NextSenderMsgSeqNum() + err = store.db.DB(store.mongoDatabase).C("sessions").Insert(msgFilter) + } + return +} + +// NextSenderMsgSeqNum returns the next MsgSeqNum that will be sent +func (store *mongoStore) NextSenderMsgSeqNum() int { + return store.cache.NextSenderMsgSeqNum() +} + +// NextTargetMsgSeqNum returns the next MsgSeqNum that should be received +func (store *mongoStore) NextTargetMsgSeqNum() int { + return store.cache.NextTargetMsgSeqNum() +} + +// SetNextSenderMsgSeqNum sets the next MsgSeqNum that will be sent +func (store *mongoStore) SetNextSenderMsgSeqNum(next int) error { + msgFilter := generateMessageFilter(&store.sessionID) + sessionUpdate := generateMessageFilter(&store.sessionID) + sessionUpdate.IncomingSeqNum = store.cache.NextTargetMsgSeqNum() + sessionUpdate.OutgoingSeqNum = next + sessionUpdate.CreationTime = store.cache.CreationTime() + err := store.db.DB(store.mongoDatabase).C("sessions").Update(msgFilter, sessionUpdate) + if err != nil { + return err + } + return store.cache.SetNextSenderMsgSeqNum(next) +} + +// SetNextTargetMsgSeqNum sets the next MsgSeqNum that should be received +func (store *mongoStore) SetNextTargetMsgSeqNum(next int) error { + msgFilter := generateMessageFilter(&store.sessionID) + sessionUpdate := generateMessageFilter(&store.sessionID) + sessionUpdate.IncomingSeqNum = next + sessionUpdate.OutgoingSeqNum = store.cache.NextSenderMsgSeqNum() + sessionUpdate.CreationTime = store.cache.CreationTime() + err := store.db.DB(store.mongoDatabase).C("sessions").Update(msgFilter, sessionUpdate) + if err != nil { + return err + } + return store.cache.SetNextTargetMsgSeqNum(next) +} + +// IncrNextSenderMsgSeqNum increments the next MsgSeqNum that will be sent +func (store *mongoStore) IncrNextSenderMsgSeqNum() error { + store.cache.IncrNextSenderMsgSeqNum() + return store.SetNextSenderMsgSeqNum(store.cache.NextSenderMsgSeqNum()) +} + +// IncrNextTargetMsgSeqNum increments the next MsgSeqNum that should be received +func (store *mongoStore) IncrNextTargetMsgSeqNum() error { + store.cache.IncrNextTargetMsgSeqNum() + return store.SetNextTargetMsgSeqNum(store.cache.NextTargetMsgSeqNum()) +} + +// CreationTime returns the creation time of the store +func (store *mongoStore) CreationTime() time.Time { + return store.cache.CreationTime() +} + +func (store *mongoStore) SaveMessage(seqNum int, msg []byte) (err error) { + msgFilter := generateMessageFilter(&store.sessionID) + msgFilter.Msgseq = seqNum + msgFilter.Message = msg + err = store.db.DB(store.mongoDatabase).C("messages").Insert(msgFilter) + return +} + +func (store *mongoStore) GetMessages(beginSeqNum, endSeqNum int) (msgs [][]byte, err error) { + msgFilter := generateMessageFilter(&store.sessionID) + //Marshal into database form + msgFilterBytes, err := bson.Marshal(msgFilter) + if err != nil { + return + } + seqFilter := bson.M{} + err = bson.Unmarshal(msgFilterBytes, &seqFilter) + if err != nil { + return + } + //Modify the query to use a range for the sequence filter + seqFilter["msgseq"] = bson.M{ + "$gte": beginSeqNum, + "$lte": endSeqNum, + } + + iter := store.db.DB(store.mongoDatabase).C("messages").Find(seqFilter).Sort("msgseq").Iter() + for iter.Next(msgFilter) { + msgs = append(msgs, msgFilter.Message) + } + return +} + +// Close closes the store's database connection +func (store *mongoStore) Close() error { + if store.db != nil { + store.db.Close() + store.db = nil + } + return nil +} From d0046616e5897da3fde41559a289ece95a9e3584 Mon Sep 17 00:00:00 2001 From: Michael Wilner Date: Tue, 30 Oct 2018 08:58:10 -0500 Subject: [PATCH 010/139] Implement tests for the Mongo backing store --- mongostore_test.go | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 mongostore_test.go diff --git a/mongostore_test.go b/mongostore_test.go new file mode 100644 index 000000000..21ca84a8d --- /dev/null +++ b/mongostore_test.go @@ -0,0 +1,52 @@ +package quickfix + +import ( + "fmt" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "log" + "os" + "strings" + "testing" +) + +// MongoStoreTestSuite runs all tests in the MessageStoreTestSuite against the MongoStore implementation +type MongoStoreTestSuite struct { + MessageStoreTestSuite +} + +func (suite *MongoStoreTestSuite) SetupTest() { + mongoDbCxn := os.Getenv("MONGODB_TEST_CXN") + if len(mongoDbCxn) <= 0 { + log.Println("MONGODB_TEST_CXN environment arg is not provided, skipping...") + suite.T().SkipNow() + } + mongoDatabase := "automated_testing_database" + + // create settings + sessionID := SessionID{BeginString: "FIX.4.4", SenderCompID: "SENDER", TargetCompID: "TARGET"} + settings, err := ParseSettings(strings.NewReader(fmt.Sprintf(` +[DEFAULT] +MongoStoreConnection=%s +MongoStoreDatabase=%s + +[SESSION] +BeginString=%s +SenderCompID=%s +TargetCompID=%s`, mongoDbCxn, mongoDatabase, sessionID.BeginString, sessionID.SenderCompID, sessionID.TargetCompID))) + require.Nil(suite.T(), err) + + // create store + suite.msgStore, err = NewMongoStoreFactory(settings).Create(sessionID) + require.Nil(suite.T(), err) + err = suite.msgStore.Reset() + require.Nil(suite.T(), err) +} + +func (suite *MongoStoreTestSuite) TearDownTest() { + suite.msgStore.Close() +} + +func TestMongoStoreTestSuite(t *testing.T) { + suite.Run(t, new(MongoStoreTestSuite)) +} From 3f787628fb199177f355ddc9a194715382def18c Mon Sep 17 00:00:00 2001 From: Michael Wilner Date: Tue, 30 Oct 2018 09:05:10 -0500 Subject: [PATCH 011/139] Add mongo testing to travis --- .travis.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index b6f063217..55955e15c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,16 +5,22 @@ go: - 1.9 - tip +services: + - mongodb + env: - - FIX_TEST= - - FIX_TEST=fix40 - - FIX_TEST=fix41 - - FIX_TEST=fix42 - - FIX_TEST=fix43 - - FIX_TEST=fix44 - - FIX_TEST=fix50 - - FIX_TEST=fix50sp1 - - FIX_TEST=fix50sp2 + global: + - MONGODB_TEST_CXN=localhost + matrix: + - FIX_TEST= + - FIX_TEST=fix40 + - FIX_TEST=fix41 + - FIX_TEST=fix42 + - FIX_TEST=fix43 + - FIX_TEST=fix44 + - FIX_TEST=fix50 + - FIX_TEST=fix50sp1 + - FIX_TEST=fix50sp2 matrix: allow_failures: From 65a6f69bd5270685a09cd985dbc373f449fc15ce Mon Sep 17 00:00:00 2001 From: Michael Wilner Date: Tue, 30 Oct 2018 09:46:35 -0500 Subject: [PATCH 012/139] Update docs for the new MongoDB config params --- config/doc.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/doc.go b/config/doc.go index 2338543f0..58af30adb 100644 --- a/config/doc.go +++ b/config/doc.go @@ -290,6 +290,14 @@ FileStorePath Directory to store sequence number and message files. Only used with FileStoreFactory. +MongoStoreConnection + +The MongoDB connection URL to use (see https://godoc.org/github.com/globalsign/mgo#Dial for the URL Format). Only used with MongoStoreFactory. + +MongoStoreDatabase + +The MongoDB-specific name of the database to use. Only used with MongoStoreFactory. + SQLStoreDriver The name of the database driver to use (see https://github.com/golang/go/wiki/SQLDrivers for the list of available drivers). Only used with SqlStoreFactory. From d42ee27ce7ec3234e516636ca03e3ae0092fe570 Mon Sep 17 00:00:00 2001 From: Michael Wilner Date: Tue, 30 Oct 2018 10:20:26 -0500 Subject: [PATCH 013/139] Enable custom prefixes for mongo storage --- mongostore.go | 57 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/mongostore.go b/mongostore.go index c22ab0af6..08656c2b5 100644 --- a/mongostore.go +++ b/mongostore.go @@ -10,20 +10,33 @@ import ( ) type mongoStoreFactory struct { - settings *Settings + settings *Settings + messagesCollection string + sessionsCollection string } type mongoStore struct { - sessionID SessionID - cache *memoryStore - mongoUrl string - mongoDatabase string - db *mgo.Session + sessionID SessionID + cache *memoryStore + mongoUrl string + mongoDatabase string + db *mgo.Session + messagesCollection string + sessionsCollection string } // NewMongoStoreFactory returns a mongo-based implementation of MessageStoreFactory func NewMongoStoreFactory(settings *Settings) MessageStoreFactory { - return mongoStoreFactory{settings: settings} + return NewMongoStoreFactoryPrefixed(settings, "") +} + +// NewMongoStoreFactoryPrefixed returns a mongo-based implementation of MessageStoreFactory, with prefix on collections +func NewMongoStoreFactoryPrefixed(settings *Settings, collectionsPrefix string) MessageStoreFactory { + return mongoStoreFactory{ + settings: settings, + messagesCollection: collectionsPrefix + "messages", + sessionsCollection: collectionsPrefix + "sessions", + } } // Create creates a new MongoStore implementation of the MessageStore interface @@ -40,15 +53,17 @@ func (f mongoStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, e if err != nil { return nil, err } - return newMongoStore(sessionID, mongoConnectionUrl, mongoDatabase) + return newMongoStore(sessionID, mongoConnectionUrl, mongoDatabase, f.messagesCollection, f.sessionsCollection) } -func newMongoStore(sessionID SessionID, mongoUrl string, mongoDatabase string) (*mongoStore, error) { +func newMongoStore(sessionID SessionID, mongoUrl string, mongoDatabase string, messagesCollection string, sessionsCollection string) (*mongoStore, error) { store := &mongoStore{ - sessionID: sessionID, - cache: &memoryStore{}, - mongoUrl: mongoUrl, - mongoDatabase: mongoDatabase, + sessionID: sessionID, + cache: &memoryStore{}, + mongoUrl: mongoUrl, + mongoDatabase: mongoDatabase, + messagesCollection: messagesCollection, + sessionsCollection: sessionsCollection, } store.cache.Reset() @@ -101,7 +116,7 @@ type MongoQuickFixEntryData struct { // Reset deletes the store records and sets the seqnums back to 1 func (store *mongoStore) Reset() error { msgFilter := generateMessageFilter(&store.sessionID) - _, err := store.db.DB(store.mongoDatabase).C("messages").RemoveAll(msgFilter) + _, err := store.db.DB(store.mongoDatabase).C(store.messagesCollection).RemoveAll(msgFilter) if err != nil { return err @@ -115,7 +130,7 @@ func (store *mongoStore) Reset() error { sessionUpdate.CreationTime = store.cache.CreationTime() sessionUpdate.IncomingSeqNum = store.cache.NextTargetMsgSeqNum() sessionUpdate.OutgoingSeqNum = store.cache.NextSenderMsgSeqNum() - err = store.db.DB(store.mongoDatabase).C("sessions").Update(msgFilter, sessionUpdate) + err = store.db.DB(store.mongoDatabase).C(store.sessionsCollection).Update(msgFilter, sessionUpdate) return err } @@ -130,7 +145,7 @@ func (store *mongoStore) Refresh() error { func (store *mongoStore) populateCache() (err error) { msgFilter := generateMessageFilter(&store.sessionID) - query := store.db.DB(store.mongoDatabase).C("sessions").Find(msgFilter) + query := store.db.DB(store.mongoDatabase).C(store.sessionsCollection).Find(msgFilter) if cnt, err := query.Count(); err == nil && cnt > 0 { // session record found, load it @@ -146,7 +161,7 @@ func (store *mongoStore) populateCache() (err error) { msgFilter.CreationTime = store.cache.creationTime msgFilter.IncomingSeqNum = store.cache.NextTargetMsgSeqNum() msgFilter.OutgoingSeqNum = store.cache.NextSenderMsgSeqNum() - err = store.db.DB(store.mongoDatabase).C("sessions").Insert(msgFilter) + err = store.db.DB(store.mongoDatabase).C(store.sessionsCollection).Insert(msgFilter) } return } @@ -168,7 +183,7 @@ func (store *mongoStore) SetNextSenderMsgSeqNum(next int) error { sessionUpdate.IncomingSeqNum = store.cache.NextTargetMsgSeqNum() sessionUpdate.OutgoingSeqNum = next sessionUpdate.CreationTime = store.cache.CreationTime() - err := store.db.DB(store.mongoDatabase).C("sessions").Update(msgFilter, sessionUpdate) + err := store.db.DB(store.mongoDatabase).C(store.sessionsCollection).Update(msgFilter, sessionUpdate) if err != nil { return err } @@ -182,7 +197,7 @@ func (store *mongoStore) SetNextTargetMsgSeqNum(next int) error { sessionUpdate.IncomingSeqNum = next sessionUpdate.OutgoingSeqNum = store.cache.NextSenderMsgSeqNum() sessionUpdate.CreationTime = store.cache.CreationTime() - err := store.db.DB(store.mongoDatabase).C("sessions").Update(msgFilter, sessionUpdate) + err := store.db.DB(store.mongoDatabase).C(store.sessionsCollection).Update(msgFilter, sessionUpdate) if err != nil { return err } @@ -210,7 +225,7 @@ func (store *mongoStore) SaveMessage(seqNum int, msg []byte) (err error) { msgFilter := generateMessageFilter(&store.sessionID) msgFilter.Msgseq = seqNum msgFilter.Message = msg - err = store.db.DB(store.mongoDatabase).C("messages").Insert(msgFilter) + err = store.db.DB(store.mongoDatabase).C(store.messagesCollection).Insert(msgFilter) return } @@ -232,7 +247,7 @@ func (store *mongoStore) GetMessages(beginSeqNum, endSeqNum int) (msgs [][]byte, "$lte": endSeqNum, } - iter := store.db.DB(store.mongoDatabase).C("messages").Find(seqFilter).Sort("msgseq").Iter() + iter := store.db.DB(store.mongoDatabase).C(store.messagesCollection).Find(seqFilter).Sort("msgseq").Iter() for iter.Next(msgFilter) { msgs = append(msgs, msgFilter.Message) } From f1db05e44a7f216e09d0cfb74325f423804de3a4 Mon Sep 17 00:00:00 2001 From: Michael Wilner Date: Tue, 30 Oct 2018 13:31:23 -0500 Subject: [PATCH 014/139] Address action items from review --- mongostore.go | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/mongostore.go b/mongostore.go index 08656c2b5..b57232c40 100644 --- a/mongostore.go +++ b/mongostore.go @@ -56,8 +56,8 @@ func (f mongoStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, e return newMongoStore(sessionID, mongoConnectionUrl, mongoDatabase, f.messagesCollection, f.sessionsCollection) } -func newMongoStore(sessionID SessionID, mongoUrl string, mongoDatabase string, messagesCollection string, sessionsCollection string) (*mongoStore, error) { - store := &mongoStore{ +func newMongoStore(sessionID SessionID, mongoUrl string, mongoDatabase string, messagesCollection string, sessionsCollection string) (store *mongoStore, err error) { + store = &mongoStore{ sessionID: sessionID, cache: &memoryStore{}, mongoUrl: mongoUrl, @@ -67,21 +67,16 @@ func newMongoStore(sessionID SessionID, mongoUrl string, mongoDatabase string, m } store.cache.Reset() - if conn, err := mgo.Dial(mongoUrl); err != nil { - return nil, err - } else { - store.db = conn - } - - if err := store.populateCache(); err != nil { - return nil, err + if store.db, err = mgo.Dial(mongoUrl); err != nil { + return } + err = store.populateCache() - return store, nil + return } -func generateMessageFilter(s *SessionID) (messageFilter *MongoQuickFixEntryData) { - messageFilter = &MongoQuickFixEntryData{ +func generateMessageFilter(s *SessionID) (messageFilter *mongoQuickFixEntryData) { + messageFilter = &mongoQuickFixEntryData{ BeginString: s.BeginString, SessionQualifier: s.Qualifier, SenderCompId: s.SenderCompID, @@ -94,7 +89,7 @@ func generateMessageFilter(s *SessionID) (messageFilter *MongoQuickFixEntryData) return } -type MongoQuickFixEntryData struct { +type mongoQuickFixEntryData struct { //Message specific data Msgseq int `bson:"msgseq,omitempty"` Message []byte `bson:"message,omitempty"` @@ -149,7 +144,7 @@ func (store *mongoStore) populateCache() (err error) { if cnt, err := query.Count(); err == nil && cnt > 0 { // session record found, load it - sessionData := &MongoQuickFixEntryData{} + sessionData := &mongoQuickFixEntryData{} err = query.One(&sessionData) if err == nil { store.cache.creationTime = sessionData.CreationTime @@ -183,8 +178,7 @@ func (store *mongoStore) SetNextSenderMsgSeqNum(next int) error { sessionUpdate.IncomingSeqNum = store.cache.NextTargetMsgSeqNum() sessionUpdate.OutgoingSeqNum = next sessionUpdate.CreationTime = store.cache.CreationTime() - err := store.db.DB(store.mongoDatabase).C(store.sessionsCollection).Update(msgFilter, sessionUpdate) - if err != nil { + if err := store.db.DB(store.mongoDatabase).C(store.sessionsCollection).Update(msgFilter, sessionUpdate); err != nil { return err } return store.cache.SetNextSenderMsgSeqNum(next) @@ -197,8 +191,7 @@ func (store *mongoStore) SetNextTargetMsgSeqNum(next int) error { sessionUpdate.IncomingSeqNum = next sessionUpdate.OutgoingSeqNum = store.cache.NextSenderMsgSeqNum() sessionUpdate.CreationTime = store.cache.CreationTime() - err := store.db.DB(store.mongoDatabase).C(store.sessionsCollection).Update(msgFilter, sessionUpdate) - if err != nil { + if err := store.db.DB(store.mongoDatabase).C(store.sessionsCollection).Update(msgFilter, sessionUpdate); err != nil { return err } return store.cache.SetNextTargetMsgSeqNum(next) From c21073d696ee8e33b1118728c1a8662bd608f2c1 Mon Sep 17 00:00:00 2001 From: Michael Wilner Date: Wed, 31 Oct 2018 13:31:58 -0500 Subject: [PATCH 015/139] Close iterator when getting messages --- mongostore.go | 1 + 1 file changed, 1 insertion(+) diff --git a/mongostore.go b/mongostore.go index b57232c40..bac1cd50a 100644 --- a/mongostore.go +++ b/mongostore.go @@ -244,6 +244,7 @@ func (store *mongoStore) GetMessages(beginSeqNum, endSeqNum int) (msgs [][]byte, for iter.Next(msgFilter) { msgs = append(msgs, msgFilter.Message) } + err = iter.Close() return } From 4ecc772314669f0ce09a4978dbbaf2a0d339daba Mon Sep 17 00:00:00 2001 From: ijufumi Date: Fri, 14 Dec 2018 12:49:01 +0900 Subject: [PATCH 016/139] Support timeout on ssl connection --- config/configuration.go | 1 + initiator.go | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/config/configuration.go b/config/configuration.go index dbc74e86c..cc4d4230a 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -21,6 +21,7 @@ const ( SocketCAFile string = "SocketCAFile" SocketInsecureSkipVerify string = "SocketInsecureSkipVerify" SocketMinimumTLSVersion string = "SocketMinimumTLSVersion" + SocketTimeout string = "SocketTimeout" DefaultApplVerID string = "DefaultApplVerID" StartTime string = "StartTime" EndTime string = "EndTime" diff --git a/initiator.go b/initiator.go index 21317d76d..ca97430c2 100644 --- a/initiator.go +++ b/initiator.go @@ -6,6 +6,8 @@ import ( "net" "sync" "time" + + "github.com/quickfixgo/quickfix/config" ) //Initiator initiates connections and processes messages for all sessions. @@ -33,9 +35,15 @@ func (i *Initiator) Start() (err error) { return } + dialTimeout := time.Duration(0) + if settings.HasSetting(config.SocketTimeout) { + if dialTimeout, err = settings.DurationSetting(config.SocketTimeout); err != nil { + return + } + } i.wg.Add(1) go func(sessID SessionID) { - i.handleConnection(i.sessions[sessID], tlsConfig) + i.handleConnection(i.sessions[sessID], tlsConfig, dialTimeout) i.wg.Done() }(sessionID) } @@ -107,7 +115,7 @@ func (i *Initiator) waitForReconnectInterval(reconnectInterval time.Duration) bo return true } -func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config) { +func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, dialTimeout time.Duration) { var wg sync.WaitGroup wg.Add(1) go func() { @@ -136,7 +144,7 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config) { var netConn net.Conn if tlsConfig != nil { - tlsConn, err := tls.Dial("tcp", address, tlsConfig) + tlsConn, err := tls.DialWithDialer(&net.Dialer{Timeout: dialTimeout}, "tcp", address, tlsConfig) if err != nil { session.log.OnEventf("Failed to connect: %v", err) goto reconnect From 98f4d6195f0d594a672bffe5c6bcefe30794e3a6 Mon Sep 17 00:00:00 2001 From: ijufumi Date: Mon, 7 Jan 2019 17:41:50 +0900 Subject: [PATCH 017/139] Add SocketTimeout to config/doc.go --- config/doc.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/doc.go b/config/doc.go index 58af30adb..041baf745 100644 --- a/config/doc.go +++ b/config/doc.go @@ -250,6 +250,16 @@ SocketConnectHost Alternate socket hosts for connecting to a session for failover, where n is a positive integer. (i.e.) SocketConnectHost1, SocketConnectHost2... must be consecutive and have a matching SocketConnectPort[n]. Value must be a valid IPv4 or IPv6 address or a domain name +SocketTimeout + +Duration of timeout for TLS handshake. Only used for initiators. + +Example Values: + SocketTimeout=30s # 30 seconds + SocketTimeout=60m # 60 minutes + +Defaults to 0(means nothing timeout). + SocketAcceptHost Socket host address for listening on incoming connections, only used for acceptors. By default acceptors listen on all available interfaces. From 12f7c2aa0b42a8b4c6741d8fc458634219b3d47e Mon Sep 17 00:00:00 2001 From: Gareth Roberts Date: Wed, 9 Jan 2019 13:58:21 +0000 Subject: [PATCH 018/139] Add SocketUseSSL parameter to allow SSL without client certs --- config/configuration.go | 1 + config/doc.go | 4 ++++ tls.go | 12 ++++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/config/configuration.go b/config/configuration.go index cc4d4230a..06ad4a2e0 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -22,6 +22,7 @@ const ( SocketInsecureSkipVerify string = "SocketInsecureSkipVerify" SocketMinimumTLSVersion string = "SocketMinimumTLSVersion" SocketTimeout string = "SocketTimeout" + SocketUseSSL string = "SocketUseSSL" DefaultApplVerID string = "DefaultApplVerID" StartTime string = "StartTime" EndTime string = "EndTime" diff --git a/config/doc.go b/config/doc.go index 041baf745..abfa7c9b5 100644 --- a/config/doc.go +++ b/config/doc.go @@ -284,6 +284,10 @@ SocketMinimumTLSVersion Specify the Minimum TLS version to use when creating a secure connection. The valid choices are SSL30, TLS10, TLS11, TLS12. Defaults to TLS12. +SocketUseSSL + +Use SSL for initiators even if client certificates are not present. If set to N or omitted, TLS will not be used if SocketPrivateKeyFile or SocketCertificateFile are not supplied. + PersistMessages If set to N, no messages will be persisted. This will force QuickFIX/Go to always send GapFills instead of resending messages. Use this if you know you never want to resend a message. Useful for market data streams. Valid Values: diff --git a/tls.go b/tls.go index 0184fc7f4..ef6846f61 100644 --- a/tls.go +++ b/tls.go @@ -10,6 +10,14 @@ import ( ) func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) { + allowSkipClientCerts := false + if settings.HasSetting(config.SocketUseSSL) { + allowSkipClientCerts, err = settings.BoolSetting(config.SocketUseSSL) + if err != nil { + return + } + } + insecureSkipVerify := false if settings.HasSetting(config.SocketInsecureSkipVerify) { insecureSkipVerify, err = settings.BoolSetting(config.SocketInsecureSkipVerify) @@ -19,9 +27,9 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) } if !settings.HasSetting(config.SocketPrivateKeyFile) && !settings.HasSetting(config.SocketCertificateFile) { - if insecureSkipVerify { + if allowSkipClientCerts { tlsConfig = defaultTLSConfig() - tlsConfig.InsecureSkipVerify = true + tlsConfig.InsecureSkipVerify = insecureSkipVerify } return } From 64d63a5ddaf5936310a601a4561bb6f68eb21b75 Mon Sep 17 00:00:00 2001 From: Ethan Feldman Date: Wed, 9 Jan 2019 15:33:11 -0500 Subject: [PATCH 019/139] Fix `Message.CopyInto()` to fully deep copy and remove the error return value #338 --- field_map.go | 13 ++++++++++++ field_map_test.go | 50 +++++++++++++++++++++++++++++++++++++++++++++++ message.go | 25 ++++-------------------- message_test.go | 21 +++++++++++++++++++- 4 files changed, 87 insertions(+), 22 deletions(-) diff --git a/field_map.go b/field_map.go index a5e08d4e6..4284fc280 100644 --- a/field_map.go +++ b/field_map.go @@ -199,6 +199,19 @@ func (m *FieldMap) Clear() { } } +//CopyInto overwrites the given FieldMap with this one +func (m *FieldMap) CopyInto(to *FieldMap) { + to.tagLookup = make(map[Tag]field) + for tag, f := range m.tagLookup { + clone := make(field, 1) + clone[0] = f[0] + to.tagLookup[tag] = clone + } + to.tags = make([]Tag, len(m.tags)) + copy(to.tags, m.tags) + to.compare = m.compare +} + func (m *FieldMap) add(f field) { t := fieldTag(f) if _, ok := m.tagLookup[t]; !ok { diff --git a/field_map_test.go b/field_map_test.go index ce6a79119..c984f7c45 100644 --- a/field_map_test.go +++ b/field_map_test.go @@ -125,3 +125,53 @@ func TestFieldMap_BoolTypedSetAndGet(t *testing.T) { assert.Nil(t, err) assert.Equal(t, "N", s) } + +func TestFieldMap_CopyInto(t *testing.T) { + var fMapA FieldMap + fMapA.initWithOrdering(headerFieldOrdering) + fMapA.SetString(9, "length") + fMapA.SetString(8, "begin") + fMapA.SetString(35, "msgtype") + fMapA.SetString(1, "a") + assert.Equal(t, []Tag{8, 9, 35, 1}, fMapA.sortedTags()) + + var fMapB FieldMap + fMapB.init() + fMapB.SetString(1, "A") + fMapB.SetString(3, "C") + fMapB.SetString(4, "D") + assert.Equal(t, fMapB.sortedTags(), []Tag{1, 3, 4}) + + fMapA.CopyInto(&fMapB) + + assert.Equal(t, []Tag{8, 9, 35, 1}, fMapB.sortedTags()) + + // new fields + s, err := fMapB.GetString(35) + assert.Nil(t, err) + assert.Equal(t, "msgtype", s) + + // existing fields overwritten + s, err = fMapB.GetString(1) + assert.Nil(t, err) + assert.Equal(t, "a", s) + + // old fields cleared + s, err = fMapB.GetString(3) + assert.NotNil(t, err) + + // check that ordering is overwritten + fMapB.SetString(2, "B") + assert.Equal(t, []Tag{8, 9, 35, 1, 2}, fMapB.sortedTags()) + + // updating the existing map doesn't affect the new + fMapA.init() + fMapA.SetString(1, "AA") + s, err = fMapB.GetString(1) + assert.Nil(t, err) + assert.Equal(t, "a", s) + fMapA.Clear() + s, err = fMapB.GetString(1) + assert.Nil(t, err) + assert.Equal(t, "a", s) +} diff --git a/message.go b/message.go index 5f200d6f6..f800cbebf 100644 --- a/message.go +++ b/message.go @@ -116,16 +116,11 @@ func NewMessage() *Message { // CopyInto erases the dest messages and copies the curreny message content // into it. -func (m *Message) CopyInto(to *Message) error { - to.Header.Clear() - to.Body.Clear() - to.Trailer.Clear() +func (m *Message) CopyInto(to *Message) { + m.Header.CopyInto(&to.Header.FieldMap) + m.Body.CopyInto(&to.Body.FieldMap) + m.Trailer.CopyInto(&to.Trailer.FieldMap) - to.Header.FieldMap = cloneFieldMap(m.Header.FieldMap) - to.Body.FieldMap = cloneFieldMap(m.Body.FieldMap) - to.Trailer.FieldMap = cloneFieldMap(m.Trailer.FieldMap) - - to.rawMessage = m.rawMessage to.ReceiveTime = m.ReceiveTime to.bodyBytes = make([]byte, len(m.bodyBytes)) copy(to.bodyBytes, m.bodyBytes) @@ -133,7 +128,6 @@ func (m *Message) CopyInto(to *Message) error { for i := range to.fields { to.fields[i].init(m.fields[i].tag, m.fields[i].value) } - return nil } //ParseMessage constructs a Message from a byte slice wrapping a FIX message. @@ -385,14 +379,3 @@ func (m *Message) cook() { checkSum := (m.Header.total() + m.Body.total() + m.Trailer.total()) % 256 m.Trailer.SetString(tagCheckSum, formatCheckSum(checkSum)) } - -func cloneFieldMap(f FieldMap) FieldMap { - res := FieldMap{} - res.tagLookup = make(map[Tag]field) - for tag, field := range f.tagLookup { - res.tagLookup[tag] = field - } - res.tags = make([]Tag, len(f.tags)) - copy(res.tags, f.tags) - return res -} diff --git a/message_test.go b/message_test.go index 3cbdb52ad..3766c9221 100644 --- a/message_test.go +++ b/message_test.go @@ -169,20 +169,39 @@ func (s *MessageSuite) TestReverseRouteFIX40() { } func (s *MessageSuite) TestCopyIntoMessage() { - s.Nil(ParseMessage(s.msg, bytes.NewBufferString("8=FIX.4.29=17135=D34=249=TW50=KK52=20060102-15:04:0556=ISLD57=AP144=BB115=JCD116=CS128=MG129=CB142=JV143=RY145=BH11=ID21=338=10040=w54=155=INTC60=20060102-15:04:0510=123"))) + msgString := "8=FIX.4.29=17135=D34=249=TW50=KK52=20060102-15:04:0556=ISLD57=AP144=BB115=JCD116=CS128=MG129=CB142=JV143=RY145=BH11=ID21=338=10040=w54=155=INTC60=20060102-15:04:0510=123" + msgBuf := bytes.NewBufferString(msgString) + s.Nil(ParseMessage(s.msg, msgBuf)) dest := NewMessage() s.msg.CopyInto(dest) + checkFieldInt(s, dest.Header.FieldMap, int(tagMsgSeqNum), 2) checkFieldInt(s, dest.Body.FieldMap, 21, 3) checkFieldString(s, dest.Body.FieldMap, 11, "ID") s.Equal(len(dest.bodyBytes), len(s.msg.bodyBytes)) + // copying decouples the message from its input buffer, so the raw message will be re-rendered + renderedString := "8=FIX.4.29=17135=D34=249=TW50=KK52=20060102-15:04:0556=ISLD57=AP115=JCD116=CS128=MG129=CB142=JV143=RY144=BB145=BH11=ID21=338=10040=w54=155=INTC60=20060102-15:04:0510=033" + s.Equal(dest.String(), renderedString) + s.True(reflect.DeepEqual(s.msg.bodyBytes, dest.bodyBytes)) s.True(s.msg.IsMsgTypeOf("D")) s.Equal(s.msg.ReceiveTime, dest.ReceiveTime) s.True(reflect.DeepEqual(s.msg.fields, dest.fields)) + + // update the source message to validate the copy is truly deep + newMsgString := "8=FIX.4.49=4935=A52=20140615-19:49:56553=my_user554=secret10=072" + s.Nil(ParseMessage(s.msg, bytes.NewBufferString(newMsgString))) + s.True(s.msg.IsMsgTypeOf("A")) + s.Equal(s.msg.String(), newMsgString) + + // clear the source buffer also + msgBuf.Reset() + + s.True(dest.IsMsgTypeOf("D")) + s.Equal(dest.String(), renderedString) } func checkFieldInt(s *MessageSuite, fields FieldMap, tag, expected int) { From 00f321c7c5bcdfa7e1a675cc1a457c753213f1f4 Mon Sep 17 00:00:00 2001 From: blutack Date: Mon, 14 Jan 2019 18:38:42 +0000 Subject: [PATCH 020/139] Update tls_test.go InsecureSkipVerify alone can no longer be use to create a secure session. Update tests to reflect that. --- tls_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tls_test.go b/tls_test.go index 322c452c5..d1f96c6d5 100644 --- a/tls_test.go +++ b/tls_test.go @@ -90,6 +90,14 @@ func (s *TLSTestSuite) TestLoadTLSWithCA() { func (s *TLSTestSuite) TestInsecureSkipVerify() { s.settings.GlobalSettings().Set(config.SocketInsecureSkipVerify, "Y") + _, err := loadTLSConfig(s.settings.GlobalSettings()) + s.NotNil(err) +} + +func (s *TLSTestSuite) TestInsecureSkipVerifyWithUseSSL() { + s.settings.GlobalSettings().Set(config.SocketUseSSL, "Y") + s.settings.GlobalSettings().Set(config.SocketInsecureSkipVerify, "Y") + tlsConfig, err := loadTLSConfig(s.settings.GlobalSettings()) s.Nil(err) s.NotNil(tlsConfig) From a5027475f0b83f49de0bb7676d3ad7759957f1c3 Mon Sep 17 00:00:00 2001 From: blutack Date: Mon, 14 Jan 2019 19:14:45 +0000 Subject: [PATCH 021/139] Update tls_test.go --- tls_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tls_test.go b/tls_test.go index d1f96c6d5..3ddbddeaf 100644 --- a/tls_test.go +++ b/tls_test.go @@ -90,8 +90,9 @@ func (s *TLSTestSuite) TestLoadTLSWithCA() { func (s *TLSTestSuite) TestInsecureSkipVerify() { s.settings.GlobalSettings().Set(config.SocketInsecureSkipVerify, "Y") - _, err := loadTLSConfig(s.settings.GlobalSettings()) - s.NotNil(err) + tlsConfig, err := loadTLSConfig(s.settings.GlobalSettings()) + s.Nil(err) + s.Nil(tlsConfig) } func (s *TLSTestSuite) TestInsecureSkipVerifyWithUseSSL() { From 4740cf36a216613ae9805bbdbdaf3b3ad3953712 Mon Sep 17 00:00:00 2001 From: chris busbey Date: Tue, 15 Jan 2019 14:06:23 -0600 Subject: [PATCH 022/139] refactoring around session reset, do not send reset for < fix41 --- logon_state.go | 2 +- session.go | 35 ++++++++++++++++++----------------- session_state.go | 2 +- session_test.go | 26 +++++++++++++++++++++++--- 4 files changed, 43 insertions(+), 22 deletions(-) diff --git a/logon_state.go b/logon_state.go index fc7fffd9e..351fa629c 100644 --- a/logon_state.go +++ b/logon_state.go @@ -27,7 +27,7 @@ func (s logonState) FixMsgIn(session *session, msg *Message) (nextState sessionS session.log.OnEvent(err.Text) logout := session.buildLogout(err.Text) - if err := session.dropAndSendInReplyTo(logout, false, msg); err != nil { + if err := session.dropAndSendInReplyTo(logout, msg); err != nil { session.logError(err) } diff --git a/session.go b/session.go index e6dde986b..010760d75 100644 --- a/session.go +++ b/session.go @@ -133,11 +133,19 @@ func (s *session) fillDefaultHeader(msg *Message, inReplyTo *Message) { } } -func (s *session) sendLogon(resetStore, setResetSeqNum bool) error { - return s.sendLogonInReplyTo(resetStore, setResetSeqNum, nil) +func (s *session) shouldSendReset() bool { + if s.sessionID.BeginString < BeginStringFIX41 { + return false + } + + return true +} + +func (s *session) sendLogon(setResetSeqNum bool) error { + return s.sendLogonInReplyTo(setResetSeqNum, nil) } -func (s *session) sendLogonInReplyTo(resetStore, setResetSeqNum bool, inReplyTo *Message) error { +func (s *session) sendLogonInReplyTo(setResetSeqNum bool, inReplyTo *Message) error { logon := NewMessage() logon.Header.SetField(tagMsgType, FIXString("A")) logon.Header.SetField(tagBeginString, FIXString(s.sessionID.BeginString)) @@ -146,7 +154,7 @@ func (s *session) sendLogonInReplyTo(resetStore, setResetSeqNum bool, inReplyTo logon.Body.SetField(tagEncryptMethod, FIXString("0")) logon.Body.SetField(tagHeartBtInt, FIXInt(s.HeartBtInt.Seconds())) - if setResetSeqNum { + if s.shouldSendReset() && setResetSeqNum { logon.Body.SetField(tagResetSeqNumFlag, FIXBoolean(true)) } @@ -154,7 +162,7 @@ func (s *session) sendLogonInReplyTo(resetStore, setResetSeqNum bool, inReplyTo logon.Body.SetField(tagDefaultApplVerID, FIXString(s.DefaultApplVerID)) } - if err := s.dropAndSendInReplyTo(logon, resetStore, inReplyTo); err != nil { + if err := s.dropAndSendInReplyTo(logon, inReplyTo); err != nil { return err } @@ -248,20 +256,14 @@ func (s *session) dropAndReset() error { return s.store.Reset() } -//dropAndSend will optionally reset the store, validate and persist the message, then drops the send queue and sends the message. -func (s *session) dropAndSend(msg *Message, resetStore bool) error { - return s.dropAndSendInReplyTo(msg, resetStore, nil) +//dropAndSend will validate and persist the message, then drops the send queue and sends the message. +func (s *session) dropAndSend(msg *Message) error { + return s.dropAndSendInReplyTo(msg, nil) } -func (s *session) dropAndSendInReplyTo(msg *Message, resetStore bool, inReplyTo *Message) error { +func (s *session) dropAndSendInReplyTo(msg *Message, inReplyTo *Message) error { s.sendMutex.Lock() defer s.sendMutex.Unlock() - if resetStore { - if err := s.store.Reset(); err != nil { - return err - } - } - msgBytes, err := s.prepMessageForSend(msg, inReplyTo) if err != nil { return err @@ -304,7 +306,6 @@ func (s *session) prepMessageForSend(msg *Message, inReplyTo *Message) (msgBytes seqNum = s.store.NextSenderMsgSeqNum() msg.Header.SetField(tagMsgSeqNum, FIXInt(seqNum)) } - } } else { if err = s.application.ToApp(msg, s.sessionID); err != nil { @@ -437,7 +438,7 @@ func (s *session) handleLogon(msg *Message) error { } s.log.OnEvent("Responding to logon request") - if err := s.sendLogonInReplyTo(resetStore, resetSeqNumFlag.Bool(), msg); err != nil { + if err := s.sendLogonInReplyTo(resetSeqNumFlag.Bool(), msg); err != nil { return err } } diff --git a/session_state.go b/session_state.go index 0d8263fe3..59b5f9e72 100644 --- a/session_state.go +++ b/session_state.go @@ -37,7 +37,7 @@ func (sm *stateMachine) Connect(session *session) { } session.log.OnEvent("Sending logon request") - if err := session.sendLogon(false, false); err != nil { + if err := session.sendLogon(false); err != nil { session.logError(err) return } diff --git a/session_test.go b/session_test.go index bd2bd18fa..1f80f9ec3 100644 --- a/session_test.go +++ b/session_test.go @@ -228,6 +228,25 @@ func (s *SessionSuite) TestCheckTargetTooLow() { s.Nil(s.session.checkTargetTooLow(msg)) } +func (s *SessionSuite) TestShouldSendReset() { + var tests = []struct { + BeginString string + Expected bool + }{ + {BeginStringFIX40, false}, //ResetSeqNumFlag not available < fix41 + {BeginStringFIX41, true}, + {BeginStringFIX42, true}, + {BeginStringFIX43, true}, + {BeginStringFIX44, true}, + {BeginStringFIXT11, true}, + } + + for _, test := range tests { + s.session.sessionID.BeginString = test.BeginString + s.Equal(s.shouldSendReset(), test.Expected) + } +} + func (s *SessionSuite) TestCheckSessionTimeNoStartTimeEndTime() { var tests = []struct { before, after sessionState @@ -851,7 +870,7 @@ func (suite *SessionSendTestSuite) TestSendDisableMessagePersist() { func (suite *SessionSendTestSuite) TestDropAndSendAdminMessage() { suite.MockApp.On("ToAdmin") - suite.Require().Nil(suite.dropAndSend(suite.Heartbeat(), false)) + suite.Require().Nil(suite.dropAndSend(suite.Heartbeat())) suite.MockApp.AssertExpectations(suite.T()) suite.MessagePersisted(suite.MockApp.lastToAdmin) @@ -868,7 +887,7 @@ func (suite *SessionSendTestSuite) TestDropAndSendDropsQueue() { suite.NoMessageSent() suite.MockApp.On("ToAdmin") - require.Nil(suite.T(), suite.dropAndSend(suite.Logon(), false)) + require.Nil(suite.T(), suite.dropAndSend(suite.Logon())) suite.MockApp.AssertExpectations(suite.T()) msg := suite.MockApp.lastToAdmin @@ -889,7 +908,8 @@ func (suite *SessionSendTestSuite) TestDropAndSendDropsQueueWithReset() { suite.NoMessageSent() suite.MockApp.On("ToAdmin") - require.Nil(suite.T(), suite.dropAndSend(suite.Logon(), true)) + suite.MockStore.Reset() + require.Nil(suite.T(), suite.dropAndSend(suite.Logon())) suite.MockApp.AssertExpectations(suite.T()) msg := suite.MockApp.lastToAdmin From 45a103184148af7058c4daa46406dd4f82838594 Mon Sep 17 00:00:00 2001 From: chris busbey Date: Tue, 15 Jan 2019 15:10:20 -0600 Subject: [PATCH 023/139] initiator sets seq reset flag when configured --- session.go | 9 +++++---- session_state.go | 2 +- session_test.go | 52 ++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/session.go b/session.go index 010760d75..556a06b9c 100644 --- a/session.go +++ b/session.go @@ -138,11 +138,12 @@ func (s *session) shouldSendReset() bool { return false } - return true + return (s.ResetOnLogon || s.ResetOnDisconnect || s.ResetOnLogout) && + s.store.NextTargetMsgSeqNum() == 1 && s.store.NextSenderMsgSeqNum() == 1 } -func (s *session) sendLogon(setResetSeqNum bool) error { - return s.sendLogonInReplyTo(setResetSeqNum, nil) +func (s *session) sendLogon() error { + return s.sendLogonInReplyTo(s.shouldSendReset(), nil) } func (s *session) sendLogonInReplyTo(setResetSeqNum bool, inReplyTo *Message) error { @@ -154,7 +155,7 @@ func (s *session) sendLogonInReplyTo(setResetSeqNum bool, inReplyTo *Message) er logon.Body.SetField(tagEncryptMethod, FIXString("0")) logon.Body.SetField(tagHeartBtInt, FIXInt(s.HeartBtInt.Seconds())) - if s.shouldSendReset() && setResetSeqNum { + if setResetSeqNum { logon.Body.SetField(tagResetSeqNumFlag, FIXBoolean(true)) } diff --git a/session_state.go b/session_state.go index 59b5f9e72..1f076f221 100644 --- a/session_state.go +++ b/session_state.go @@ -37,7 +37,7 @@ func (sm *stateMachine) Connect(session *session) { } session.log.OnEvent("Sending logon request") - if err := session.sendLogon(false); err != nil { + if err := session.sendLogon(); err != nil { session.logError(err) return } diff --git a/session_test.go b/session_test.go index 1f80f9ec3..33c7cf417 100644 --- a/session_test.go +++ b/session_test.go @@ -230,19 +230,55 @@ func (s *SessionSuite) TestCheckTargetTooLow() { func (s *SessionSuite) TestShouldSendReset() { var tests = []struct { - BeginString string - Expected bool + BeginString string + ResetOnLogon bool + ResetOnDisconnect bool + ResetOnLogout bool + NextSenderMsgSeqNum int + NextTargetMsgSeqNum int + Expected bool }{ - {BeginStringFIX40, false}, //ResetSeqNumFlag not available < fix41 - {BeginStringFIX41, true}, - {BeginStringFIX42, true}, - {BeginStringFIX43, true}, - {BeginStringFIX44, true}, - {BeginStringFIXT11, true}, + {BeginStringFIX40, true, false, false, 1, 1, false}, //ResetSeqNumFlag not available < fix41 + + {BeginStringFIX41, true, false, false, 1, 1, true}, //session must be configured to reset on logon + {BeginStringFIX42, true, false, false, 1, 1, true}, + {BeginStringFIX43, true, false, false, 1, 1, true}, + {BeginStringFIX44, true, false, false, 1, 1, true}, + {BeginStringFIXT11, true, false, false, 1, 1, true}, + + {BeginStringFIX41, false, true, false, 1, 1, true}, //or disconnect + {BeginStringFIX42, false, true, false, 1, 1, true}, + {BeginStringFIX43, false, true, false, 1, 1, true}, + {BeginStringFIX44, false, true, false, 1, 1, true}, + {BeginStringFIXT11, false, true, false, 1, 1, true}, + + {BeginStringFIX41, false, false, true, 1, 1, true}, //or logout + {BeginStringFIX42, false, false, true, 1, 1, true}, + {BeginStringFIX43, false, false, true, 1, 1, true}, + {BeginStringFIX44, false, false, true, 1, 1, true}, + {BeginStringFIXT11, false, false, true, 1, 1, true}, + + {BeginStringFIX41, true, true, false, 1, 1, true}, //or combo + {BeginStringFIX42, false, true, true, 1, 1, true}, + {BeginStringFIX43, true, false, true, 1, 1, true}, + {BeginStringFIX44, true, true, true, 1, 1, true}, + + {BeginStringFIX41, false, false, false, 1, 1, false}, //or will not be set + + {BeginStringFIX41, true, false, false, 1, 10, false}, //session seq numbers should be reset at the time of check + {BeginStringFIX42, true, false, false, 2, 1, false}, + {BeginStringFIX43, true, false, false, 14, 100, false}, } for _, test := range tests { s.session.sessionID.BeginString = test.BeginString + s.session.ResetOnLogon = test.ResetOnLogon + s.session.ResetOnDisconnect = test.ResetOnDisconnect + s.session.ResetOnLogout = test.ResetOnLogout + + s.MockStore.SetNextSenderMsgSeqNum(test.NextSenderMsgSeqNum) + s.MockStore.SetNextTargetMsgSeqNum(test.NextTargetMsgSeqNum) + s.Equal(s.shouldSendReset(), test.Expected) } } From 6f8694c6f5e84f6a2f0d47a4355ef26dc94abec5 Mon Sep 17 00:00:00 2001 From: chris busbey Date: Tue, 15 Jan 2019 15:10:37 -0600 Subject: [PATCH 024/139] linting mongostore --- mongostore.go | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/mongostore.go b/mongostore.go index bac1cd50a..76789dbe9 100644 --- a/mongostore.go +++ b/mongostore.go @@ -2,9 +2,10 @@ package quickfix import ( "fmt" + "time" + "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" - "time" "github.com/quickfixgo/quickfix/config" ) @@ -18,7 +19,7 @@ type mongoStoreFactory struct { type mongoStore struct { sessionID SessionID cache *memoryStore - mongoUrl string + mongoURL string mongoDatabase string db *mgo.Session messagesCollection string @@ -45,7 +46,7 @@ func (f mongoStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, e if !ok { return nil, fmt.Errorf("unknown session: %v", sessionID) } - mongoConnectionUrl, err := sessionSettings.Setting(config.MongoStoreConnection) + mongoConnectionURL, err := sessionSettings.Setting(config.MongoStoreConnection) if err != nil { return nil, err } @@ -53,21 +54,21 @@ func (f mongoStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, e if err != nil { return nil, err } - return newMongoStore(sessionID, mongoConnectionUrl, mongoDatabase, f.messagesCollection, f.sessionsCollection) + return newMongoStore(sessionID, mongoConnectionURL, mongoDatabase, f.messagesCollection, f.sessionsCollection) } -func newMongoStore(sessionID SessionID, mongoUrl string, mongoDatabase string, messagesCollection string, sessionsCollection string) (store *mongoStore, err error) { +func newMongoStore(sessionID SessionID, mongoURL string, mongoDatabase string, messagesCollection string, sessionsCollection string) (store *mongoStore, err error) { store = &mongoStore{ sessionID: sessionID, cache: &memoryStore{}, - mongoUrl: mongoUrl, + mongoURL: mongoURL, mongoDatabase: mongoDatabase, messagesCollection: messagesCollection, sessionsCollection: sessionsCollection, } store.cache.Reset() - if store.db, err = mgo.Dial(mongoUrl); err != nil { + if store.db, err = mgo.Dial(mongoURL); err != nil { return } err = store.populateCache() @@ -79,12 +80,12 @@ func generateMessageFilter(s *SessionID) (messageFilter *mongoQuickFixEntryData) messageFilter = &mongoQuickFixEntryData{ BeginString: s.BeginString, SessionQualifier: s.Qualifier, - SenderCompId: s.SenderCompID, - SenderSubId: s.SenderSubID, - SenderLocId: s.SenderLocationID, - TargetCompId: s.TargetCompID, - TargetSubId: s.TargetSubID, - TargetLocId: s.TargetLocationID, + SenderCompID: s.SenderCompID, + SenderSubID: s.SenderSubID, + SenderLocID: s.SenderLocationID, + TargetCompID: s.TargetCompID, + TargetSubID: s.TargetSubID, + TargetLocID: s.TargetLocationID, } return } @@ -100,12 +101,12 @@ type mongoQuickFixEntryData struct { //Indexed data BeginString string `bson:"begin_string"` SessionQualifier string `bson:"session_qualifier"` - SenderCompId string `bson:"sender_comp_id"` - SenderSubId string `bson:"sender_sub_id"` - SenderLocId string `bson:"sender_loc_id"` - TargetCompId string `bson:"target_comp_id"` - TargetSubId string `bson:"target_sub_id"` - TargetLocId string `bson:"target_loc_id"` + SenderCompID string `bson:"sender_comp_id"` + SenderSubID string `bson:"sender_sub_id"` + SenderLocID string `bson:"sender_loc_id"` + TargetCompID string `bson:"target_comp_id"` + TargetSubID string `bson:"target_sub_id"` + TargetLocID string `bson:"target_loc_id"` } // Reset deletes the store records and sets the seqnums back to 1 From d5f68d139d875e12c6abbffc3071ac13aaeccf37 Mon Sep 17 00:00:00 2001 From: vlomplusplus Date: Thu, 17 Jan 2019 15:08:42 +0200 Subject: [PATCH 025/139] Initiator stop panic if stop chan's already closed --- initiator.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/initiator.go b/initiator.go index ca97430c2..73b8c37ac 100644 --- a/initiator.go +++ b/initiator.go @@ -53,6 +53,12 @@ func (i *Initiator) Start() (err error) { //Stop Initiator. func (i *Initiator) Stop() { + select { + case <-i.stopChan: + //closed already + return + default: + } close(i.stopChan) i.wg.Wait() } From 49082f7e506f3fb2b0e4505787149d6fccdd3f11 Mon Sep 17 00:00:00 2001 From: chris busbey Date: Wed, 6 Feb 2019 15:59:16 -0600 Subject: [PATCH 026/139] fixes some confusing logging on reset flag handling --- session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session.go b/session.go index 556a06b9c..204fa99d5 100644 --- a/session.go +++ b/session.go @@ -415,8 +415,8 @@ func (s *session) handleLogon(msg *Message) error { var resetSeqNumFlag FIXBoolean if err := msg.Body.GetField(tagResetSeqNumFlag, &resetSeqNumFlag); err == nil { if resetSeqNumFlag { - s.log.OnEvent("Logon contains ResetSeqNumFlag=Y, resetting sequence numbers to 1") if !s.sentReset { + s.log.OnEvent("Logon contains ResetSeqNumFlag=Y, resetting sequence numbers to 1") resetStore = true } } From b8a9fe2d1d83c63453e12a40dac217116c1f8aa7 Mon Sep 17 00:00:00 2001 From: ferhat elmas Date: Tue, 7 May 2019 04:10:54 +0200 Subject: [PATCH 027/139] Run gofmt simplify --- cmd/generate-fix/internal/helpers.go | 2 +- repeating_group_test.go | 54 ++++++++++++++-------------- validation.go | 7 ++-- validation_test.go | 2 +- 4 files changed, 31 insertions(+), 34 deletions(-) diff --git a/cmd/generate-fix/internal/helpers.go b/cmd/generate-fix/internal/helpers.go index 7b4a96fe1..dba773d89 100644 --- a/cmd/generate-fix/internal/helpers.go +++ b/cmd/generate-fix/internal/helpers.go @@ -18,4 +18,4 @@ func getImportPathRoot() string { goSrcPath := filepath.Join(os.Getenv("GOPATH"), "src") importPathRoot := filepath.ToSlash(strings.Replace(pwd, goSrcPath, "", 1)) return strings.TrimLeft(importPathRoot, "/") -} \ No newline at end of file +} diff --git a/repeating_group_test.go b/repeating_group_test.go index d43d38d79..448e39d6a 100644 --- a/repeating_group_test.go +++ b/repeating_group_test.go @@ -97,16 +97,16 @@ func TestRepeatingGroup_ReadError(t *testing.T) { }{ { []TagValue{ - TagValue{value: []byte("1")}, - TagValue{tag: Tag(2), value: []byte("not in template")}, - TagValue{tag: Tag(1), value: []byte("hello")}, + {value: []byte("1")}, + {tag: Tag(2), value: []byte("not in template")}, + {tag: Tag(1), value: []byte("hello")}, }, 0}, { []TagValue{ - TagValue{value: []byte("2")}, - TagValue{tag: Tag(1), value: []byte("hello")}, - TagValue{tag: Tag(2), value: []byte("not in template")}, - TagValue{tag: Tag(1), value: []byte("hello")}, + {value: []byte("2")}, + {tag: Tag(1), value: []byte("hello")}, + {tag: Tag(2), value: []byte("not in template")}, + {tag: Tag(1), value: []byte("hello")}, }, 1}} for _, s := range tests { @@ -128,29 +128,29 @@ func TestRepeatingGroup_Read(t *testing.T) { tv []TagValue expectedGroupTvs [][]TagValue }{ - {singleFieldTemplate, []TagValue{TagValue{value: []byte("0")}}, + {singleFieldTemplate, []TagValue{{value: []byte("0")}}, [][]TagValue{}}, - {singleFieldTemplate, []TagValue{TagValue{value: []byte("1")}, TagValue{tag: Tag(1), value: []byte("hello")}}, + {singleFieldTemplate, []TagValue{{value: []byte("1")}, {tag: Tag(1), value: []byte("hello")}}, [][]TagValue{{TagValue{tag: Tag(1), value: []byte("hello")}}}}, {singleFieldTemplate, - []TagValue{TagValue{value: []byte("1")}, - TagValue{tag: Tag(1), value: []byte("hello")}, - TagValue{tag: Tag(2), value: []byte("not in group")}}, + []TagValue{{value: []byte("1")}, + {tag: Tag(1), value: []byte("hello")}, + {tag: Tag(2), value: []byte("not in group")}}, [][]TagValue{ {TagValue{tag: Tag(1), value: []byte("hello")}}}}, {singleFieldTemplate, - []TagValue{TagValue{value: []byte("2")}, - TagValue{tag: Tag(1), value: []byte("hello")}, - TagValue{tag: Tag(1), value: []byte("world")}}, + []TagValue{{value: []byte("2")}, + {tag: Tag(1), value: []byte("hello")}, + {tag: Tag(1), value: []byte("world")}}, [][]TagValue{ {TagValue{tag: Tag(1), value: []byte("hello")}}, {TagValue{tag: Tag(1), value: []byte("world")}}, }}, {multiFieldTemplate, []TagValue{ - TagValue{value: []byte("2")}, - TagValue{tag: Tag(1), value: []byte("hello")}, - TagValue{tag: Tag(1), value: []byte("goodbye")}, TagValue{tag: Tag(2), value: []byte("cruel")}, TagValue{tag: Tag(3), value: []byte("world")}, + {value: []byte("2")}, + {tag: Tag(1), value: []byte("hello")}, + {tag: Tag(1), value: []byte("goodbye")}, {tag: Tag(2), value: []byte("cruel")}, {tag: Tag(3), value: []byte("world")}, }, [][]TagValue{ {TagValue{tag: Tag(1), value: []byte("hello")}}, @@ -158,10 +158,10 @@ func TestRepeatingGroup_Read(t *testing.T) { }}, {multiFieldTemplate, []TagValue{ - TagValue{value: []byte("3")}, - TagValue{tag: Tag(1), value: []byte("hello")}, - TagValue{tag: Tag(1), value: []byte("goodbye")}, TagValue{tag: Tag(2), value: []byte("cruel")}, TagValue{tag: Tag(3), value: []byte("world")}, - TagValue{tag: Tag(1), value: []byte("another")}, + {value: []byte("3")}, + {tag: Tag(1), value: []byte("hello")}, + {tag: Tag(1), value: []byte("goodbye")}, {tag: Tag(2), value: []byte("cruel")}, {tag: Tag(3), value: []byte("world")}, + {tag: Tag(1), value: []byte("another")}, }, [][]TagValue{ {TagValue{tag: Tag(1), value: []byte("hello")}}, @@ -200,11 +200,11 @@ func TestRepeatingGroup_ReadRecursive(t *testing.T) { f := NewRepeatingGroup(Tag(1), parentTemplate) _, err := f.Read([]TagValue{ - TagValue{value: []byte("2")}, - TagValue{tag: Tag(2), value: []byte("hello")}, - TagValue{tag: 3, value: []byte("1")}, TagValue{tag: 4, value: []byte("foo")}, - TagValue{tag: Tag(2), value: []byte("world")}, - TagValue{tag: 3, value: []byte("2")}, TagValue{tag: 4, value: []byte("foo")}, TagValue{tag: 4, value: []byte("bar")}, TagValue{tag: 5, value: []byte("fubar")}, + {value: []byte("2")}, + {tag: Tag(2), value: []byte("hello")}, + {tag: 3, value: []byte("1")}, {tag: 4, value: []byte("foo")}, + {tag: Tag(2), value: []byte("world")}, + {tag: 3, value: []byte("2")}, {tag: 4, value: []byte("foo")}, {tag: 4, value: []byte("bar")}, {tag: 5, value: []byte("fubar")}, }) require.Nil(t, err) diff --git a/validation.go b/validation.go index 6e28b8cd0..dc17abc58 100644 --- a/validation.go +++ b/validation.go @@ -10,15 +10,14 @@ type validator interface { type validatorSettings struct { CheckFieldsOutOfOrder bool - RejectInvalidMessage bool - + RejectInvalidMessage bool } //Default configuration for message validation. //See http://www.quickfixengine.org/quickfix/doc/html/configuration.html. var defaultValidatorSettings = validatorSettings{ CheckFieldsOutOfOrder: true, - RejectInvalidMessage: true, + RejectInvalidMessage: true, } type fixValidator struct { @@ -87,8 +86,6 @@ func validateFIX(d *datadictionary.DataDictionary, settings validatorSettings, m } } - - return nil } diff --git a/validation_test.go b/validation_test.go index 7e5a7a3bc..10a8a7e3f 100644 --- a/validation_test.go +++ b/validation_test.go @@ -413,7 +413,7 @@ func tcInvalidTagCheckEnabled() validateTest { Validator: validator, MessageBytes: msgBytes, DoNotExpectReject: false, - ExpectedRefTagID: &tag, + ExpectedRefTagID: &tag, } } From d28f192b6af942b0d85bf3c1c357f433f3087c9e Mon Sep 17 00:00:00 2001 From: Michael Wilner Date: Wed, 17 Jul 2019 12:04:21 -0500 Subject: [PATCH 028/139] Common dialer used in initiator --- initiator.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/initiator.go b/initiator.go index 73b8c37ac..f63e9158b 100644 --- a/initiator.go +++ b/initiator.go @@ -35,15 +35,16 @@ func (i *Initiator) Start() (err error) { return } - dialTimeout := time.Duration(0) + dialer := &net.Dialer{} if settings.HasSetting(config.SocketTimeout) { - if dialTimeout, err = settings.DurationSetting(config.SocketTimeout); err != nil { + if dialer.Timeout, err = settings.DurationSetting(config.SocketTimeout); err != nil { return } } + i.wg.Add(1) go func(sessID SessionID) { - i.handleConnection(i.sessions[sessID], tlsConfig, dialTimeout) + i.handleConnection(i.sessions[sessID], tlsConfig, dialer) i.wg.Done() }(sessionID) } @@ -121,7 +122,7 @@ func (i *Initiator) waitForReconnectInterval(reconnectInterval time.Duration) bo return true } -func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, dialTimeout time.Duration) { +func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, dialer *net.Dialer) { var wg sync.WaitGroup wg.Add(1) go func() { @@ -150,7 +151,7 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, di var netConn net.Conn if tlsConfig != nil { - tlsConn, err := tls.DialWithDialer(&net.Dialer{Timeout: dialTimeout}, "tcp", address, tlsConfig) + tlsConn, err := tls.DialWithDialer(dialer, "tcp", address, tlsConfig) if err != nil { session.log.OnEventf("Failed to connect: %v", err) goto reconnect @@ -164,7 +165,7 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, di netConn = tlsConn } else { var err error - netConn, err = net.Dial("tcp", address) + netConn, err = dialer.Dial("tcp", address) if err != nil { session.log.OnEventf("Failed to connect: %v", err) goto reconnect From 7b45745d6c73dc9a21df07729856a6c11a8994b0 Mon Sep 17 00:00:00 2001 From: Michael Wilner Date: Wed, 17 Jul 2019 13:10:15 -0500 Subject: [PATCH 029/139] Dial through proxy interface --- Gopkg.lock | 6 ++++- config/configuration.go | 5 ++++ config/doc.go | 21 ++++++++++++++++ dialer.go | 56 +++++++++++++++++++++++++++++++++++++++++ initiator.go | 40 ++++++++++------------------- 5 files changed, 100 insertions(+), 28 deletions(-) create mode 100644 dialer.go diff --git a/Gopkg.lock b/Gopkg.lock index 4d6e80a80..1504285e2 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -72,7 +72,10 @@ branch = "master" digest = "1:898bc7c802c1e0c20cecd65811e90b7b9bc5651b4a07aefd159451bfb200b2b3" name = "golang.org/x/net" - packages = ["context"] + packages = [ + "context", + "proxy", + ] pruneopts = "" revision = "a04bdaca5b32abe1c069418fb7088ae607de5bd0" @@ -88,6 +91,7 @@ "github.com/stretchr/testify/mock", "github.com/stretchr/testify/require", "github.com/stretchr/testify/suite", + "golang.org/x/net/proxy", ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/config/configuration.go b/config/configuration.go index 06ad4a2e0..715387c3d 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -23,6 +23,11 @@ const ( SocketMinimumTLSVersion string = "SocketMinimumTLSVersion" SocketTimeout string = "SocketTimeout" SocketUseSSL string = "SocketUseSSL" + ProxyType string = "ProxyType" + ProxyHost string = "ProxyHost" + ProxyPort string = "ProxyPort" + ProxyUser string = "ProxyUser" + ProxyPassword string = "ProxyPassword" DefaultApplVerID string = "DefaultApplVerID" StartTime string = "StartTime" EndTime string = "EndTime" diff --git a/config/doc.go b/config/doc.go index abfa7c9b5..d02491c16 100644 --- a/config/doc.go +++ b/config/doc.go @@ -288,6 +288,27 @@ SocketUseSSL Use SSL for initiators even if client certificates are not present. If set to N or omitted, TLS will not be used if SocketPrivateKeyFile or SocketCertificateFile are not supplied. +ProxyType + +Proxy type. Valid Values: + socks + +ProxyHost + +Proxy server IP address in the format of x.x.x.x or a domain name + +ProxyPort + +Proxy server port + +ProxyUser + +Proxy user + +ProxyPassword + +Proxy password + PersistMessages If set to N, no messages will be persisted. This will force QuickFIX/Go to always send GapFills instead of resending messages. Use this if you know you never want to resend a message. Useful for market data streams. Valid Values: diff --git a/dialer.go b/dialer.go new file mode 100644 index 000000000..3d29d9c17 --- /dev/null +++ b/dialer.go @@ -0,0 +1,56 @@ +package quickfix + +import ( + "fmt" + "github.com/quickfixgo/quickfix/config" + "golang.org/x/net/proxy" + "net" +) + +func loadDialerConfig(settings *SessionSettings) (dialer proxy.Dialer, err error) { + stdDialer := &net.Dialer{} + if settings.HasSetting(config.SocketTimeout) { + if stdDialer.Timeout, err = settings.DurationSetting(config.SocketTimeout); err != nil { + return + } + } + dialer = stdDialer + + if !settings.HasSetting(config.ProxyType) { + return + } + + var proxyType string + if proxyType, err = settings.Setting(config.ProxyType); err != nil { + return + } + + switch proxyType { + case "socks": + var proxyHost string + var proxyPort int + if proxyHost, err = settings.Setting(config.ProxyHost); err != nil { + return + } else if proxyPort, err = settings.IntSetting(config.ProxyPort); err != nil { + return + } + + proxyAuth := new(proxy.Auth) + if settings.HasSetting(config.ProxyUser) { + if proxyAuth.User, err = settings.Setting(config.ProxyUser); err != nil { + return + } + } + if settings.HasSetting(config.ProxyPassword) { + if proxyAuth.Password, err = settings.Setting(config.ProxyPassword); err != nil { + return + } + } + + dialer, err = proxy.SOCKS5("tcp", fmt.Sprintf("%s:%d", proxyHost, proxyPort), proxyAuth, dialer) + return + default: + err = fmt.Errorf("unsupported proxy type %s", proxyType) + } + return +} diff --git a/initiator.go b/initiator.go index f63e9158b..2ce02ace5 100644 --- a/initiator.go +++ b/initiator.go @@ -3,11 +3,9 @@ package quickfix import ( "bufio" "crypto/tls" - "net" + "golang.org/x/net/proxy" "sync" "time" - - "github.com/quickfixgo/quickfix/config" ) //Initiator initiates connections and processes messages for all sessions. @@ -35,11 +33,9 @@ func (i *Initiator) Start() (err error) { return } - dialer := &net.Dialer{} - if settings.HasSetting(config.SocketTimeout) { - if dialer.Timeout, err = settings.DurationSetting(config.SocketTimeout); err != nil { - return - } + var dialer proxy.Dialer + if dialer, err = loadDialerConfig(settings); err != nil { + return } i.wg.Add(1) @@ -122,7 +118,7 @@ func (i *Initiator) waitForReconnectInterval(reconnectInterval time.Duration) bo return true } -func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, dialer *net.Dialer) { +func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, dialer proxy.Dialer) { var wg sync.WaitGroup wg.Add(1) go func() { @@ -149,27 +145,17 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, di address := session.SocketConnectAddress[connectionAttempt%len(session.SocketConnectAddress)] session.log.OnEventf("Connecting to: %v", address) - var netConn net.Conn - if tlsConfig != nil { - tlsConn, err := tls.DialWithDialer(dialer, "tcp", address, tlsConfig) - if err != nil { - session.log.OnEventf("Failed to connect: %v", err) - goto reconnect - } - - err = tlsConn.Handshake() - if err != nil { - session.log.OnEventf("Failed handshake:%v", err) + netConn, err := dialer.Dial("tcp", address) + if err != nil { + session.log.OnEventf("Failed to connect: %v", err) + goto reconnect + } else if tlsConfig != nil { + tlsConn := tls.Client(netConn, tlsConfig) + if err = tlsConn.Handshake(); err != nil { + session.log.OnEventf("Failed handshake: %v", err) goto reconnect } netConn = tlsConn - } else { - var err error - netConn, err = dialer.Dial("tcp", address) - if err != nil { - session.log.OnEventf("Failed to connect: %v", err) - goto reconnect - } } msgIn = make(chan fixIn) From 9c1b3c64a7f92f31f33b7ca71aa9baaf09db5f14 Mon Sep 17 00:00:00 2001 From: Michael Wilner Date: Wed, 17 Jul 2019 13:10:31 -0500 Subject: [PATCH 030/139] Test coverage for dialer --- dialer_test.go | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 dialer_test.go diff --git a/dialer_test.go b/dialer_test.go new file mode 100644 index 000000000..5e06b82cc --- /dev/null +++ b/dialer_test.go @@ -0,0 +1,75 @@ +package quickfix + +import ( + "github.com/quickfixgo/quickfix/config" + "github.com/stretchr/testify/suite" + "net" + "testing" + "time" +) + +type DialerTestSuite struct { + suite.Suite + settings *Settings +} + +func TestDialerTestSuite(t *testing.T) { + suite.Run(t, new(DialerTestSuite)) +} + +func (s *DialerTestSuite) SetupTest() { + s.settings = NewSettings() +} + +func (s *DialerTestSuite) TestLoadDialerNoSettings() { + dialer, err := loadDialerConfig(s.settings.GlobalSettings()) + s.Require().Nil(err) + + stdDialer, ok := dialer.(*net.Dialer) + s.Require().True(ok) + s.Require().NotNil(stdDialer) + s.Zero(stdDialer.Timeout) +} + +func (s *DialerTestSuite) TestLoadDialerWithTimeout() { + s.settings.GlobalSettings().Set(config.SocketTimeout, "10s") + dialer, err := loadDialerConfig(s.settings.GlobalSettings()) + s.Require().Nil(err) + + stdDialer, ok := dialer.(*net.Dialer) + s.Require().True(ok) + s.Require().NotNil(stdDialer) + s.EqualValues(10*time.Second, stdDialer.Timeout) +} + +func (s *DialerTestSuite) TestLoadDialerInvalidProxy() { + s.settings.GlobalSettings().Set(config.ProxyType, "totallyinvalidproxytype") + _, err := loadDialerConfig(s.settings.GlobalSettings()) + s.Require().NotNil(err) +} + +func (s *DialerTestSuite) TestLoadDialerSocksProxy() { + s.settings.GlobalSettings().Set(config.ProxyType, "socks") + s.settings.GlobalSettings().Set(config.ProxyHost, "localhost") + s.settings.GlobalSettings().Set(config.ProxyPort, "31337") + dialer, err := loadDialerConfig(s.settings.GlobalSettings()) + s.Require().Nil(err) + s.Require().NotNil(dialer) + + _, ok := dialer.(*net.Dialer) + s.Require().False(ok) +} + +func (s *DialerTestSuite) TestLoadDialerSocksProxyInvalidHost() { + s.settings.GlobalSettings().Set(config.ProxyType, "socks") + s.settings.GlobalSettings().Set(config.ProxyPort, "31337") + _, err := loadDialerConfig(s.settings.GlobalSettings()) + s.Require().NotNil(err) +} + +func (s *DialerTestSuite) TestLoadDialerSocksProxyInvalidPort() { + s.settings.GlobalSettings().Set(config.ProxyType, "socks") + s.settings.GlobalSettings().Set(config.ProxyHost, "localhost") + _, err := loadDialerConfig(s.settings.GlobalSettings()) + s.Require().NotNil(err) +} From f3a3283bc2f9f453c1ff5b1ac58ffa2d25d4eded Mon Sep 17 00:00:00 2001 From: Michael Wilner Date: Wed, 17 Jul 2019 13:15:33 -0500 Subject: [PATCH 031/139] Remove extraneous return --- dialer.go | 1 - 1 file changed, 1 deletion(-) diff --git a/dialer.go b/dialer.go index 3d29d9c17..610fc1aeb 100644 --- a/dialer.go +++ b/dialer.go @@ -48,7 +48,6 @@ func loadDialerConfig(settings *SessionSettings) (dialer proxy.Dialer, err error } dialer, err = proxy.SOCKS5("tcp", fmt.Sprintf("%s:%d", proxyHost, proxyPort), proxyAuth, dialer) - return default: err = fmt.Errorf("unsupported proxy type %s", proxyType) } From fdd3c8e850708be94b8c6e4b4edab6448815062c Mon Sep 17 00:00:00 2001 From: Alexander Baryshnikov Date: Wed, 25 Sep 2019 19:17:48 +0800 Subject: [PATCH 032/139] add dynamic sessions --- acceptor.go | 82 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 72 insertions(+), 10 deletions(-) diff --git a/acceptor.go b/acceptor.go index c9138355f..3a27f8f25 100644 --- a/acceptor.go +++ b/acceptor.go @@ -15,15 +15,17 @@ import ( //Acceptor accepts connections from FIX clients and manages the associated sessions. type Acceptor struct { - app Application - settings *Settings - logFactory LogFactory - storeFactory MessageStoreFactory - globalLog Log - sessions map[SessionID]*session - sessionGroup sync.WaitGroup - listener net.Listener - listenerShutdown sync.WaitGroup + app Application + settings *Settings + logFactory LogFactory + storeFactory MessageStoreFactory + globalLog Log + sessions map[SessionID]*session + sessionGroup sync.WaitGroup + listener net.Listener + listenerShutdown sync.WaitGroup + dynamicSessions bool + dynamicSessionChan chan *session sessionFactory } @@ -66,7 +68,14 @@ func (a *Acceptor) Start() error { a.sessionGroup.Done() }() } - + if a.dynamicSessions { + a.dynamicSessionChan = make(chan *session) + a.sessionGroup.Add(1) + go func() { + a.dynamicSessionsLoop() + a.sessionGroup.Done() + }() + } a.listenerShutdown.Add(1) go a.listenForConnections() return nil @@ -223,6 +232,15 @@ func (a *Acceptor) handleConnection(netConn net.Conn) { session, ok := a.sessions[sessID] if !ok { a.globalLog.OnEventf("Session %v not found for incoming message: %s", sessID, msgBytes) + if !a.dynamicSessions { + return + } + dynamicSession, err := a.sessionFactory.createSession(sessID, a.storeFactory, a.settings.globalSettings.clone(), a.logFactory, a.app) + if err != nil { + a.globalLog.OnEventf("Dynamic session %v failed to create: %v", sessID, err) + return + } + a.dynamicSessionChan <- dynamicSession return } @@ -241,3 +259,47 @@ func (a *Acceptor) handleConnection(netConn net.Conn) { writeLoop(netConn, msgOut, a.globalLog) } + +func (a *Acceptor) dynamicSessionsLoop() { + var id int + var sessions = map[int]*session{} + var complete = make(chan int) + defer close(complete) +LOOP: + for { + select { + case session, ok := <-a.dynamicSessionChan: + if !ok { + for _, oldSession := range sessions { + oldSession.stop() + } + break LOOP + } + id += 1 + sessionId := id + sessions[sessionId] = session + go func() { + session.run() + err := UnregisterSession(session.sessionID) + if err != nil { + a.globalLog.OnEventf("Unregister dynamic session %v failed: %v", session.sessionID, err) + return + } + complete <- sessionId + }() + case id := <-complete: + delete(sessions, id) + } + } + + if len(sessions) == 0 { + return + } + + for id := range complete { + delete(sessions, id) + if len(sessions) == 0 { + return + } + } +} From 210460ee616591dcb992f832f22e46e64e663b04 Mon Sep 17 00:00:00 2001 From: Alexander Baryshnikov Date: Wed, 25 Sep 2019 19:30:20 +0800 Subject: [PATCH 033/139] add dynamic sessions --- acceptor.go | 20 ++++++++++++++------ config/configuration.go | 1 + 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/acceptor.go b/acceptor.go index 3a27f8f25..e988b6a45 100644 --- a/acceptor.go +++ b/acceptor.go @@ -89,6 +89,9 @@ func (a *Acceptor) Stop() { a.listener.Close() a.listenerShutdown.Wait() + if a.dynamicSessions { + close(a.dynamicSessionChan) + } for _, session := range a.sessions { session.stop() } @@ -104,6 +107,11 @@ func NewAcceptor(app Application, storeFactory MessageStoreFactory, settings *Se logFactory: logFactory, sessions: make(map[SessionID]*session), } + if a.settings.GlobalSettings().HasSetting(config.DynamicSessions) { + if a.dynamicSessions, err = settings.globalSettings.BoolSetting(config.DynamicSessions); err != nil { + return + } + } if a.globalLog, err = logFactory.Create(); err != nil { return @@ -231,8 +239,8 @@ func (a *Acceptor) handleConnection(netConn net.Conn) { } session, ok := a.sessions[sessID] if !ok { - a.globalLog.OnEventf("Session %v not found for incoming message: %s", sessID, msgBytes) if !a.dynamicSessions { + a.globalLog.OnEventf("Session %v not found for incoming message: %s", sessID, msgBytes) return } dynamicSession, err := a.sessionFactory.createSession(sessID, a.storeFactory, a.settings.globalSettings.clone(), a.logFactory, a.app) @@ -241,7 +249,7 @@ func (a *Acceptor) handleConnection(netConn net.Conn) { return } a.dynamicSessionChan <- dynamicSession - return + session = dynamicSession } msgIn := make(chan fixIn) @@ -275,9 +283,9 @@ LOOP: } break LOOP } - id += 1 - sessionId := id - sessions[sessionId] = session + id++ + sessionID := id + sessions[sessionID] = session go func() { session.run() err := UnregisterSession(session.sessionID) @@ -285,7 +293,7 @@ LOOP: a.globalLog.OnEventf("Unregister dynamic session %v failed: %v", session.sessionID, err) return } - complete <- sessionId + complete <- sessionID }() case id := <-complete: delete(sessions, id) diff --git a/config/configuration.go b/config/configuration.go index 715387c3d..afa442a33 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -58,4 +58,5 @@ const ( MaxLatency string = "MaxLatency" PersistMessages string = "PersistMessages" RejectInvalidMessage string = "RejectInvalidMessage" + DynamicSessions string = "DynamicSessions" ) From 1816e626a6cbe362c25dd8a42f1f12be82efb7f1 Mon Sep 17 00:00:00 2001 From: Alexander Baryshnikov Date: Wed, 25 Sep 2019 21:09:23 +0800 Subject: [PATCH 034/139] stop dynamic session correctly --- acceptor.go | 1 + 1 file changed, 1 insertion(+) diff --git a/acceptor.go b/acceptor.go index e988b6a45..1fd1be6f8 100644 --- a/acceptor.go +++ b/acceptor.go @@ -250,6 +250,7 @@ func (a *Acceptor) handleConnection(netConn net.Conn) { } a.dynamicSessionChan <- dynamicSession session = dynamicSession + defer session.stop() } msgIn := make(chan fixIn) From 2307e12dfbabe5df0bdf2ce96b2d97198474a0de Mon Sep 17 00:00:00 2001 From: ackleymi Date: Sun, 29 Sep 2019 19:05:40 -0400 Subject: [PATCH 035/139] Upgrades Go versions and migrates to modules. --- .travis.yml | 24 +++++++--- Gopkg.lock | 97 ---------------------------------------- Gopkg.toml | 34 -------------- dialer.go | 3 +- dialer_test.go | 5 ++- go.mod | 12 +++++ go.sum | 28 ++++++++++++ initiator.go | 3 +- mongostore_test.go | 5 ++- session_settings_test.go | 3 +- 10 files changed, 69 insertions(+), 145 deletions(-) delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml create mode 100644 go.mod create mode 100644 go.sum diff --git a/.travis.yml b/.travis.yml index 55955e15c..5849b2f95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,18 @@ language: go sudo: false -go: - - 1.9 - - tip - services: - mongodb +go: + - 1.11.x + - 1.12.x + - 1.13 + - tip + env: global: + - GO111MODULE=on - MONGODB_TEST_CXN=localhost matrix: - FIX_TEST= @@ -25,9 +28,16 @@ env: matrix: allow_failures: - go: tip + fast_finish: true + exclude: + - go: 1.13.x + env: GO111MODULE=on + - go: tip + env: GO111MODULE=on -install: - - go get -u github.com/golang/dep/cmd/dep - - dep ensure +before_install: + - if [[ "${GO111MODULE}" = "on" ]]; then mkdir "${HOME}/go"; export GOPATH="${HOME}/go"; fi + - if [[ "${GO111MODULE}" = "on" ]]; then export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"; fi + - go mod download script: make generate; if [ -z "$FIX_TEST" ]; then make build; make; else make build_accept; make $FIX_TEST; fi diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 1504285e2..000000000 --- a/Gopkg.lock +++ /dev/null @@ -1,97 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:56c130d885a4aacae1dd9c7b71cfe39912c7ebc1ff7d2b46083c8812996dc43b" - name = "github.com/davecgh/go-spew" - packages = ["spew"] - pruneopts = "" - revision = "346938d642f2ec3594ed81d874461961cd0faa76" - version = "v1.1.0" - -[[projects]] - branch = "master" - digest = "1:e9ffb9315dce0051beb757d0f0fc25db57c4da654efc4eada4ea109c2d9da815" - name = "github.com/globalsign/mgo" - packages = [ - ".", - "bson", - "internal/json", - "internal/sasl", - "internal/scram", - ] - pruneopts = "" - revision = "eeefdecb41b842af6dc652aaea4026e8403e62df" - -[[projects]] - digest = "1:1cc12f4618ce8d71ca28ef3708f4e98e1318ab6f06ecfffb6781b893f271c89c" - name = "github.com/mattn/go-sqlite3" - packages = ["."] - pruneopts = "" - revision = "ca5e3819723d8eeaf170ad510e7da1d6d2e94a08" - version = "v1.2.0" - -[[projects]] - digest = "1:256484dbbcd271f9ecebc6795b2df8cad4c458dd0f5fd82a8c2fa0c29f233411" - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - pruneopts = "" - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - branch = "master" - digest = "1:68a81aa25065b50a4bf1ffd115ff3634704f61f675d0140b31492e9fcca55421" - name = "github.com/shopspring/decimal" - packages = ["."] - pruneopts = "" - revision = "aed1bfe463fa3c9cc268d60dcc1491db613bff7e" - -[[projects]] - branch = "master" - digest = "1:ed7ac53c7d59041f27964d3f04e021b45ecb5f23c842c84d778a7f1fb67e2ce9" - name = "github.com/stretchr/objx" - packages = ["."] - pruneopts = "" - revision = "1a9d0bb9f541897e62256577b352fdbc1fb4fd94" - -[[projects]] - digest = "1:3926a4ec9a4ff1a072458451aa2d9b98acd059a45b38f7335d31e06c3d6a0159" - name = "github.com/stretchr/testify" - packages = [ - "assert", - "mock", - "require", - "suite", - ] - pruneopts = "" - revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" - version = "v1.1.4" - -[[projects]] - branch = "master" - digest = "1:898bc7c802c1e0c20cecd65811e90b7b9bc5651b4a07aefd159451bfb200b2b3" - name = "golang.org/x/net" - packages = [ - "context", - "proxy", - ] - pruneopts = "" - revision = "a04bdaca5b32abe1c069418fb7088ae607de5bd0" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/globalsign/mgo", - "github.com/globalsign/mgo/bson", - "github.com/mattn/go-sqlite3", - "github.com/shopspring/decimal", - "github.com/stretchr/testify/assert", - "github.com/stretchr/testify/mock", - "github.com/stretchr/testify/require", - "github.com/stretchr/testify/suite", - "golang.org/x/net/proxy", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 3385a5e25..000000000 --- a/Gopkg.toml +++ /dev/null @@ -1,34 +0,0 @@ - -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - - -[[constraint]] - name = "github.com/mattn/go-sqlite3" - version = "1.2.0" - -[[constraint]] - name = "github.com/shopspring/decimal" - branch = "master" - -[[constraint]] - name = "github.com/stretchr/testify" - version = "1.1.4" diff --git a/dialer.go b/dialer.go index 610fc1aeb..1645076bf 100644 --- a/dialer.go +++ b/dialer.go @@ -2,9 +2,10 @@ package quickfix import ( "fmt" + "net" + "github.com/quickfixgo/quickfix/config" "golang.org/x/net/proxy" - "net" ) func loadDialerConfig(settings *SessionSettings) (dialer proxy.Dialer, err error) { diff --git a/dialer_test.go b/dialer_test.go index 5e06b82cc..510c18f04 100644 --- a/dialer_test.go +++ b/dialer_test.go @@ -1,11 +1,12 @@ package quickfix import ( - "github.com/quickfixgo/quickfix/config" - "github.com/stretchr/testify/suite" "net" "testing" "time" + + "github.com/quickfixgo/quickfix/config" + "github.com/stretchr/testify/suite" ) type DialerTestSuite struct { diff --git a/go.mod b/go.mod new file mode 100644 index 000000000..35dc6871d --- /dev/null +++ b/go.mod @@ -0,0 +1,12 @@ +module github.com/quickfixgo/quickfix + +go 1.13 + +require ( + github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 + github.com/mattn/go-sqlite3 v1.11.0 + github.com/shopspring/decimal v0.0.0-20190905144223-a36b5d85f337 + github.com/stretchr/testify v1.4.0 + golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 + golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..cfd41efd9 --- /dev/null +++ b/go.sum @@ -0,0 +1,28 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= +github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/shopspring/decimal v0.0.0-20190905144223-a36b5d85f337 h1:Da9XEUfFxgyDOqUfwgoTDcWzmnlOnCGi6i4iPS+8Fbw= +github.com/shopspring/decimal v0.0.0-20190905144223-a36b5d85f337/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 h1:qPnAdmjNA41t3QBTx2mFGf/SD1IoslhYu7AmdsVzCcs= +golang.org/x/net v0.0.0-20190926025831-c00fd9afed17/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e h1:1xWUkZQQ9Z9UuZgNaIR6OQOE7rUFglXUUBZlO+dGg6I= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/initiator.go b/initiator.go index 2ce02ace5..c84ced741 100644 --- a/initiator.go +++ b/initiator.go @@ -3,9 +3,10 @@ package quickfix import ( "bufio" "crypto/tls" - "golang.org/x/net/proxy" "sync" "time" + + "golang.org/x/net/proxy" ) //Initiator initiates connections and processes messages for all sessions. diff --git a/mongostore_test.go b/mongostore_test.go index 21ca84a8d..29d43d71d 100644 --- a/mongostore_test.go +++ b/mongostore_test.go @@ -2,12 +2,13 @@ package quickfix import ( "fmt" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" "log" "os" "strings" "testing" + + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" ) // MongoStoreTestSuite runs all tests in the MessageStoreTestSuite against the MongoStore implementation diff --git a/session_settings_test.go b/session_settings_test.go index a28f60529..34687ae2c 100644 --- a/session_settings_test.go +++ b/session_settings_test.go @@ -1,8 +1,9 @@ package quickfix import ( - "github.com/quickfixgo/quickfix/config" "testing" + + "github.com/quickfixgo/quickfix/config" ) func TestSessionSettings_StringSettings(t *testing.T) { From 0d1a5183a08f9d3d6a914b77b21867575c7ac79e Mon Sep 17 00:00:00 2001 From: ackleymi Date: Mon, 30 Sep 2019 00:28:08 -0400 Subject: [PATCH 036/139] Adds gopath requirement hack and canonicalizes template comment format. --- Makefile | 5 ++- cmd/generate-fix/generate-fix.go | 28 +++++++------- cmd/generate-fix/internal/helpers.go | 23 +++++------- cmd/generate-fix/internal/templates.go | 52 +++++++++++++------------- go.mod | 1 - go.sum | 5 --- 6 files changed, 54 insertions(+), 60 deletions(-) diff --git a/Makefile b/Makefile index d513ded8a..c883e5bd0 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ all: vet test -generate: +clean: + rm -rf gen + +generate: clean mkdir -p gen; cd gen; go run ../cmd/generate-fix/generate-fix.go ../spec/*.xml generate-dist: diff --git a/cmd/generate-fix/generate-fix.go b/cmd/generate-fix/generate-fix.go index 5ec5ff47a..458e20458 100644 --- a/cmd/generate-fix/generate-fix.go +++ b/cmd/generate-fix/generate-fix.go @@ -101,7 +101,7 @@ func genEnums() { } func gen(t *template.Template, fileOut string, data interface{}) { - defer waitGroup.Done() + //defer waitGroup.Done() writer := new(bytes.Buffer) if err := t.Execute(writer, data); err != nil { @@ -133,12 +133,12 @@ func main() { internal.BuildGlobalFieldTypes(specs) - waitGroup.Add(1) - go genTags() - waitGroup.Add(1) - go genFields() - waitGroup.Add(1) - go genEnums() + //waitGroup.Add(1) + genTags() + //waitGroup.Add(1) + genFields() + //waitGroup.Add(1) + genEnums() for _, spec := range specs { pkg := getPackageName(spec) @@ -155,21 +155,21 @@ func main() { //uses fixt11 header/trailer case "fix50", "fix50sp1", "fix50sp2": default: - waitGroup.Add(1) - go genHeader(pkg, spec) + //waitGroup.Add(1) + genHeader(pkg, spec) - waitGroup.Add(1) - go genTrailer(pkg, spec) + //waitGroup.Add(1) + genTrailer(pkg, spec) } for _, m := range spec.Messages { - waitGroup.Add(1) - go genMessage(pkg, spec, m) + //waitGroup.Add(1) + genMessage(pkg, spec, m) } } go func() { - waitGroup.Wait() + //waitGroup.Wait() close(errors) }() diff --git a/cmd/generate-fix/internal/helpers.go b/cmd/generate-fix/internal/helpers.go index dba773d89..33f491a4d 100644 --- a/cmd/generate-fix/internal/helpers.go +++ b/cmd/generate-fix/internal/helpers.go @@ -1,21 +1,18 @@ package internal -import ( - "os" - "path/filepath" - "strings" -) - // getImportPathRoot returns the root path to use in import statements. // The root path is determined by stripping "$GOPATH/src/" from the current // working directory. For example, when generating code within the QuickFIX/Go // source tree, the returned root path will be "github.com/quickfixgo/quickfix". func getImportPathRoot() string { - pwd, err := os.Getwd() - if err != nil { - panic(err) - } - goSrcPath := filepath.Join(os.Getenv("GOPATH"), "src") - importPathRoot := filepath.ToSlash(strings.Replace(pwd, goSrcPath, "", 1)) - return strings.TrimLeft(importPathRoot, "/") + // pwd, err := os.Getwd() + // if err != nil { + // panic(err) + // } + // goSrcPath := filepath.Join(os.Getenv("GOPATH"), "src") + // importPathRoot := filepath.ToSlash(strings.Replace(pwd, goSrcPath, "", 1)) + // return strings.TrimLeft(importPathRoot, "/") + + // !! A hack for now? ..... + return "github.com/quickfixgo/quickfix/gen" } diff --git a/cmd/generate-fix/internal/templates.go b/cmd/generate-fix/internal/templates.go index 95aa5276e..cae2d567d 100644 --- a/cmd/generate-fix/internal/templates.go +++ b/cmd/generate-fix/internal/templates.go @@ -57,7 +57,7 @@ Set{{ .Name }}(f {{ .Name }}RepeatingGroup){ {{ define "setters" }} {{ range .Fields }} -//Set{{ .Name }} sets {{ .Name }}, Tag {{ .Tag }} +// Set{{ .Name }} sets {{ .Name }}, Tag {{ .Tag }}. func ({{ template "receiver" }} {{ $.Name }}) {{ if .IsGroup }}{{ template "groupsetter" . }}{{ else }}{{ template "fieldsetter" . }}{{ end }} {{ end }}{{ end }} @@ -97,13 +97,13 @@ Get{{ .Name }}() ({{ .Name }}RepeatingGroup, quickfix.MessageRejectError) { {{ define "getters" }} {{ range .Fields }} -//Get{{ .Name }} gets {{ .Name }}, Tag {{ .Tag }} +// Get{{ .Name }} gets {{ .Name }}, Tag {{ .Tag }}. func ({{ template "receiver" }} {{ $.Name }}) {{if .IsGroup}}{{ template "groupgetter" . }}{{ else }}{{ template "fieldvaluegetter" .}}{{ end }} {{ end }}{{ end }} {{ define "hasers" }} {{range .Fields}} -//Has{{ .Name}} returns true if {{ .Name}} is present, Tag {{ .Tag}} +// Has{{ .Name}} returns true if {{ .Name}} is present, Tag {{ .Tag}}. func ({{ template "receiver" }} {{ $.Name }}) Has{{ .Name}}() bool { return {{ template "receiver" }}.Has(tag.{{ .Name}}) } @@ -121,7 +121,7 @@ quickfix.GroupTemplate{ {{ define "groups" }} {{ range .Fields }} {{ if .IsGroup }} -//{{ .Name }} is a repeating group element, Tag {{ .Tag }} +// {{ .Name }} is a repeating group element, Tag {{ .Tag }}. type {{ .Name }} struct { *quickfix.Group } @@ -131,24 +131,24 @@ type {{ .Name }} struct { {{ template "hasers" . }} {{ template "groups" . }} -//{{ .Name }}RepeatingGroup is a repeating group, Tag {{ .Tag }} +// {{ .Name }}RepeatingGroup is a repeating group, Tag {{ .Tag }}. type {{ .Name }}RepeatingGroup struct { *quickfix.RepeatingGroup } -//New{{ .Name }}RepeatingGroup returns an initialized, {{ .Name }}RepeatingGroup +// New{{ .Name }}RepeatingGroup returns an initialized, {{ .Name }}RepeatingGroup. func New{{ .Name }}RepeatingGroup() {{ .Name }}RepeatingGroup { return {{ .Name }}RepeatingGroup{ quickfix.NewRepeatingGroup(tag.{{ .Name }}, {{ template "group_template" .Fields }})} } -//Add create and append a new {{ .Name }} to this group +// Add create and append a new {{ .Name }} to this group. func ({{ template "receiver" }} {{ .Name }}RepeatingGroup) Add() {{ .Name }} { g := {{ template "receiver" }}.RepeatingGroup.Add() return {{ .Name }}{g} } -//Get returns the ith {{ .Name }} in the {{ .Name }}RepeatinGroup +// Get returns the ith {{ .Name }} in the {{ .Name }}RepeatinGroup. func ({{ template "receiver" }} {{ .Name}}RepeatingGroup) Get(i int) {{ .Name }} { return {{ .Name }}{ {{ template "receiver" }}.RepeatingGroup.Get(i) } } @@ -174,12 +174,12 @@ import( "{{ importRootPath }}/tag" ) -//Header is the {{ .Package }} Header type +// Header is the {{ .Package }} Header type. type Header struct { *quickfix.Header } -//NewHeader returns a new, initialized Header instance +// NewHeader returns a new, initialized Header instance. func NewHeader(header *quickfix.Header) (h Header) { h.Header = header h.SetBeginString("{{ beginString .FIXSpec }}") @@ -209,7 +209,7 @@ import( "{{ importRootPath }}/tag" ) -//Trailer is the {{ .Package }} Trailer type +// Trailer is the {{ .Package }} Trailer type. type Trailer struct { *quickfix.Trailer } @@ -238,7 +238,7 @@ import( "{{ importRootPath }}/tag" ) -//{{ .Name }} is the {{ .FIXPackage }} {{ .Name }} type, MsgType = {{ .MsgType }} +// {{ .Name }} is the {{ .FIXPackage }} {{ .Name }} type, MsgType = {{ .MsgType }}. type {{ .Name }} struct { {{ .TransportPackage }}.Header *quickfix.Body @@ -246,7 +246,7 @@ type {{ .Name }} struct { Message *quickfix.Message } -//FromMessage creates a {{ .Name }} from a quickfix.Message instance +// FromMessage creates a {{ .Name }} from a quickfix.Message instance. func FromMessage(m *quickfix.Message) {{ .Name }} { return {{ .Name }}{ Header: {{ .TransportPackage}}.Header{&m.Header}, @@ -256,13 +256,13 @@ func FromMessage(m *quickfix.Message) {{ .Name }} { } } -//ToMessage returns a quickfix.Message instance +// ToMessage returns a quickfix.Message instance. func (m {{ .Name }}) ToMessage() *quickfix.Message { return m.Message } {{ $required_fields := requiredFields .MessageDef -}} -//New returns a {{ .Name }} initialized with the required fields for {{ .Name }} +// New returns a {{ .Name }} initialized with the required fields for {{ .Name }}. func New({{template "field_args" $required_fields }}) (m {{ .Name }}) { m.Message = quickfix.NewMessage() m.Header = {{ .TransportPackage }}.NewHeader(&m.Message.Header) @@ -277,10 +277,10 @@ func New({{template "field_args" $required_fields }}) (m {{ .Name }}) { return } -//A RouteOut is the callback type that should be implemented for routing Message +// A RouteOut is the callback type that should be implemented for routing Message. type RouteOut func(msg {{ .Name }}, sessionID quickfix.SessionID) quickfix.MessageRejectError -//Route returns the beginstring, message type, and MessageRoute for this Message type +// Route returns the beginstring, message type, and MessageRoute for this Message type. func Route(router RouteOut) (string, string, quickfix.MessageRoute) { r:=func(msg *quickfix.Message, sessionID quickfix.SessionID) quickfix.MessageRejectError { return router(FromMessage(msg), sessionID) @@ -319,28 +319,28 @@ import( {{- $base_type := quickfixType . -}} {{ if and .Enums (ne $base_type "FIXBoolean") }} -//{{ .Name }}Field is a enum.{{ .Name }} field +// {{ .Name }}Field is a enum.{{ .Name }} field. type {{ .Name }}Field struct { quickfix.FIXString } {{ else }} -//{{ .Name }}Field is a {{ .Type }} field +// {{ .Name }}Field is a {{ .Type }} field. type {{ .Name }}Field struct { quickfix.{{ $base_type }} } {{ end }} -//Tag returns tag.{{ .Name }} ({{ .Tag }}) +// Tag returns tag.{{ .Name }} ({{ .Tag }}). func (f {{ .Name }}Field) Tag() quickfix.Tag { return tag.{{ .Name }} } {{ if eq $base_type "FIXUTCTimestamp" }} -//New{{ .Name }} returns a new {{ .Name }}Field initialized with val +// New{{ .Name }} returns a new {{ .Name }}Field initialized with val. func New{{ .Name }}(val time.Time) {{ .Name }}Field { return New{{ .Name }}WithPrecision(val, quickfix.Millis) } -//New{{ .Name }}NoMillis returns a new {{ .Name }}Field initialized with val without millisecs +// New{{ .Name }}NoMillis returns a new {{ .Name }}Field initialized with val without millisecs. func New{{ .Name }}NoMillis(val time.Time) {{ .Name }}Field { return New{{ .Name }}WithPrecision(val, quickfix.Seconds) } -//New{{ .Name }}WithPrecision returns a new {{ .Name }}Field initialized with val of specified precision +// New{{ .Name }}WithPrecision returns a new {{ .Name }}Field initialized with val of specified precision. func New{{ .Name }}WithPrecision(val time.Time, precision quickfix.TimestampPrecision) {{ .Name }}Field { return {{ .Name }}Field{ quickfix.FIXUTCTimestamp{ Time: val, Precision: precision } } } @@ -350,12 +350,12 @@ func New{{ .Name }}(val enum.{{ .Name }}) {{ .Name }}Field { return {{ .Name }}Field{ quickfix.FIXString(val) } } {{ else if eq $base_type "FIXDecimal" }} -//New{{ .Name }} returns a new {{ .Name }}Field initialized with val and scale +// New{{ .Name }} returns a new {{ .Name }}Field initialized with val and scale. func New{{ .Name }}(val decimal.Decimal, scale int32) {{ .Name }}Field { return {{ .Name }}Field{ quickfix.FIXDecimal{ Decimal: val, Scale: scale} } } {{ else }} -//New{{ .Name }} returns a new {{ .Name }}Field initialized with val +// New{{ .Name }} returns a new {{ .Name }}Field initialized with val. func New{{ .Name }}(val {{ quickfixValueType $base_type }}) {{ .Name }}Field { return {{ .Name }}Field{ quickfix.{{ $base_type }}(val) } } @@ -386,7 +386,7 @@ func (f {{ .Name }}Field) Value() ({{ quickfixValueType $base_type }}) { package enum {{ range $ft := . }} {{ if $ft.Enums }} -//Enum values for {{ $ft.Name }} +// {{ $ft.Name }} field enumeration values. type {{ $ft.Name }} string const( {{ range $ft.Enums }} diff --git a/go.mod b/go.mod index 35dc6871d..7a1c07b7d 100644 --- a/go.mod +++ b/go.mod @@ -8,5 +8,4 @@ require ( github.com/shopspring/decimal v0.0.0-20190905144223-a36b5d85f337 github.com/stretchr/testify v1.4.0 golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 - golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e // indirect ) diff --git a/go.sum b/go.sum index cfd41efd9..ee9f475a9 100644 --- a/go.sum +++ b/go.sum @@ -13,15 +13,10 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 h1:qPnAdmjNA41t3QBTx2mFGf/SD1IoslhYu7AmdsVzCcs= golang.org/x/net v0.0.0-20190926025831-c00fd9afed17/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e h1:1xWUkZQQ9Z9UuZgNaIR6OQOE7rUFglXUUBZlO+dGg6I= -golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= From fdf41a7776c25eab6a4c729758edd3c05d3e9ae4 Mon Sep 17 00:00:00 2001 From: ackleymi Date: Thu, 17 Oct 2019 22:40:53 -0400 Subject: [PATCH 037/139] Adds a flag to specify generated package import paths. --- cmd/generate-fix/internal/generate.go | 1 + cmd/generate-fix/internal/helpers.go | 14 +------------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/cmd/generate-fix/internal/generate.go b/cmd/generate-fix/internal/generate.go index 9fbefea29..3dc428980 100644 --- a/cmd/generate-fix/internal/generate.go +++ b/cmd/generate-fix/internal/generate.go @@ -13,6 +13,7 @@ import ( var ( useFloat = flag.Bool("use-float", false, "By default, FIX float fields are represented as arbitrary-precision fixed-point decimal numbers. Set to 'true' to instead generate FIX float fields as float64 values.") + pkgRoot = flag.String("pkg-root", "github.com/quickfixgo", "Set a string here to provide a custom import path for generated packages.") tabWidth = 8 printerMode = printer.UseSpaces | printer.TabIndent ) diff --git a/cmd/generate-fix/internal/helpers.go b/cmd/generate-fix/internal/helpers.go index 33f491a4d..8fe4cd4c6 100644 --- a/cmd/generate-fix/internal/helpers.go +++ b/cmd/generate-fix/internal/helpers.go @@ -1,18 +1,6 @@ package internal // getImportPathRoot returns the root path to use in import statements. -// The root path is determined by stripping "$GOPATH/src/" from the current -// working directory. For example, when generating code within the QuickFIX/Go -// source tree, the returned root path will be "github.com/quickfixgo/quickfix". func getImportPathRoot() string { - // pwd, err := os.Getwd() - // if err != nil { - // panic(err) - // } - // goSrcPath := filepath.Join(os.Getenv("GOPATH"), "src") - // importPathRoot := filepath.ToSlash(strings.Replace(pwd, goSrcPath, "", 1)) - // return strings.TrimLeft(importPathRoot, "/") - - // !! A hack for now? ..... - return "github.com/quickfixgo/quickfix/gen" + return *pkgRoot } From 731274de5f072634d9fe324644bb39492ffd26e8 Mon Sep 17 00:00:00 2001 From: ackleymi Date: Thu, 17 Oct 2019 22:41:32 -0400 Subject: [PATCH 038/139] Reverts generator waitgroup behavior. --- cmd/generate-fix/generate-fix.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/generate-fix/generate-fix.go b/cmd/generate-fix/generate-fix.go index 458e20458..9512d9a19 100644 --- a/cmd/generate-fix/generate-fix.go +++ b/cmd/generate-fix/generate-fix.go @@ -101,7 +101,7 @@ func genEnums() { } func gen(t *template.Template, fileOut string, data interface{}) { - //defer waitGroup.Done() + defer waitGroup.Done() writer := new(bytes.Buffer) if err := t.Execute(writer, data); err != nil { @@ -133,11 +133,11 @@ func main() { internal.BuildGlobalFieldTypes(specs) - //waitGroup.Add(1) + waitGroup.Add(1) genTags() - //waitGroup.Add(1) + waitGroup.Add(1) genFields() - //waitGroup.Add(1) + waitGroup.Add(1) genEnums() for _, spec := range specs { @@ -155,21 +155,21 @@ func main() { //uses fixt11 header/trailer case "fix50", "fix50sp1", "fix50sp2": default: - //waitGroup.Add(1) + waitGroup.Add(1) genHeader(pkg, spec) - //waitGroup.Add(1) + waitGroup.Add(1) genTrailer(pkg, spec) } for _, m := range spec.Messages { - //waitGroup.Add(1) + waitGroup.Add(1) genMessage(pkg, spec, m) } } go func() { - //waitGroup.Wait() + waitGroup.Wait() close(errors) }() From 61e093e2649a2f51dadf9eff1ade460f73f31dd0 Mon Sep 17 00:00:00 2001 From: ackleymi Date: Fri, 18 Oct 2019 00:46:29 -0400 Subject: [PATCH 039/139] Updates README to reflect modules changes. --- README.md | 51 ++++++++++++++------------------------------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index f9a59056f..d615b4db7 100644 --- a/README.md +++ b/README.md @@ -54,24 +54,16 @@ Following installation, `generate-fix` is installed to `$GOPATH/bin/generate-fix Developing QuickFIX/Go ---------------------- -If you wish to work on QuickFIX/Go itself, you will first need [Go](http://www.golang.org) installed on your machine (version 1.6+ is *required*). +If you wish to work on QuickFIX/Go itself, you will first need [Go](http://www.golang.org) installed and configured on your machine (version 1.13+ is preferred, but the minimum required version is 1.6). -For local dev first make sure Go is properly installed, including setting up a [GOPATH](http://golang.org/doc/code.html#GOPATH). - -Next, using [Git](https://git-scm.com/), clone this repository into `$GOPATH/src/github.com/quickfixgo/quickfix`. +Next, using [Git](https://git-scm.com/), clone the repository via `git clone git@github.com:quickfixgo/quickfix.git` ### Installing Dependencies -QuickFIX/Go uses [dep](https://github.com/golang/dep) to manage the vendored dependencies. Install dep with `go get`: - -```sh -$ 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. +As of Go version 1.13, QuickFIX/Go uses [modules](https://github.com/golang/go/wiki/Modules) to manage dependencies. You may require `GO111MODULE=on`. To install dependencies, run ```sh -$ $GOPATH/bin/dep ensure +go mod download ``` **Note:** No vendored dependencies are included in the QuickFIX/Go source. @@ -117,37 +109,22 @@ To run acceptance tests, 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. +#### Adding/updating a dependency -To add a dependency: - -1. Add the dependency using `dep`: -```bash -$ dep ensure -add github.com/foo/bar -``` -2. Review the changes in git and commit them. +If you are adding or updating a dependency, you will need to update the `go.mod` and `go.sum` 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. -#### Updating a dependency - -To update a dependency to the latest version allowed by constraints in `Gopkg.toml`: - -1. Run: -```bash -$ dep ensure -update github.com/foo/bar +1. Add or update the dependency like usual: +```sh +go get -u github.com/foo/bar ``` -2. 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: -```bash -$ dep ensure +2. Update the module-related files: +```sh +go mod tidy ``` 3. Review the changes in git and commit them. +Note that to specify a specific revision, you can manually edit the `go.mod` file and run `go mod tidy` + Licensing --------- From 1603f31a1fe19627f52a4dfd48da1db039a899c7 Mon Sep 17 00:00:00 2001 From: ackleymi Date: Wed, 23 Oct 2019 21:43:53 -0400 Subject: [PATCH 040/139] Restores go expressions to generator funcs. --- cmd/generate-fix/generate-fix.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/generate-fix/generate-fix.go b/cmd/generate-fix/generate-fix.go index 9512d9a19..5ec5ff47a 100644 --- a/cmd/generate-fix/generate-fix.go +++ b/cmd/generate-fix/generate-fix.go @@ -134,11 +134,11 @@ func main() { internal.BuildGlobalFieldTypes(specs) waitGroup.Add(1) - genTags() + go genTags() waitGroup.Add(1) - genFields() + go genFields() waitGroup.Add(1) - genEnums() + go genEnums() for _, spec := range specs { pkg := getPackageName(spec) @@ -156,15 +156,15 @@ func main() { case "fix50", "fix50sp1", "fix50sp2": default: waitGroup.Add(1) - genHeader(pkg, spec) + go genHeader(pkg, spec) waitGroup.Add(1) - genTrailer(pkg, spec) + go genTrailer(pkg, spec) } for _, m := range spec.Messages { waitGroup.Add(1) - genMessage(pkg, spec, m) + go genMessage(pkg, spec, m) } } From e4668885b9a30f259f5880778c5e90acc2724946 Mon Sep 17 00:00:00 2001 From: Linmao Song Date: Wed, 6 Nov 2019 11:02:10 +0000 Subject: [PATCH 041/139] Add SocketServerName to support TLS SNI --- config/configuration.go | 1 + config/doc.go | 4 ++++ tls.go | 10 ++++++++++ tls_test.go | 21 +++++++++++++++++++++ 4 files changed, 36 insertions(+) diff --git a/config/configuration.go b/config/configuration.go index afa442a33..e10ca7ee7 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -20,6 +20,7 @@ const ( SocketCertificateFile string = "SocketCertificateFile" SocketCAFile string = "SocketCAFile" SocketInsecureSkipVerify string = "SocketInsecureSkipVerify" + SocketServerName string = "SocketServerName" SocketMinimumTLSVersion string = "SocketMinimumTLSVersion" SocketTimeout string = "SocketTimeout" SocketUseSSL string = "SocketUseSSL" diff --git a/config/doc.go b/config/doc.go index d02491c16..b0983c6eb 100644 --- a/config/doc.go +++ b/config/doc.go @@ -280,6 +280,10 @@ SocketCAFile Optional root CA to use for secure TLS connections. For acceptors, client certificates will be verified against this CA. For initiators, clients will use the CA to verify the server certificate. If not configurated, initiators will verify the server certificate using the host's root CA set. +SocketServerName + +The expected server name on a returned certificate, unless SocketInsecureSkipVerify is true. This is for the TLS Server Name Indication extension. Initiator only. + SocketMinimumTLSVersion Specify the Minimum TLS version to use when creating a secure connection. The valid choices are SSL30, TLS10, TLS11, TLS12. Defaults to TLS12. diff --git a/tls.go b/tls.go index ef6846f61..fa81a3808 100644 --- a/tls.go +++ b/tls.go @@ -18,6 +18,14 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) } } + var serverName string + if settings.HasSetting(config.SocketServerName) { + serverName, err = settings.Setting(config.SocketServerName) + if err != nil { + return + } + } + insecureSkipVerify := false if settings.HasSetting(config.SocketInsecureSkipVerify) { insecureSkipVerify, err = settings.BoolSetting(config.SocketInsecureSkipVerify) @@ -29,6 +37,7 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) if !settings.HasSetting(config.SocketPrivateKeyFile) && !settings.HasSetting(config.SocketCertificateFile) { if allowSkipClientCerts { tlsConfig = defaultTLSConfig() + tlsConfig.ServerName = serverName tlsConfig.InsecureSkipVerify = insecureSkipVerify } return @@ -46,6 +55,7 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) tlsConfig = defaultTLSConfig() tlsConfig.Certificates = make([]tls.Certificate, 1) + tlsConfig.ServerName = serverName tlsConfig.InsecureSkipVerify = insecureSkipVerify minVersion := "TLS12" diff --git a/tls_test.go b/tls_test.go index 3ddbddeaf..a858dc6db 100644 --- a/tls_test.go +++ b/tls_test.go @@ -87,6 +87,27 @@ func (s *TLSTestSuite) TestLoadTLSWithCA() { s.Equal(tls.RequireAndVerifyClientCert, tlsConfig.ClientAuth) } +func (s *TLSTestSuite) TestServerNameUseSSL() { + s.settings.GlobalSettings().Set(config.SocketUseSSL, "Y") + s.settings.GlobalSettings().Set(config.SocketServerName, "DummyServerNameUseSSL") + + tlsConfig, err := loadTLSConfig(s.settings.GlobalSettings()) + s.Nil(err) + s.NotNil(tlsConfig) + s.Equal("DummyServerNameUseSSL", tlsConfig.ServerName) +} + +func (s *TLSTestSuite) TestServerNameWithCerts() { + s.settings.GlobalSettings().Set(config.SocketPrivateKeyFile, s.PrivateKeyFile) + s.settings.GlobalSettings().Set(config.SocketCertificateFile, s.CertificateFile) + s.settings.GlobalSettings().Set(config.SocketServerName, "DummyServerNameWithCerts") + + tlsConfig, err := loadTLSConfig(s.settings.GlobalSettings()) + s.Nil(err) + s.NotNil(tlsConfig) + s.Equal("DummyServerNameWithCerts", tlsConfig.ServerName) +} + func (s *TLSTestSuite) TestInsecureSkipVerify() { s.settings.GlobalSettings().Set(config.SocketInsecureSkipVerify, "Y") From 1542921753dd2d1e811aa7a1de27ae3d68ae7341 Mon Sep 17 00:00:00 2001 From: Linmao Song Date: Wed, 6 Nov 2019 11:45:57 +0000 Subject: [PATCH 042/139] Avoid duplicate config in both SocketConnectAddress and ServerName: copy ServerName from the current address when required but not configured --- initiator.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/initiator.go b/initiator.go index c84ced741..126d3e2bd 100644 --- a/initiator.go +++ b/initiator.go @@ -151,6 +151,11 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, di session.log.OnEventf("Failed to connect: %v", err) goto reconnect } else if tlsConfig != nil { + // Unless InsecureSkipVerify is true, server name config is required for TLS + // to verify the received certificate + if !tlsConfig.InsecureSkipVerify && len(tlsConfig.ServerName) == 0 { + tlsConfig.ServerName = address + } tlsConn := tls.Client(netConn, tlsConfig) if err = tlsConn.Handshake(); err != nil { session.log.OnEventf("Failed handshake: %v", err) From 3f2a11de5dd94beef2206ced73d0209d891bfc36 Mon Sep 17 00:00:00 2001 From: Linmao Song Date: Wed, 6 Nov 2019 12:00:23 +0000 Subject: [PATCH 043/139] When copying address as server name, Chop off port if present --- initiator.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/initiator.go b/initiator.go index 126d3e2bd..fe88fd220 100644 --- a/initiator.go +++ b/initiator.go @@ -154,7 +154,11 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, di // Unless InsecureSkipVerify is true, server name config is required for TLS // to verify the received certificate if !tlsConfig.InsecureSkipVerify && len(tlsConfig.ServerName) == 0 { - tlsConfig.ServerName = address + serverName := address + if c := strings.LastIndex(serverName, ":"); c > 0 { + serverName = serverName[:c] + } + tlsConfig.ServerName = serverName } tlsConn := tls.Client(netConn, tlsConfig) if err = tlsConn.Handshake(); err != nil { From 3319fc647f8b4b9bf21dff0d6a013300900a58af Mon Sep 17 00:00:00 2001 From: Linmao Song Date: Wed, 6 Nov 2019 12:04:10 +0000 Subject: [PATCH 044/139] Missing depedency --- initiator.go | 1 + 1 file changed, 1 insertion(+) diff --git a/initiator.go b/initiator.go index fe88fd220..030ea9570 100644 --- a/initiator.go +++ b/initiator.go @@ -3,6 +3,7 @@ package quickfix import ( "bufio" "crypto/tls" + "strings" "sync" "time" From ec0df4a89f1fa2dd9238e5be50b68dab0b1186c0 Mon Sep 17 00:00:00 2001 From: ackleymi Date: Thu, 7 Nov 2019 20:05:07 -0500 Subject: [PATCH 045/139] [QFGO-296] Adds LogoutTimeout as a configuration parameter. --- config/configuration.go | 1 + config/doc.go | 6 ++++++ internal/session_settings.go | 1 + session.go | 3 +-- session_factory.go | 15 +++++++++++++++ session_factory_test.go | 25 +++++++++++++++++++++++++ 6 files changed, 49 insertions(+), 2 deletions(-) diff --git a/config/configuration.go b/config/configuration.go index 715387c3d..d8acacdf7 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -42,6 +42,7 @@ const ( ResetOnLogout string = "ResetOnLogout" ResetOnDisconnect string = "ResetOnDisconnect" ReconnectInterval string = "ReconnectInterval" + LogoutTimeout string = "LogoutTimeout" HeartBtInt string = "HeartBtInt" FileLogPath string = "FileLogPath" FileStorePath string = "FileStorePath" diff --git a/config/doc.go b/config/doc.go index d02491c16..51ad4777e 100644 --- a/config/doc.go +++ b/config/doc.go @@ -230,6 +230,12 @@ Time between reconnection attempts in seconds. Only used for initiators. Valu Defaults to 30 +LogoutTimeout + +Session setting for logout timeout in seconds. Only used for initiators. Value must be positive integer. + +Defaults to 2 + HeartBtInt Heartbeat interval in seconds. Only used for initiators. Value must be positive integer. diff --git a/internal/session_settings.go b/internal/session_settings.go index f5d7f9a35..9affec758 100644 --- a/internal/session_settings.go +++ b/internal/session_settings.go @@ -22,5 +22,6 @@ type SessionSettings struct { //specific to initiators ReconnectInterval time.Duration + LogoutTimeout time.Duration SocketConnectAddress []string } diff --git a/session.go b/session.go index 204fa99d5..6d6c1aa0c 100644 --- a/session.go +++ b/session.go @@ -465,8 +465,7 @@ func (s *session) initiateLogoutInReplyTo(reason string, inReplyTo *Message) (er return } s.log.OnEvent("Inititated logout request") - time.AfterFunc(time.Duration(2)*time.Second, func() { s.sessionEvent <- internal.LogoutTimeout }) - + time.AfterFunc(s.LogoutTimeout, func() { s.sessionEvent <- internal.LogoutTimeout }) return } diff --git a/session_factory.go b/session_factory.go index 36e294837..6a31a0f7c 100644 --- a/session_factory.go +++ b/session_factory.go @@ -331,6 +331,21 @@ func (f sessionFactory) buildInitiatorSettings(session *session, settings *Sessi session.ReconnectInterval = time.Duration(interval) * time.Second } + session.LogoutTimeout = 2 * time.Second + if settings.HasSetting(config.LogoutTimeout) { + + timeout, err := settings.IntSetting(config.LogoutTimeout) + if err != nil { + return err + } + + if timeout <= 0 { + return errors.New("LogoutTimeout must be greater than zero") + } + + session.LogoutTimeout = time.Duration(timeout) * time.Second + } + return f.configureSocketConnectAddress(session, settings) } diff --git a/session_factory_test.go b/session_factory_test.go index 7db6cfd87..f9d00b381 100644 --- a/session_factory_test.go +++ b/session_factory_test.go @@ -353,6 +353,7 @@ func (s *SessionFactorySuite) TestNewSessionBuildInitiators() { s.True(session.InitiateLogon) s.Equal(34*time.Second, session.HeartBtInt) s.Equal(30*time.Second, session.ReconnectInterval) + s.Equal(2*time.Second, session.LogoutTimeout) s.Equal("127.0.0.1:5000", session.SocketConnectAddress[0]) } @@ -399,6 +400,30 @@ func (s *SessionFactorySuite) TestNewSessionBuildInitiatorsValidReconnectInterva s.NotNil(err, "ReconnectInterval must be greater than zero") } +func (s *SessionFactorySuite) TestNewSessionBuildInitiatorsValidLogoutTimeout() { + s.sessionFactory.BuildInitiators = true + s.SessionSettings.Set(config.HeartBtInt, "34") + s.SessionSettings.Set(config.SocketConnectHost, "127.0.0.1") + s.SessionSettings.Set(config.SocketConnectPort, "3000") + + s.SessionSettings.Set(config.LogoutTimeout, "45") + session, err := s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + s.Nil(err) + s.Equal(45*time.Second, session.LogoutTimeout) + + s.SessionSettings.Set(config.LogoutTimeout, "not a number") + _, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + s.NotNil(err, "LogoutTimeout must be a number") + + s.SessionSettings.Set(config.LogoutTimeout, "0") + _, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + s.NotNil(err, "LogoutTimeout must be greater than zero") + + s.SessionSettings.Set(config.LogoutTimeout, "-20") + _, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + s.NotNil(err, "LogoutTimeout must be greater than zero") +} + func (s *SessionFactorySuite) TestConfigureSocketConnectAddress() { sess := new(session) err := s.configureSocketConnectAddress(sess, s.SessionSettings) From 7fece7dc585d07561ec5fb230b638545529843bc Mon Sep 17 00:00:00 2001 From: ackleymi Date: Thu, 7 Nov 2019 20:13:32 -0500 Subject: [PATCH 046/139] [QFGO-295] Adds LogonTimeout as a configuration parameter. --- config/configuration.go | 1 + config/doc.go | 6 ++++++ internal/session_settings.go | 1 + session_factory.go | 15 +++++++++++++++ session_factory_test.go | 25 +++++++++++++++++++++++++ session_state.go | 23 ++++++++++++++--------- 6 files changed, 62 insertions(+), 9 deletions(-) diff --git a/config/configuration.go b/config/configuration.go index d8acacdf7..0846963f3 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -43,6 +43,7 @@ const ( ResetOnDisconnect string = "ResetOnDisconnect" ReconnectInterval string = "ReconnectInterval" LogoutTimeout string = "LogoutTimeout" + LogonTimeout string = "LogonTimeout" HeartBtInt string = "HeartBtInt" FileLogPath string = "FileLogPath" FileStorePath string = "FileStorePath" diff --git a/config/doc.go b/config/doc.go index 51ad4777e..79357ece7 100644 --- a/config/doc.go +++ b/config/doc.go @@ -236,6 +236,12 @@ Session setting for logout timeout in seconds. Only used for initiators. Value m Defaults to 2 +LogonTimeout + +Session setting for logon timeout in seconds. Only used for initiators. Value must be positive integer. + +Defaults to 10 + HeartBtInt Heartbeat interval in seconds. Only used for initiators. Value must be positive integer. diff --git a/internal/session_settings.go b/internal/session_settings.go index 9affec758..4c82b000d 100644 --- a/internal/session_settings.go +++ b/internal/session_settings.go @@ -23,5 +23,6 @@ type SessionSettings struct { //specific to initiators ReconnectInterval time.Duration LogoutTimeout time.Duration + LogonTimeout time.Duration SocketConnectAddress []string } diff --git a/session_factory.go b/session_factory.go index 6a31a0f7c..f4f3fc0ef 100644 --- a/session_factory.go +++ b/session_factory.go @@ -346,6 +346,21 @@ func (f sessionFactory) buildInitiatorSettings(session *session, settings *Sessi session.LogoutTimeout = time.Duration(timeout) * time.Second } + session.LogonTimeout = 10 * time.Second + if settings.HasSetting(config.LogonTimeout) { + + timeout, err := settings.IntSetting(config.LogonTimeout) + if err != nil { + return err + } + + if timeout <= 0 { + return errors.New("LogonTimeout must be greater than zero") + } + + session.LogonTimeout = time.Duration(timeout) * time.Second + } + return f.configureSocketConnectAddress(session, settings) } diff --git a/session_factory_test.go b/session_factory_test.go index f9d00b381..a560843f7 100644 --- a/session_factory_test.go +++ b/session_factory_test.go @@ -353,6 +353,7 @@ func (s *SessionFactorySuite) TestNewSessionBuildInitiators() { s.True(session.InitiateLogon) s.Equal(34*time.Second, session.HeartBtInt) s.Equal(30*time.Second, session.ReconnectInterval) + s.Equal(10*time.Second, session.LogonTimeout) s.Equal(2*time.Second, session.LogoutTimeout) s.Equal("127.0.0.1:5000", session.SocketConnectAddress[0]) } @@ -424,6 +425,30 @@ func (s *SessionFactorySuite) TestNewSessionBuildInitiatorsValidLogoutTimeout() s.NotNil(err, "LogoutTimeout must be greater than zero") } +func (s *SessionFactorySuite) TestNewSessionBuildInitiatorsValidLogonTimeout() { + s.sessionFactory.BuildInitiators = true + s.SessionSettings.Set(config.HeartBtInt, "34") + s.SessionSettings.Set(config.SocketConnectHost, "127.0.0.1") + s.SessionSettings.Set(config.SocketConnectPort, "3000") + + s.SessionSettings.Set(config.LogonTimeout, "45") + session, err := s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + s.Nil(err) + s.Equal(45*time.Second, session.LogonTimeout) + + s.SessionSettings.Set(config.LogonTimeout, "not a number") + _, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + s.NotNil(err, "LogonTimeout must be a number") + + s.SessionSettings.Set(config.LogonTimeout, "0") + _, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + s.NotNil(err, "LogonTimeout must be greater than zero") + + s.SessionSettings.Set(config.LogonTimeout, "-20") + _, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + s.NotNil(err, "LogonTimeout must be greater than zero") +} + func (s *SessionFactorySuite) TestConfigureSocketConnectAddress() { sess := new(session) err := s.configureSocketConnectAddress(sess, s.SessionSettings) diff --git a/session_state.go b/session_state.go index 1f076f221..c45ec9dda 100644 --- a/session_state.go +++ b/session_state.go @@ -28,22 +28,27 @@ func (sm *stateMachine) Connect(session *session) { return } - if session.InitiateLogon { - if session.RefreshOnLogon { - if err := session.store.Refresh(); err != nil { - session.logError(err) - return - } - } + // No special logon logic needed for FIX Acceptors. + if !session.InitiateLogon { + sm.setState(session, logonState{}) + return + } - session.log.OnEvent("Sending logon request") - if err := session.sendLogon(); err != nil { + if session.RefreshOnLogon { + if err := session.store.Refresh(); err != nil { session.logError(err) return } } + session.log.OnEvent("Sending logon request") + if err := session.sendLogon(); err != nil { + session.logError(err) + return + } sm.setState(session, logonState{}) + // Fire logon timeout event after the pre-configured delay period. + time.AfterFunc(session.LogonTimeout, func() { session.sessionEvent <- internal.LogonTimeout }) } func (sm *stateMachine) Stop(session *session) { From 1178e8a675384155cd722033ef959785748f9db3 Mon Sep 17 00:00:00 2001 From: Bob McNaughton Date: Thu, 26 Dec 2019 15:31:45 -0500 Subject: [PATCH 047/139] Include reason in text field of Logout if seq num too low in Logon. Fixes #369 --- logon_state.go | 33 +++++++++++++++++++++------------ logon_state_test.go | 28 ++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/logon_state.go b/logon_state.go index 351fa629c..d254b92b3 100644 --- a/logon_state.go +++ b/logon_state.go @@ -24,23 +24,15 @@ func (s logonState) FixMsgIn(session *session, msg *Message) (nextState sessionS if err := session.handleLogon(msg); err != nil { switch err := err.(type) { case RejectLogon: - session.log.OnEvent(err.Text) - logout := session.buildLogout(err.Text) + return shutdownWithReason(session, msg, true, err.Error()) - if err := session.dropAndSendInReplyTo(logout, msg); err != nil { - session.logError(err) - } - - if err := session.store.IncrNextTargetMsgSeqNum(); err != nil { - session.logError(err) - } - - return latentState{} + case targetTooLow: + return shutdownWithReason(session, msg, false, err.Error()) case targetTooHigh: var tooHighErr error if nextState, tooHighErr = session.doTargetTooHigh(err); tooHighErr != nil { - return handleStateError(session, tooHighErr) + return shutdownWithReason(session, msg, false, tooHighErr.Error()) } return @@ -64,3 +56,20 @@ func (s logonState) Timeout(session *session, e internal.Event) (nextState sessi func (s logonState) Stop(session *session) (nextState sessionState) { return latentState{} } + +func shutdownWithReason(session *session, msg *Message, incrNextTargetMsgSeqNum bool, reason string) (nextState sessionState) { + session.log.OnEvent(reason) + logout := session.buildLogout(reason) + + if err := session.dropAndSendInReplyTo(logout, msg); err != nil { + session.logError(err) + } + + if incrNextTargetMsgSeqNum { + if err := session.store.IncrNextTargetMsgSeqNum(); err != nil { + session.logError(err) + } + } + + return latentState{} +} diff --git a/logon_state_test.go b/logon_state_test.go index 08da2e710..3ba29af1d 100644 --- a/logon_state_test.go +++ b/logon_state_test.go @@ -302,3 +302,31 @@ func (s *LogonStateTestSuite) TestFixMsgInLogonSeqNumTooHigh() { s.State(inSession{}) s.NextTargetMsgSeqNum(7) } + +func (s *LogonStateTestSuite) TestFixMsgInLogonSeqNumTooLow() { + s.IncrNextSenderMsgSeqNum() + s.IncrNextTargetMsgSeqNum() + + logon := s.Logon() + logon.Body.SetField(tagHeartBtInt, FIXInt(32)) + logon.Header.SetInt(tagMsgSeqNum, 1) + + s.MockApp.On("ToAdmin") + s.NextTargetMsgSeqNum(2) + s.fixMsgIn(s.session, logon) + + s.State(latentState{}) + s.NextTargetMsgSeqNum(2) + + s.MockApp.AssertNumberOfCalls(s.T(), "ToAdmin", 1) + msgBytesSent, ok := s.Receiver.LastMessage() + s.Require().True(ok) + sentMessage := NewMessage() + err := ParseMessage(sentMessage, bytes.NewBuffer(msgBytesSent)) + s.Require().Nil(err) + s.MessageType(string(msgTypeLogout), sentMessage) + + s.session.sendQueued() + s.MessageType(string(msgTypeLogout), s.MockApp.lastToAdmin) + s.FieldEquals(tagText, "MsgSeqNum too low, expecting 2 but received 1", s.MockApp.lastToAdmin.Body) +} From 4dd815e574a9185178aca22dda44a359d9c17a0c Mon Sep 17 00:00:00 2001 From: Mircea Pasoi Date: Fri, 3 Jan 2020 16:08:56 -0800 Subject: [PATCH 048/139] Add support for DynamicQualifier --- acceptor.go | 10 ++++++++++ config/configuration.go | 1 + 2 files changed, 11 insertions(+) diff --git a/acceptor.go b/acceptor.go index 1fd1be6f8..63b75fdaa 100644 --- a/acceptor.go +++ b/acceptor.go @@ -25,6 +25,7 @@ type Acceptor struct { listener net.Listener listenerShutdown sync.WaitGroup dynamicSessions bool + dynamicQualifier bool dynamicSessionChan chan *session sessionFactory } @@ -111,6 +112,12 @@ func NewAcceptor(app Application, storeFactory MessageStoreFactory, settings *Se if a.dynamicSessions, err = settings.globalSettings.BoolSetting(config.DynamicSessions); err != nil { return } + + if a.settings.GlobalSettings().HasSetting(config.DynamicQualifier) { + if a.dynamicQualifier, err = settings.globalSettings.BoolSetting(config.DynamicQualifier); err != nil { + return + } + } } if a.globalLog, err = logFactory.Create(); err != nil { @@ -237,6 +244,9 @@ func (a *Acceptor) handleConnection(netConn net.Conn) { SenderCompID: string(targetCompID), SenderSubID: string(targetSubID), SenderLocationID: string(targetLocationID), TargetCompID: string(senderCompID), TargetSubID: string(senderSubID), TargetLocationID: string(senderLocationID), } + if a.dynamicQualifier { + sessID.Qualifier = strconv.Itoa(1 + len(a.sessions)) + } session, ok := a.sessions[sessID] if !ok { if !a.dynamicSessions { diff --git a/config/configuration.go b/config/configuration.go index 155ac16bc..ac74ff68a 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -62,4 +62,5 @@ const ( PersistMessages string = "PersistMessages" RejectInvalidMessage string = "RejectInvalidMessage" DynamicSessions string = "DynamicSessions" + DynamicQualifier string = "DynamicQualifier" ) From 3f3e99851786420630debc668139cdbf1e31ec48 Mon Sep 17 00:00:00 2001 From: Mircea Pasoi Date: Fri, 3 Jan 2020 16:36:15 -0800 Subject: [PATCH 049/139] Tweak logic --- acceptor.go | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/acceptor.go b/acceptor.go index 63b75fdaa..bd9e02c6e 100644 --- a/acceptor.go +++ b/acceptor.go @@ -15,18 +15,19 @@ import ( //Acceptor accepts connections from FIX clients and manages the associated sessions. type Acceptor struct { - app Application - settings *Settings - logFactory LogFactory - storeFactory MessageStoreFactory - globalLog Log - sessions map[SessionID]*session - sessionGroup sync.WaitGroup - listener net.Listener - listenerShutdown sync.WaitGroup - dynamicSessions bool - dynamicQualifier bool - dynamicSessionChan chan *session + app Application + settings *Settings + logFactory LogFactory + storeFactory MessageStoreFactory + globalLog Log + sessions map[SessionID]*session + sessionGroup sync.WaitGroup + listener net.Listener + listenerShutdown sync.WaitGroup + dynamicSessions bool + dynamicQualifier bool + dynamicQualifierCount int + dynamicSessionChan chan *session sessionFactory } @@ -245,7 +246,8 @@ func (a *Acceptor) handleConnection(netConn net.Conn) { TargetCompID: string(senderCompID), TargetSubID: string(senderSubID), TargetLocationID: string(senderLocationID), } if a.dynamicQualifier { - sessID.Qualifier = strconv.Itoa(1 + len(a.sessions)) + a.dynamicQualifierCount++ + sessID.Qualifier = strconv.Itoa(a.dynamicQualifierCount) } session, ok := a.sessions[sessID] if !ok { From e64e1ad619c389b5bc5da8f5110744a6c0bbeb50 Mon Sep 17 00:00:00 2001 From: Mircea Pasoi Date: Wed, 29 Jan 2020 18:21:48 -0800 Subject: [PATCH 050/139] Expore IP address for acceptor --- acceptor.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/acceptor.go b/acceptor.go index bd9e02c6e..0dca6421d 100644 --- a/acceptor.go +++ b/acceptor.go @@ -28,6 +28,7 @@ type Acceptor struct { dynamicQualifier bool dynamicQualifierCount int dynamicSessionChan chan *session + sessionAddr map[SessionID]net.Addr sessionFactory } @@ -100,6 +101,11 @@ func (a *Acceptor) Stop() { a.sessionGroup.Wait() } +func (a *Acceptor) RemoteAddr(sessionID SessionID) (net.Addr, bool) { + addr, ok := a.sessionAddr[sessionID] + return addr, ok +} + //NewAcceptor creates and initializes a new Acceptor. func NewAcceptor(app Application, storeFactory MessageStoreFactory, settings *Settings, logFactory LogFactory) (a *Acceptor, err error) { a = &Acceptor{ @@ -108,6 +114,7 @@ func NewAcceptor(app Application, storeFactory MessageStoreFactory, settings *Se settings: settings, logFactory: logFactory, sessions: make(map[SessionID]*session), + sessionAddr: make(map[SessionID]net.Addr), } if a.settings.GlobalSettings().HasSetting(config.DynamicSessions) { if a.dynamicSessions, err = settings.globalSettings.BoolSetting(config.DynamicSessions); err != nil { @@ -265,6 +272,7 @@ func (a *Acceptor) handleConnection(netConn net.Conn) { defer session.stop() } + a.sessionAddr[sessID] = netConn.RemoteAddr() msgIn := make(chan fixIn) msgOut := make(chan []byte) @@ -309,7 +317,13 @@ LOOP: complete <- sessionID }() case id := <-complete: - delete(sessions, id) + session, ok := sessions[id] + if ok { + delete(a.sessionAddr, session.sessionID) + delete(sessions, id) + } else { + a.globalLog.OnEventf("Missing dynamic session %v!", id) + } } } From efd5a0a67ace16d2a7e306a6e15c3a348636f3b6 Mon Sep 17 00:00:00 2001 From: Mircea Pasoi Date: Wed, 5 Feb 2020 10:29:38 -0800 Subject: [PATCH 051/139] Add comment --- acceptor.go | 1 + 1 file changed, 1 insertion(+) diff --git a/acceptor.go b/acceptor.go index 0dca6421d..62d17c91d 100644 --- a/acceptor.go +++ b/acceptor.go @@ -101,6 +101,7 @@ func (a *Acceptor) Stop() { a.sessionGroup.Wait() } +//Get remote IP address for a given session. func (a *Acceptor) RemoteAddr(sessionID SessionID) (net.Addr, bool) { addr, ok := a.sessionAddr[sessionID] return addr, ok From d73e3330f86f286bca99c23446a3e779dd4c2f1a Mon Sep 17 00:00:00 2001 From: Rahul Gadi Date: Wed, 12 Feb 2020 15:43:33 -0500 Subject: [PATCH 052/139] add businessRejectRefId to MessageRejectError --- errors.go | 28 ++++++++++++++++++++-------- errors_test.go | 27 +++++++++++++++++++++++++++ session.go | 3 +++ tag.go | 1 + 4 files changed, 51 insertions(+), 8 deletions(-) diff --git a/errors.go b/errors.go index af949ebd4..19ca16e50 100644 --- a/errors.go +++ b/errors.go @@ -33,6 +33,7 @@ type MessageRejectError interface { //RejectReason, tag 373 for session rejects, tag 380 for business rejects. RejectReason() int + BusinessRejectRefID() string RefTagID() *Tag IsBusinessReject() bool } @@ -50,20 +51,25 @@ func (RejectLogon) RefTagID() *Tag { return nil } //RejectReason implements MessageRejectError func (RejectLogon) RejectReason() int { return 0 } +//BusinessRejectRefID implements MessageRejectError +func (RejectLogon) BusinessRejectRefID() string { return "" } + //IsBusinessReject implements MessageRejectError func (RejectLogon) IsBusinessReject() bool { return false } type messageRejectError struct { - rejectReason int - text string - refTagID *Tag - isBusinessReject bool + rejectReason int + text string + businessRejectRefID string + refTagID *Tag + isBusinessReject bool } -func (e messageRejectError) Error() string { return e.text } -func (e messageRejectError) RefTagID() *Tag { return e.refTagID } -func (e messageRejectError) RejectReason() int { return e.rejectReason } -func (e messageRejectError) IsBusinessReject() bool { return e.isBusinessReject } +func (e messageRejectError) Error() string { return e.text } +func (e messageRejectError) RefTagID() *Tag { return e.refTagID } +func (e messageRejectError) RejectReason() int { return e.rejectReason } +func (e messageRejectError) BusinessRejectRefID() string { return e.businessRejectRefID } +func (e messageRejectError) IsBusinessReject() bool { return e.isBusinessReject } //NewMessageRejectError returns a MessageRejectError with the given error message, reject reason, and optional reftagid func NewMessageRejectError(err string, rejectReason int, refTagID *Tag) MessageRejectError { @@ -76,6 +82,12 @@ func NewBusinessMessageRejectError(err string, rejectReason int, refTagID *Tag) return messageRejectError{text: err, rejectReason: rejectReason, refTagID: refTagID, isBusinessReject: true} } +//NewBusinessMessageRejectErrorWithRefID returns a MessageRejectError with the given error mesage, reject reason, refID, and optional reftagid. +//Reject is treated as a business level reject +func NewBusinessMessageRejectErrorWithRefID(err string, rejectReason int, businessRejectRefID string, refTagID *Tag) MessageRejectError { + return messageRejectError{text: err, rejectReason: rejectReason, refTagID: refTagID, businessRejectRefID: businessRejectRefID, isBusinessReject: true} +} + //IncorrectDataFormatForValue returns an error indicating a field that cannot be parsed as the type required. func IncorrectDataFormatForValue(tag Tag) MessageRejectError { return NewMessageRejectError("Incorrect data format for value", rejectReasonIncorrectDataFormatForValue, &tag) diff --git a/errors_test.go b/errors_test.go index 56554af51..e612d3242 100644 --- a/errors_test.go +++ b/errors_test.go @@ -52,6 +52,33 @@ func TestNewBusinessMessageRejectError(t *testing.T) { } } +func TestNewBusinessMessageRejectErrorWithRefID(t *testing.T) { + var ( + expectedErrorString = "Custom error" + expectedRejectReason = 5 + expectedbusinessRejectRefID = "1" + expectedRefTagID Tag = 44 + expectedIsBusinessReject = true + ) + msgRej := NewBusinessMessageRejectErrorWithRefID(expectedErrorString, expectedRejectReason, expectedbusinessRejectRefID, &expectedRefTagID) + + if strings.Compare(msgRej.Error(), expectedErrorString) != 0 { + t.Errorf("expected: %s, got: %s\n", expectedErrorString, msgRej.Error()) + } + if msgRej.RejectReason() != expectedRejectReason { + t.Errorf("expected: %d, got: %d\n", expectedRejectReason, msgRej.RejectReason()) + } + if strings.Compare(msgRej.BusinessRejectRefID(), expectedbusinessRejectRefID) != 0 { + t.Errorf("expected: %s, got: %s\n", expectedbusinessRejectRefID, msgRej.BusinessRejectRefID()) + } + if *msgRej.RefTagID() != expectedRefTagID { + t.Errorf("expected: %d, got: %d\n", expectedRefTagID, msgRej.RefTagID()) + } + if msgRej.IsBusinessReject() != expectedIsBusinessReject { + t.Error("Expected IsBusinessReject to be true\n") + } +} + func TestIncorrectDataFormatForValue(t *testing.T) { var ( expectedErrorString = "Incorrect data format for value" diff --git a/session.go b/session.go index 6d6c1aa0c..7e2b43e9d 100644 --- a/session.go +++ b/session.go @@ -622,6 +622,9 @@ func (s *session) doReject(msg *Message, rej MessageRejectError) error { if rej.IsBusinessReject() { reply.Header.SetField(tagMsgType, FIXString("j")) reply.Body.SetField(tagBusinessRejectReason, FIXInt(rej.RejectReason())) + if refID := rej.BusinessRejectRefID(); refID != "" { + reply.Body.SetField(tagBusinessRejectRefID, FIXString(refID)) + } } else { reply.Header.SetField(tagMsgType, FIXString("3")) switch { diff --git a/tag.go b/tag.go index 800375e34..20fcda0b7 100644 --- a/tag.go +++ b/tag.go @@ -43,6 +43,7 @@ const ( tagBusinessRejectReason Tag = 380 tagSessionRejectReason Tag = 373 tagRefMsgType Tag = 372 + tagBusinessRejectRefID Tag = 379 tagRefTagID Tag = 371 tagRefSeqNum Tag = 45 tagEncryptMethod Tag = 98 From cdb8f39704a58cb28c00dd78dd075a5b52be9180 Mon Sep 17 00:00:00 2001 From: Li Ouyang Date: Thu, 12 Mar 2020 12:36:23 -0400 Subject: [PATCH 053/139] adds proxy wrapper around listener --- acceptor.go | 14 ++++++++++++++ config/configuration.go | 1 + go.mod | 1 + go.sum | 2 ++ 4 files changed, 18 insertions(+) diff --git a/acceptor.go b/acceptor.go index 62d17c91d..40ddff61a 100644 --- a/acceptor.go +++ b/acceptor.go @@ -10,6 +10,7 @@ import ( "strconv" "sync" + "github.com/armon/go-proxyproto" "github.com/quickfixgo/quickfix/config" ) @@ -52,11 +53,24 @@ func (a *Acceptor) Start() error { return err } + var useTCPProxy bool + if a.settings.GlobalSettings().HasSetting(config.UseTCPProxy) { + if useTCPProxy, err = a.settings.GlobalSettings().BoolSetting(config.UseTCPProxy); err != nil { + return err + } + } + address := net.JoinHostPort(socketAcceptHost, strconv.Itoa(socketAcceptPort)) if tlsConfig != nil { if a.listener, err = tls.Listen("tcp", address, tlsConfig); err != nil { return err } + } else if useTCPProxy { + listener, err := net.Listen("tcp", address) + if err != nil { + return err + } + a.listener = &proxyproto.Listener{Listener: listener} } else { if a.listener, err = net.Listen("tcp", address); err != nil { return err diff --git a/config/configuration.go b/config/configuration.go index ac74ff68a..fa8ac64e9 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -28,6 +28,7 @@ const ( ProxyHost string = "ProxyHost" ProxyPort string = "ProxyPort" ProxyUser string = "ProxyUser" + UseTCPProxy string = "UseTCPProxy" ProxyPassword string = "ProxyPassword" DefaultApplVerID string = "DefaultApplVerID" StartTime string = "StartTime" diff --git a/go.mod b/go.mod index 7a1c07b7d..5462ce888 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/quickfixgo/quickfix go 1.13 require ( + github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 github.com/mattn/go-sqlite3 v1.11.0 github.com/shopspring/decimal v0.0.0-20190905144223-a36b5d85f337 diff --git a/go.sum b/go.sum index ee9f475a9..3a464dcef 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 h1:dmVRVC/MmuwC2edm/P6oWIP+9n+p9IgVgK0lq9mBQjU= +github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= From 8a4d8ae9daac4b114745989b998675e7de6a4136 Mon Sep 17 00:00:00 2001 From: Li Ouyang Date: Fri, 13 Mar 2020 11:18:23 -0400 Subject: [PATCH 054/139] adds test --- accepter_test.go | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 accepter_test.go diff --git a/accepter_test.go b/accepter_test.go new file mode 100644 index 000000000..6924447fe --- /dev/null +++ b/accepter_test.go @@ -0,0 +1,56 @@ +package quickfix + +import ( + "net" + "testing" + + "github.com/armon/go-proxyproto" + "github.com/stretchr/testify/assert" +) + +func TestAcceptor_Start(t *testing.T) { + settingsWithTCPProxy := NewSettings() + settingsWithTCPProxy.GlobalSettings().Set("UseTCPProxy", "Y") + + settingsWithNoTCPProxy := NewSettings() + settingsWithNoTCPProxy.GlobalSettings().Set("UseTCPProxy", "N") + + genericSettings := NewSettings() + + const ( + GenericListener = iota + ProxyListener + ) + + acceptorStartTests := []struct { + name string + settings *Settings + listenerType int + }{ + {"with TCP proxy set", settingsWithTCPProxy, ProxyListener}, + {"with no TCP proxy set", settingsWithNoTCPProxy, GenericListener}, + {"no TCP proxy configuration set", genericSettings, GenericListener}, + } + + for _, tt := range acceptorStartTests { + t.Run(tt.name, func(t *testing.T) { + tt.settings.GlobalSettings().Set("SocketAcceptPort", "5001") + + acceptor := &Acceptor{settings: tt.settings} + if err := acceptor.Start(); err != nil { + assert.NotNil(t, err) + } + if tt.listenerType == ProxyListener { + _, ok := acceptor.listener.(*proxyproto.Listener) + assert.True(t, ok) + } + + if tt.listenerType == GenericListener { + _, ok := acceptor.listener.(*net.TCPListener) + assert.True(t, ok) + } + + acceptor.Stop() + }) + } +} \ No newline at end of file From 31410d3355868888faace2b6cee52ba91fcff2b8 Mon Sep 17 00:00:00 2001 From: Li Ouyang Date: Fri, 13 Mar 2020 11:28:08 -0400 Subject: [PATCH 055/139] add documentation --- config/configuration.go | 2 +- config/doc.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/configuration.go b/config/configuration.go index fa8ac64e9..adfd9ff54 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -28,8 +28,8 @@ const ( ProxyHost string = "ProxyHost" ProxyPort string = "ProxyPort" ProxyUser string = "ProxyUser" - UseTCPProxy string = "UseTCPProxy" ProxyPassword string = "ProxyPassword" + UseTCPProxy string = "UseTCPProxy" DefaultApplVerID string = "DefaultApplVerID" StartTime string = "StartTime" EndTime string = "EndTime" diff --git a/config/doc.go b/config/doc.go index 0538b7c5f..fa76b33d8 100644 --- a/config/doc.go +++ b/config/doc.go @@ -325,6 +325,10 @@ ProxyPassword Proxy password +UseTCPProxy + +Use TCP proxy for servers listening behind HAProxy of Amazon ELB load balancers. The server can then receive the address of the client instead of the load balancer's. + PersistMessages If set to N, no messages will be persisted. This will force QuickFIX/Go to always send GapFills instead of resending messages. Use this if you know you never want to resend a message. Useful for market data streams. Valid Values: From c0e92fb4dce91e2faa7f37d06f43bae74e254b45 Mon Sep 17 00:00:00 2001 From: Li Ouyang Date: Fri, 13 Mar 2020 11:30:53 -0400 Subject: [PATCH 056/139] add valid values --- config/doc.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/doc.go b/config/doc.go index fa76b33d8..d265e5544 100644 --- a/config/doc.go +++ b/config/doc.go @@ -327,7 +327,9 @@ Proxy password UseTCPProxy -Use TCP proxy for servers listening behind HAProxy of Amazon ELB load balancers. The server can then receive the address of the client instead of the load balancer's. +Use TCP proxy for servers listening behind HAProxy of Amazon ELB load balancers. The server can then receive the address of the client instead of the load balancer's. Valid Values: + Y + N PersistMessages From fa0822444cf774df8cfdd3492257b4a2c66a59ff Mon Sep 17 00:00:00 2001 From: Li Ouyang Date: Fri, 13 Mar 2020 11:31:32 -0400 Subject: [PATCH 057/139] replace space with tab --- config/doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/doc.go b/config/doc.go index d265e5544..eff831de9 100644 --- a/config/doc.go +++ b/config/doc.go @@ -327,7 +327,7 @@ Proxy password UseTCPProxy -Use TCP proxy for servers listening behind HAProxy of Amazon ELB load balancers. The server can then receive the address of the client instead of the load balancer's. Valid Values: +Use TCP proxy for servers listening behind HAProxy of Amazon ELB load balancers. The server can then receive the address of the client instead of the load balancer's. Valid Values: Y N From 7125fe83b848be3227d4d50073ae72b91a4bf89e Mon Sep 17 00:00:00 2001 From: Agustin Torres Date: Wed, 8 Apr 2020 15:43:35 -0400 Subject: [PATCH 058/139] Send error if connection is outside of session time Fixes Issue #401. --- session.go | 9 +++++++++ session_state.go | 6 ------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/session.go b/session.go index 6d6c1aa0c..73d4be4fb 100644 --- a/session.go +++ b/session.go @@ -702,6 +702,15 @@ func (s *session) onAdmin(msg interface{}) { return } + if !s.IsSessionTime() { + s.handleDisconnectState(s) + if msg.err != nil { + msg.err <- errors.New("Connection outside of session time") + close(msg.err) + } + return + } + if msg.err != nil { close(msg.err) } diff --git a/session_state.go b/session_state.go index c45ec9dda..c8b1f42a4 100644 --- a/session_state.go +++ b/session_state.go @@ -22,12 +22,6 @@ func (sm *stateMachine) Start(s *session) { } func (sm *stateMachine) Connect(session *session) { - if !sm.IsSessionTime() { - session.log.OnEvent("Connection outside of session time") - sm.handleDisconnectState(session) - return - } - // No special logon logic needed for FIX Acceptors. if !session.InitiateLogon { sm.setState(session, logonState{}) From b5d903cac712ca770f7cf74260c963c333026a12 Mon Sep 17 00:00:00 2001 From: Damien Whitten Date: Thu, 21 May 2020 21:48:38 +1000 Subject: [PATCH 059/139] PG Placeholders --- sqlstore.go | 58 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/sqlstore.go b/sqlstore.go index b16b0a74d..5a4a5d690 100644 --- a/sqlstore.go +++ b/sqlstore.go @@ -3,6 +3,7 @@ package quickfix import ( "database/sql" "fmt" + "regexp" "time" "github.com/quickfixgo/quickfix/config" @@ -19,6 +20,27 @@ type sqlStore struct { sqlDataSourceName string sqlConnMaxLifetime time.Duration db *sql.DB + placeholder placeholderFunc +} + +type placeholderFunc func(int) string + +var rePlaceholder = regexp.MustCompile(`\?`) + +func sqlString(raw string, placeholder placeholderFunc) string { + if placeholder == nil { + return raw + } + idx := 0 + return rePlaceholder.ReplaceAllStringFunc(raw, func(s string) string { + new := placeholder(idx) + idx += 1 + return new + }) +} + +func postgresPlaceholder(i int) string { + return fmt.Sprintf("$%d", i+1) } // NewSQLStoreFactory returns a sql-based implementation of MessageStoreFactory @@ -60,6 +82,10 @@ func newSQLStore(sessionID SessionID, driver string, dataSourceName string, conn } store.cache.Reset() + if store.sqlDriver == "postgres" { + store.placeholder = postgresPlaceholder + } + if store.db, err = sql.Open(store.sqlDriver, store.sqlDataSourceName); err != nil { return nil, err } @@ -78,10 +104,10 @@ func newSQLStore(sessionID SessionID, driver string, dataSourceName string, conn // Reset deletes the store records and sets the seqnums back to 1 func (store *sqlStore) Reset() error { s := store.sessionID - _, err := store.db.Exec(`DELETE FROM messages + _, err := store.db.Exec(sqlString(`DELETE FROM messages WHERE beginstring=? AND session_qualifier=? AND sendercompid=? AND sendersubid=? AND senderlocid=? - AND targetcompid=? AND targetsubid=? AND targetlocid=?`, + AND targetcompid=? AND targetsubid=? AND targetlocid=?`, store.placeholder), s.BeginString, s.Qualifier, s.SenderCompID, s.SenderSubID, s.SenderLocationID, s.TargetCompID, s.TargetSubID, s.TargetLocationID) @@ -93,11 +119,11 @@ func (store *sqlStore) Reset() error { return err } - _, err = store.db.Exec(`UPDATE sessions + _, err = store.db.Exec(sqlString(`UPDATE sessions SET creation_time=?, incoming_seqnum=?, outgoing_seqnum=? WHERE beginstring=? AND session_qualifier=? AND sendercompid=? AND sendersubid=? AND senderlocid=? - AND targetcompid=? AND targetsubid=? AND targetlocid=?`, + AND targetcompid=? AND targetsubid=? AND targetlocid=?`, store.placeholder), store.cache.CreationTime(), store.cache.NextTargetMsgSeqNum(), store.cache.NextSenderMsgSeqNum(), s.BeginString, s.Qualifier, s.SenderCompID, s.SenderSubID, s.SenderLocationID, @@ -118,11 +144,11 @@ func (store *sqlStore) populateCache() (err error) { s := store.sessionID var creationTime time.Time var incomingSeqNum, outgoingSeqNum int - row := store.db.QueryRow(`SELECT creation_time, incoming_seqnum, outgoing_seqnum + row := store.db.QueryRow(sqlString(`SELECT creation_time, incoming_seqnum, outgoing_seqnum FROM sessions WHERE beginstring=? AND session_qualifier=? AND sendercompid=? AND sendersubid=? AND senderlocid=? - AND targetcompid=? AND targetsubid=? AND targetlocid=?`, + AND targetcompid=? AND targetsubid=? AND targetlocid=?`, store.placeholder), s.BeginString, s.Qualifier, s.SenderCompID, s.SenderSubID, s.SenderLocationID, s.TargetCompID, s.TargetSubID, s.TargetLocationID) @@ -143,12 +169,12 @@ func (store *sqlStore) populateCache() (err error) { } // session record not found, create it - _, err = store.db.Exec(`INSERT INTO sessions ( + _, err = store.db.Exec(sqlString(`INSERT INTO sessions ( creation_time, incoming_seqnum, outgoing_seqnum, beginstring, session_qualifier, sendercompid, sendersubid, senderlocid, targetcompid, targetsubid, targetlocid) - VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, + VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, store.placeholder), store.cache.creationTime, store.cache.NextTargetMsgSeqNum(), store.cache.NextSenderMsgSeqNum(), @@ -172,10 +198,10 @@ func (store *sqlStore) NextTargetMsgSeqNum() int { // SetNextSenderMsgSeqNum sets the next MsgSeqNum that will be sent func (store *sqlStore) SetNextSenderMsgSeqNum(next int) error { s := store.sessionID - _, err := store.db.Exec(`UPDATE sessions SET outgoing_seqnum = ? + _, err := store.db.Exec(sqlString(`UPDATE sessions SET outgoing_seqnum = ? WHERE beginstring=? AND session_qualifier=? AND sendercompid=? AND sendersubid=? AND senderlocid=? - AND targetcompid=? AND targetsubid=? AND targetlocid=?`, + AND targetcompid=? AND targetsubid=? AND targetlocid=?`, store.placeholder), next, s.BeginString, s.Qualifier, s.SenderCompID, s.SenderSubID, s.SenderLocationID, s.TargetCompID, s.TargetSubID, s.TargetLocationID) @@ -188,10 +214,10 @@ func (store *sqlStore) SetNextSenderMsgSeqNum(next int) error { // SetNextTargetMsgSeqNum sets the next MsgSeqNum that should be received func (store *sqlStore) SetNextTargetMsgSeqNum(next int) error { s := store.sessionID - _, err := store.db.Exec(`UPDATE sessions SET incoming_seqnum = ? + _, err := store.db.Exec(sqlString(`UPDATE sessions SET incoming_seqnum = ? WHERE beginstring=? AND session_qualifier=? AND sendercompid=? AND sendersubid=? AND senderlocid=? - AND targetcompid=? AND targetsubid=? AND targetlocid=?`, + AND targetcompid=? AND targetsubid=? AND targetlocid=?`, store.placeholder), next, s.BeginString, s.Qualifier, s.SenderCompID, s.SenderSubID, s.SenderLocationID, s.TargetCompID, s.TargetSubID, s.TargetLocationID) @@ -221,12 +247,12 @@ func (store *sqlStore) CreationTime() time.Time { func (store *sqlStore) SaveMessage(seqNum int, msg []byte) error { s := store.sessionID - _, err := store.db.Exec(`INSERT INTO messages ( + _, err := store.db.Exec(sqlString(`INSERT INTO messages ( msgseqnum, message, beginstring, session_qualifier, sendercompid, sendersubid, senderlocid, targetcompid, targetsubid, targetlocid) - VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, + VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, store.placeholder), seqNum, string(msg), s.BeginString, s.Qualifier, s.SenderCompID, s.SenderSubID, s.SenderLocationID, @@ -238,12 +264,12 @@ func (store *sqlStore) SaveMessage(seqNum int, msg []byte) error { func (store *sqlStore) GetMessages(beginSeqNum, endSeqNum int) ([][]byte, error) { s := store.sessionID var msgs [][]byte - rows, err := store.db.Query(`SELECT message FROM messages + rows, err := store.db.Query(sqlString(`SELECT message FROM messages WHERE beginstring=? AND session_qualifier=? AND sendercompid=? AND sendersubid=? AND senderlocid=? AND targetcompid=? AND targetsubid=? AND targetlocid=? AND msgseqnum>=? AND msgseqnum<=? - ORDER BY msgseqnum`, + ORDER BY msgseqnum`, store.placeholder), s.BeginString, s.Qualifier, s.SenderCompID, s.SenderSubID, s.SenderLocationID, s.TargetCompID, s.TargetSubID, s.TargetLocationID, From 4ae1ecbe2a395a56f5b1618cb8d3ba062c0abe40 Mon Sep 17 00:00:00 2001 From: Damien Whitten Date: Fri, 29 May 2020 19:25:41 +1000 Subject: [PATCH 060/139] Replace func tests --- sqlstore_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sqlstore_test.go b/sqlstore_test.go index b252b2c25..da2c8a5a4 100644 --- a/sqlstore_test.go +++ b/sqlstore_test.go @@ -60,6 +60,11 @@ TargetCompID=%s`, sqlDriver, sqlDsn, sessionID.BeginString, sessionID.SenderComp require.Nil(suite.T(), err) } +func (suite *SQLStoreTestSuite) TestSqlPlaceholderReplacement() { + got := sqlString("A ? B ? C ?", postgresPlaceholder) + suite.Equal("A $1 B $2 C $3", got) +} + func (suite *SQLStoreTestSuite) TearDownTest() { suite.msgStore.Close() os.RemoveAll(suite.sqlStoreRootPath) From 05cb38be138325c437b3231c543d5140f121d518 Mon Sep 17 00:00:00 2001 From: Stanislav Cherviakov Date: Wed, 3 Jun 2020 12:59:06 +0300 Subject: [PATCH 061/139] Adding ConnectionValidator interface allowing to implement a custom authentication logic --- acceptor.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/acceptor.go b/acceptor.go index 62d17c91d..3680d7fd8 100644 --- a/acceptor.go +++ b/acceptor.go @@ -29,9 +29,26 @@ type Acceptor struct { dynamicQualifierCount int dynamicSessionChan chan *session sessionAddr map[SessionID]net.Addr + connectionValidator ConnectionValidator sessionFactory } +// ConnectionValidator is an interface allowing to implement a custom authentication logic. +type ConnectionValidator interface { + // Validate the connection for validity. This can be a part of authentication process. + // For example, you may tie up a SenderCompID to an IP range, or to a specific TLS certificate as a part of mTLS. + Validate(netConn net.Conn, session SessionID) error +} + +// SetConnectionValidator sets an optional connection validator. +// Use it when you need a custom authentication logic that includes lower level interactions, +// like mTLS auth or IP whitelistening. +// To remove a previously set validator call it with a nil value: +// a.SetConnectionValidator(nil) +func (a *Acceptor) SetConnectionValidator(validator ConnectionValidator) { + a.connectionValidator = validator +} + //Start accepting connections. func (a *Acceptor) Start() error { socketAcceptHost := "" @@ -253,6 +270,15 @@ func (a *Acceptor) handleConnection(netConn net.Conn) { SenderCompID: string(targetCompID), SenderSubID: string(targetSubID), SenderLocationID: string(targetLocationID), TargetCompID: string(senderCompID), TargetSubID: string(senderSubID), TargetLocationID: string(senderLocationID), } + + // We have a session ID and a network connection. This seems to be a good place for any custom authentication logic. + if a.connectionValidator != nil { + if err := a.connectionValidator.Validate(netConn, sessID); err != nil { + a.globalLog.OnEventf("Unable to validate a connection %v", err.Error()) + return + } + } + if a.dynamicQualifier { a.dynamicQualifierCount++ sessID.Qualifier = strconv.Itoa(a.dynamicQualifierCount) From 6f9c119bc29c3c814a471d7f34d37dc8c3f0fb72 Mon Sep 17 00:00:00 2001 From: Stanislav Cherviakov Date: Wed, 3 Jun 2020 13:07:10 +0300 Subject: [PATCH 062/139] Moved the new SetConnectionValidator method to the end of the file --- acceptor.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/acceptor.go b/acceptor.go index 3680d7fd8..5f9573541 100644 --- a/acceptor.go +++ b/acceptor.go @@ -40,15 +40,6 @@ type ConnectionValidator interface { Validate(netConn net.Conn, session SessionID) error } -// SetConnectionValidator sets an optional connection validator. -// Use it when you need a custom authentication logic that includes lower level interactions, -// like mTLS auth or IP whitelistening. -// To remove a previously set validator call it with a nil value: -// a.SetConnectionValidator(nil) -func (a *Acceptor) SetConnectionValidator(validator ConnectionValidator) { - a.connectionValidator = validator -} - //Start accepting connections. func (a *Acceptor) Start() error { socketAcceptHost := "" @@ -365,3 +356,12 @@ LOOP: } } } + +// SetConnectionValidator sets an optional connection validator. +// Use it when you need a custom authentication logic that includes lower level interactions, +// like mTLS auth or IP whitelistening. +// To remove a previously set validator call it with a nil value: +// a.SetConnectionValidator(nil) +func (a *Acceptor) SetConnectionValidator(validator ConnectionValidator) { + a.connectionValidator = validator +} From 2f40b51cafe4be73c668ed28bf8c5ea27cfef9f9 Mon Sep 17 00:00:00 2001 From: lenimartin <36175600+lenimartin@users.noreply.github.com> Date: Tue, 23 Jun 2020 15:36:34 +1000 Subject: [PATCH 063/139] Outrageous mistake I have not been able to sleep since I first saw that. --- initiator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initiator.go b/initiator.go index 030ea9570..3b6672395 100644 --- a/initiator.go +++ b/initiator.go @@ -109,7 +109,7 @@ func (i *Initiator) waitForInSessionTime(session *session) bool { return true } -//watiForReconnectInterval returns true if a reconnect should be re-attempted, false if handler should stop +//waitForReconnectInterval returns true if a reconnect should be re-attempted, false if handler should stop func (i *Initiator) waitForReconnectInterval(reconnectInterval time.Duration) bool { select { case <-time.After(reconnectInterval): From 5606f45d5fcfdce92701beaabd6648704ec2a4b6 Mon Sep 17 00:00:00 2001 From: Toshiyuki Tega Date: Mon, 29 Jun 2020 23:56:41 +0900 Subject: [PATCH 064/139] Specify TLS minimum version explicitly --- tls.go | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/tls.go b/tls.go index fa81a3808..7986c4f5a 100644 --- a/tls.go +++ b/tls.go @@ -39,6 +39,7 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) tlsConfig = defaultTLSConfig() tlsConfig.ServerName = serverName tlsConfig.InsecureSkipVerify = insecureSkipVerify + setMinVersionExplicit(settings, tlsConfig) } return } @@ -57,25 +58,7 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) tlsConfig.Certificates = make([]tls.Certificate, 1) tlsConfig.ServerName = serverName tlsConfig.InsecureSkipVerify = insecureSkipVerify - - minVersion := "TLS12" - if settings.HasSetting(config.SocketMinimumTLSVersion) { - minVersion, err = settings.Setting(config.SocketMinimumTLSVersion) - if err != nil { - return - } - - switch minVersion { - case "SSL30": - tlsConfig.MinVersion = tls.VersionSSL30 - case "TLS10": - tlsConfig.MinVersion = tls.VersionTLS10 - case "TLS11": - tlsConfig.MinVersion = tls.VersionTLS11 - case "TLS12": - tlsConfig.MinVersion = tls.VersionTLS12 - } - } + setMinVersionExplicit(settings, tlsConfig) if tlsConfig.Certificates[0], err = tls.LoadX509KeyPair(certificateFile, privateKeyFile); err != nil { return @@ -122,3 +105,23 @@ func defaultTLSConfig() *tls.Config { }, } } + +func setMinVersionExplicit(settings *SessionSettings, tlsConfig *tls.Config) { + if settings.HasSetting(config.SocketMinimumTLSVersion) { + minVersion, err := settings.Setting(config.SocketMinimumTLSVersion) + if err != nil { + return + } + + switch minVersion { + case "SSL30": + tlsConfig.MinVersion = tls.VersionSSL30 + case "TLS10": + tlsConfig.MinVersion = tls.VersionTLS10 + case "TLS11": + tlsConfig.MinVersion = tls.VersionTLS11 + case "TLS12": + tlsConfig.MinVersion = tls.VersionTLS12 + } + } +} From 01db019b5b0eee1c79647acc14154423341e669d Mon Sep 17 00:00:00 2001 From: chris busbey Date: Sun, 12 Jul 2020 14:07:19 -0500 Subject: [PATCH 065/139] enable golang ci github action --- .github/workflows/golangci-lint.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/golangci-lint.yaml diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml new file mode 100644 index 000000000..c634318df --- /dev/null +++ b/.github/workflows/golangci-lint.yaml @@ -0,0 +1,28 @@ +name: golangci-lint +on: + push: + tags: + - v* + branches: + - master + pull_request: +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v1 + with: + # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. + version: v1.26 + + # Optional: working directory, useful for monorepos + # working-directory: somedir + + # Optional: golangci-lint command line arguments. + # args: --issues-exit-code=0 + + # Optional: show only new issues if it's a pull request. The default value is `false`. + # only-new-issues: true \ No newline at end of file From aa4a4a1b687d7cddc94395432ed151b382e96248 Mon Sep 17 00:00:00 2001 From: chris busbey Date: Sun, 12 Jul 2020 14:41:21 -0500 Subject: [PATCH 066/139] updates libdecimal, adds pkg/errors --- go.mod | 5 +++-- go.sum | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 5462ce888..a14bc3981 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,8 @@ require ( github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 github.com/mattn/go-sqlite3 v1.11.0 - github.com/shopspring/decimal v0.0.0-20190905144223-a36b5d85f337 + github.com/pkg/errors v0.9.1 + github.com/shopspring/decimal v1.2.0 github.com/stretchr/testify v1.4.0 - golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 + golang.org/x/net v0.0.0-20200707034311-ab3426394381 ) diff --git a/go.sum b/go.sum index 3a464dcef..feef4ea61 100644 --- a/go.sum +++ b/go.sum @@ -6,18 +6,28 @@ github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7a github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/shopspring/decimal v0.0.0-20190905144223-a36b5d85f337 h1:Da9XEUfFxgyDOqUfwgoTDcWzmnlOnCGi6i4iPS+8Fbw= github.com/shopspring/decimal v0.0.0-20190905144223-a36b5d85f337/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 h1:qPnAdmjNA41t3QBTx2mFGf/SD1IoslhYu7AmdsVzCcs= golang.org/x/net v0.0.0-20190926025831-c00fd9afed17/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 7d13f9159580e9e086e43746acc65f4d13028350 Mon Sep 17 00:00:00 2001 From: chris busbey Date: Sun, 12 Jul 2020 14:42:44 -0500 Subject: [PATCH 067/139] some error checks, error wrapping --- filestore.go | 13 ++++++++++--- fileutil.go | 7 ++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/filestore.go b/filestore.go index aa2f7cde3..11f2b6fda 100644 --- a/filestore.go +++ b/filestore.go @@ -8,6 +8,7 @@ import ( "strconv" "time" + "github.com/pkg/errors" "github.com/quickfixgo/quickfix/config" ) @@ -81,9 +82,12 @@ func newFileStore(sessionID SessionID, dirname string) (*fileStore, error) { // Reset deletes the store files and sets the seqnums back to 1 func (store *fileStore) Reset() error { - store.cache.Reset() + if err := store.cache.Reset(); err != nil { + return errors.Wrap(err, "cache reset") + } + if err := store.Close(); err != nil { - return err + return errors.Wrap(err, "close") } if err := removeFile(store.bodyFname); err != nil { return err @@ -105,7 +109,10 @@ func (store *fileStore) Reset() error { // Refresh closes the store files and then reloads from them func (store *fileStore) Refresh() (err error) { - store.cache.Reset() + if err = store.cache.Reset(); err != nil { + err = errors.Wrap(err, "cache reset") + return + } if err = store.Close(); err != nil { return err diff --git a/fileutil.go b/fileutil.go index 9fa11c964..5334f271c 100644 --- a/fileutil.go +++ b/fileutil.go @@ -4,6 +4,8 @@ import ( "fmt" "os" "strings" + + "github.com/pkg/errors" ) func sessionIDFilenamePrefix(s SessionID) string { @@ -44,9 +46,8 @@ func closeFile(f *os.File) error { // removeFile behaves like os.Remove, except that no error is returned if the file does not exist func removeFile(fname string) error { - err := os.Remove(fname) - if (err != nil) && !os.IsNotExist(err) { - return err + if err := os.Remove(fname); (err != nil) && !os.IsNotExist(err) { + return errors.Wrapf(err, "remove %v", fname) } return nil } From dce380011ad88b70ec422266820e65ad6eb61d6f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2020 11:53:45 +0000 Subject: [PATCH 068/139] Bump github.com/mattn/go-sqlite3 from 1.11.0 to 1.14.0 Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.11.0 to 1.14.0. - [Release notes](https://github.com/mattn/go-sqlite3/releases) - [Commits](https://github.com/mattn/go-sqlite3/compare/v1.11.0...v1.14.0) Signed-off-by: dependabot-preview[bot] --- go.mod | 2 +- go.sum | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a14bc3981..f9bea3111 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 - github.com/mattn/go-sqlite3 v1.11.0 + github.com/mattn/go-sqlite3 v1.14.0 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 github.com/stretchr/testify v1.4.0 diff --git a/go.sum b/go.sum index feef4ea61..544891f4f 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= +github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 h1:dmVRVC/MmuwC2edm/P6oWIP+9n+p9IgVgK0lq9mBQjU= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= @@ -6,6 +8,8 @@ github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7a github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA= +github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -20,9 +24,12 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 h1:qPnAdmjNA41t3QBTx2mFGf/SD1IoslhYu7AmdsVzCcs= golang.org/x/net v0.0.0-20190926025831-c00fd9afed17/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From 52c31f54d6db9b2a439b1a8b83e7ada4ae7b0f05 Mon Sep 17 00:00:00 2001 From: chris busbey Date: Mon, 13 Jul 2020 07:31:01 -0500 Subject: [PATCH 069/139] some very low hanging lint fixes --- datadictionary/datadictionary.go | 8 ++------ datadictionary/datadictionary_test.go | 6 +++--- field_map_test.go | 2 +- file_log_test.go | 4 ++-- fix_int_test.go | 2 +- parser_test.go | 2 +- repeating_group.go | 2 +- session_factory_test.go | 14 +++++++------- store.go | 10 ++++++++-- validation.go | 2 +- 10 files changed, 27 insertions(+), 25 deletions(-) diff --git a/datadictionary/datadictionary.go b/datadictionary/datadictionary.go index 410ca8ee1..4623b83be 100644 --- a/datadictionary/datadictionary.go +++ b/datadictionary/datadictionary.go @@ -197,9 +197,7 @@ func (f FieldDef) childTags() []int { for _, f := range f.Fields { tags = append(tags, f.Tag()) - for _, t := range f.childTags() { - tags = append(tags, t) - } + tags = append(tags, f.childTags()...) } return tags @@ -214,9 +212,7 @@ func (f FieldDef) requiredChildTags() []int { } tags = append(tags, f.Tag()) - for _, t := range f.requiredChildTags() { - tags = append(tags, t) - } + tags = append(tags, f.requiredChildTags()...) } return tags diff --git a/datadictionary/datadictionary_test.go b/datadictionary/datadictionary_test.go index 4179716c5..11d98bfca 100644 --- a/datadictionary/datadictionary_test.go +++ b/datadictionary/datadictionary_test.go @@ -82,7 +82,7 @@ func TestFieldsByTag(t *testing.T) { func TestEnumFieldsByTag(t *testing.T) { d, _ := dict() - f, _ := d.FieldTypeByTag[658] + f := d.FieldTypeByTag[658] var tests = []struct { Value string @@ -141,7 +141,7 @@ func TestDataDictionaryTrailer(t *testing.T) { func TestMessageRequiredTags(t *testing.T) { d, _ := dict() - nos, _ := d.Messages["D"] + nos := d.Messages["D"] var tests = []struct { *MessageDef @@ -169,7 +169,7 @@ func TestMessageRequiredTags(t *testing.T) { func TestMessageTags(t *testing.T) { d, _ := dict() - nos, _ := d.Messages["D"] + nos := d.Messages["D"] var tests = []struct { *MessageDef diff --git a/field_map_test.go b/field_map_test.go index c984f7c45..f07f6f396 100644 --- a/field_map_test.go +++ b/field_map_test.go @@ -157,7 +157,7 @@ func TestFieldMap_CopyInto(t *testing.T) { assert.Equal(t, "a", s) // old fields cleared - s, err = fMapB.GetString(3) + _, err = fMapB.GetString(3) assert.NotNil(t, err) // check that ordering is overwritten diff --git a/file_log_test.go b/file_log_test.go index b807dca42..3358dc20a 100644 --- a/file_log_test.go +++ b/file_log_test.go @@ -11,7 +11,7 @@ import ( func TestFileLog_NewFileLogFactory(t *testing.T) { - factory, err := NewFileLogFactory(NewSettings()) + _, err := NewFileLogFactory(NewSettings()) if err == nil { t.Error("Should expect error when settings have no file log path") @@ -39,7 +39,7 @@ SessionQualifier=BS stringReader := strings.NewReader(cfg) settings, _ := ParseSettings(stringReader) - factory, err = NewFileLogFactory(settings) + factory, err := NewFileLogFactory(settings) if err != nil { t.Error("Did not expect error", err) diff --git a/fix_int_test.go b/fix_int_test.go index 173cb5ee5..64142c045 100644 --- a/fix_int_test.go +++ b/fix_int_test.go @@ -32,6 +32,6 @@ func BenchmarkFIXInt_Read(b *testing.B) { var field FIXInt for i := 0; i < b.N; i++ { - field.Read(intBytes) + _ = field.Read(intBytes) } } diff --git a/parser_test.go b/parser_test.go index ab9c086a7..533691986 100644 --- a/parser_test.go +++ b/parser_test.go @@ -13,7 +13,7 @@ func BenchmarkParser_ReadMessage(b *testing.B) { for i := 0; i < b.N; i++ { reader := strings.NewReader(stream) parser := newParser(reader) - parser.ReadMessage() + _, _ = parser.ReadMessage() } } diff --git a/repeating_group.go b/repeating_group.go index d3bc4a58c..811379c37 100644 --- a/repeating_group.go +++ b/repeating_group.go @@ -109,7 +109,7 @@ func (f *RepeatingGroup) Add() *Group { //Write returns tagValues for all Items in the repeating group ordered by //Group sequence and Group template order func (f RepeatingGroup) Write() []TagValue { - tvs := make([]TagValue, 1, 1) + tvs := make([]TagValue, 1) tvs[0].init(f.tag, []byte(strconv.Itoa(len(f.groups)))) for _, group := range f.groups { diff --git a/session_factory_test.go b/session_factory_test.go index a560843f7..88f08f1aa 100644 --- a/session_factory_test.go +++ b/session_factory_test.go @@ -129,7 +129,7 @@ func (s *SessionFactorySuite) TestResendRequestChunkSize() { s.Equal(2500, session.ResendRequestChunkSize) s.SessionSettings.Set(config.ResendRequestChunkSize, "notanint") - session, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + _, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) s.NotNil(err) } @@ -518,7 +518,7 @@ func (s *SessionFactorySuite) TestConfigureSocketConnectAddressMulti() { func (s *SessionFactorySuite) TestNewSessionTimestampPrecision() { s.SessionSettings.Set(config.TimeStampPrecision, "blah") - session, err := s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + _, err := s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) s.NotNil(err) var tests = []struct { @@ -533,7 +533,7 @@ func (s *SessionFactorySuite) TestNewSessionTimestampPrecision() { for _, test := range tests { s.SessionSettings.Set(config.TimeStampPrecision, test.config) - session, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + session, err := s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) s.Nil(err) s.Equal(session.timestampPrecision, test.precision) @@ -542,19 +542,19 @@ func (s *SessionFactorySuite) TestNewSessionTimestampPrecision() { func (s *SessionFactorySuite) TestNewSessionMaxLatency() { s.SessionSettings.Set(config.MaxLatency, "not a number") - session, err := s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + _, err := s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) s.NotNil(err, "MaxLatency must be a number") s.SessionSettings.Set(config.MaxLatency, "-20") - session, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + _, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) s.NotNil(err, "MaxLatency must be positive") s.SessionSettings.Set(config.MaxLatency, "0") - session, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + _, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) s.NotNil(err, "MaxLatency must be positive") s.SessionSettings.Set(config.MaxLatency, "20") - session, err = s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + session, err := s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) s.Nil(err) s.Equal(session.MaxLatency, 20*time.Second) } diff --git a/store.go b/store.go index 837bbca13..41b6bc0c0 100644 --- a/store.go +++ b/store.go @@ -1,6 +1,10 @@ package quickfix -import "time" +import ( + "time" + + "github.com/pkg/errors" +) //The MessageStore interface provides methods to record and retrieve messages for resend purposes type MessageStore interface { @@ -107,7 +111,9 @@ type memoryStoreFactory struct{} func (f memoryStoreFactory) Create(sessionID SessionID) (MessageStore, error) { m := new(memoryStore) - m.Reset() + if err := m.Reset(); err != nil { + return m, errors.Wrap(err, "reset") + } return m, nil } diff --git a/validation.go b/validation.go index dc17abc58..59edfac31 100644 --- a/validation.go +++ b/validation.go @@ -116,7 +116,7 @@ func validateFIXT(transportDD, appDD *datadictionary.DataDictionary, settings va } func validateMsgType(d *datadictionary.DataDictionary, msgType string, msg *Message) MessageRejectError { - if _, validMsgType := d.Messages[msgType]; validMsgType == false { + if _, validMsgType := d.Messages[msgType]; !validMsgType { return InvalidMessageType() } return nil From dbc66e732f07fb31b5c01f2947dd497f05bb0e78 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2020 14:36:15 +0000 Subject: [PATCH 070/139] Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.4.0 to 1.6.1. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.4.0...v1.6.1) Signed-off-by: dependabot-preview[bot] --- go.mod | 2 +- go.sum | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index f9bea3111..0b72b49d9 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,6 @@ require ( github.com/mattn/go-sqlite3 v1.14.0 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 - github.com/stretchr/testify v1.4.0 + github.com/stretchr/testify v1.6.1 golang.org/x/net v0.0.0-20200707034311-ab3426394381 ) diff --git a/go.sum b/go.sum index 544891f4f..ee5907a8a 100644 --- a/go.sum +++ b/go.sum @@ -22,6 +22,8 @@ github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -40,3 +42,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 1237d95143f445d583d6f762e943ae1aa0f1350d Mon Sep 17 00:00:00 2001 From: chris busbey Date: Mon, 13 Jul 2020 18:20:20 -0500 Subject: [PATCH 071/139] misc delint --- fileutil_test.go | 1 + session_test.go | 6 ++-- sqlstore.go | 14 ++++++-- store_test.go | 90 ++++++++++++++++++++++-------------------------- tls.go | 1 + tls_test.go | 1 + 6 files changed, 59 insertions(+), 54 deletions(-) diff --git a/fileutil_test.go b/fileutil_test.go index 4817c7862..f634651df 100644 --- a/fileutil_test.go +++ b/fileutil_test.go @@ -53,6 +53,7 @@ func TestOpenOrCreateFile(t *testing.T) { // Then it should be created f, err := openOrCreateFile(fname, 0664) + require.Nil(t, err) requireFileExists(t, fname) // When the file already exists diff --git a/session_test.go b/session_test.go index 33c7cf417..293b94805 100644 --- a/session_test.go +++ b/session_test.go @@ -276,8 +276,8 @@ func (s *SessionSuite) TestShouldSendReset() { s.session.ResetOnDisconnect = test.ResetOnDisconnect s.session.ResetOnLogout = test.ResetOnLogout - s.MockStore.SetNextSenderMsgSeqNum(test.NextSenderMsgSeqNum) - s.MockStore.SetNextTargetMsgSeqNum(test.NextTargetMsgSeqNum) + s.Require().Nil(s.MockStore.SetNextSenderMsgSeqNum(test.NextSenderMsgSeqNum)) + s.Require().Nil(s.MockStore.SetNextTargetMsgSeqNum(test.NextTargetMsgSeqNum)) s.Equal(s.shouldSendReset(), test.Expected) } @@ -944,7 +944,7 @@ func (suite *SessionSendTestSuite) TestDropAndSendDropsQueueWithReset() { suite.NoMessageSent() suite.MockApp.On("ToAdmin") - suite.MockStore.Reset() + suite.Require().Nil(suite.MockStore.Reset()) require.Nil(suite.T(), suite.dropAndSend(suite.Logon())) suite.MockApp.AssertExpectations(suite.T()) msg := suite.MockApp.lastToAdmin diff --git a/sqlstore.go b/sqlstore.go index b16b0a74d..01eb87332 100644 --- a/sqlstore.go +++ b/sqlstore.go @@ -5,6 +5,7 @@ import ( "fmt" "time" + "github.com/pkg/errors" "github.com/quickfixgo/quickfix/config" ) @@ -58,7 +59,10 @@ func newSQLStore(sessionID SessionID, driver string, dataSourceName string, conn sqlDataSourceName: dataSourceName, sqlConnMaxLifetime: connMaxLifetime, } - store.cache.Reset() + if err = store.cache.Reset(); err != nil { + err = errors.Wrap(err, "cache reset") + return + } if store.db, err = sql.Open(store.sqlDriver, store.sqlDataSourceName); err != nil { return nil, err @@ -203,13 +207,17 @@ func (store *sqlStore) SetNextTargetMsgSeqNum(next int) error { // IncrNextSenderMsgSeqNum increments the next MsgSeqNum that will be sent func (store *sqlStore) IncrNextSenderMsgSeqNum() error { - store.cache.IncrNextSenderMsgSeqNum() + if err := store.cache.IncrNextSenderMsgSeqNum(); err != nil { + return errors.Wrap(err, "cache incr next") + } return store.SetNextSenderMsgSeqNum(store.cache.NextSenderMsgSeqNum()) } // IncrNextTargetMsgSeqNum increments the next MsgSeqNum that should be received func (store *sqlStore) IncrNextTargetMsgSeqNum() error { - store.cache.IncrNextTargetMsgSeqNum() + if err := store.cache.IncrNextTargetMsgSeqNum(); err != nil { + return errors.Wrap(err, "cache incr next") + } return store.SetNextTargetMsgSeqNum(store.cache.NextTargetMsgSeqNum()) } diff --git a/store_test.go b/store_test.go index a61ccbb05..185704e52 100644 --- a/store_test.go +++ b/store_test.go @@ -30,61 +30,55 @@ func TestMemoryStoreTestSuite(t *testing.T) { suite.Run(t, new(MemoryStoreTestSuite)) } -func (suite *MessageStoreTestSuite) TestMessageStore_SetNextMsgSeqNum_Refresh_IncrNextMsgSeqNum() { - t := suite.T() - +func (s *MessageStoreTestSuite) TestMessageStore_SetNextMsgSeqNum_Refresh_IncrNextMsgSeqNum() { // Given a MessageStore with the following sender and target seqnums - suite.msgStore.SetNextSenderMsgSeqNum(867) - suite.msgStore.SetNextTargetMsgSeqNum(5309) + s.Require().Nil(s.msgStore.SetNextSenderMsgSeqNum(867)) + s.Require().Nil(s.msgStore.SetNextTargetMsgSeqNum(5309)) // When the store is refreshed from its backing store - suite.msgStore.Refresh() + s.Require().Nil(s.msgStore.Refresh()) // Then the sender and target seqnums should still be - assert.Equal(t, 867, suite.msgStore.NextSenderMsgSeqNum()) - assert.Equal(t, 5309, suite.msgStore.NextTargetMsgSeqNum()) + s.Equal(867, s.msgStore.NextSenderMsgSeqNum()) + s.Equal(5309, s.msgStore.NextTargetMsgSeqNum()) // When the sender and target seqnums are incremented - require.Nil(t, suite.msgStore.IncrNextSenderMsgSeqNum()) - require.Nil(t, suite.msgStore.IncrNextTargetMsgSeqNum()) + s.Require().Nil(s.msgStore.IncrNextSenderMsgSeqNum()) + s.Require().Nil(s.msgStore.IncrNextTargetMsgSeqNum()) // Then the sender and target seqnums should be - assert.Equal(t, 868, suite.msgStore.NextSenderMsgSeqNum()) - assert.Equal(t, 5310, suite.msgStore.NextTargetMsgSeqNum()) + s.Equal(868, s.msgStore.NextSenderMsgSeqNum()) + s.Equal(5310, s.msgStore.NextTargetMsgSeqNum()) // When the store is refreshed from its backing store - suite.msgStore.Refresh() + s.Require().Nil(s.msgStore.Refresh()) // Then the sender and target seqnums should still be - assert.Equal(t, 868, suite.msgStore.NextSenderMsgSeqNum()) - assert.Equal(t, 5310, suite.msgStore.NextTargetMsgSeqNum()) + s.Equal(868, s.msgStore.NextSenderMsgSeqNum()) + s.Equal(5310, s.msgStore.NextTargetMsgSeqNum()) } -func (suite *MessageStoreTestSuite) TestMessageStore_Reset() { - t := suite.T() - +func (s *MessageStoreTestSuite) TestMessageStore_Reset() { // Given a MessageStore with the following sender and target seqnums - suite.msgStore.SetNextSenderMsgSeqNum(1234) - suite.msgStore.SetNextTargetMsgSeqNum(5678) + s.Require().Nil(s.msgStore.SetNextSenderMsgSeqNum(1234)) + s.Require().Nil(s.msgStore.SetNextTargetMsgSeqNum(5678)) // When the store is reset - require.Nil(t, suite.msgStore.Reset()) + s.Require().Nil(s.msgStore.Reset()) // Then the sender and target seqnums should be - assert.Equal(t, 1, suite.msgStore.NextSenderMsgSeqNum()) - assert.Equal(t, 1, suite.msgStore.NextTargetMsgSeqNum()) + s.Equal(1, s.msgStore.NextSenderMsgSeqNum()) + s.Equal(1, s.msgStore.NextTargetMsgSeqNum()) // When the store is refreshed from its backing store - suite.msgStore.Refresh() + s.Require().Nil(s.msgStore.Refresh()) // Then the sender and target seqnums should still be - assert.Equal(t, 1, suite.msgStore.NextSenderMsgSeqNum()) - assert.Equal(t, 1, suite.msgStore.NextTargetMsgSeqNum()) + s.Equal(1, s.msgStore.NextSenderMsgSeqNum()) + s.Equal(1, s.msgStore.NextTargetMsgSeqNum()) } -func (suite *MessageStoreTestSuite) TestMessageStore_SaveMessage_GetMessage() { - t := suite.T() - +func (s *MessageStoreTestSuite) TestMessageStore_SaveMessage_GetMessage() { // Given the following saved messages expectedMsgsBySeqNum := map[int]string{ 1: "In the frozen land of Nador", @@ -92,31 +86,31 @@ func (suite *MessageStoreTestSuite) TestMessageStore_SaveMessage_GetMessage() { 3: "and there was much rejoicing", } for seqNum, msg := range expectedMsgsBySeqNum { - require.Nil(t, suite.msgStore.SaveMessage(seqNum, []byte(msg))) + s.Require().Nil(s.msgStore.SaveMessage(seqNum, []byte(msg))) } // When the messages are retrieved from the MessageStore - actualMsgs, err := suite.msgStore.GetMessages(1, 3) - require.Nil(t, err) + actualMsgs, err := s.msgStore.GetMessages(1, 3) + s.Require().Nil(err) // Then the messages should be - require.Len(t, actualMsgs, 3) - assert.Equal(t, expectedMsgsBySeqNum[1], string(actualMsgs[0])) - assert.Equal(t, expectedMsgsBySeqNum[2], string(actualMsgs[1])) - assert.Equal(t, expectedMsgsBySeqNum[3], string(actualMsgs[2])) + s.Require().Len(actualMsgs, 3) + s.Equal(expectedMsgsBySeqNum[1], string(actualMsgs[0])) + s.Equal(expectedMsgsBySeqNum[2], string(actualMsgs[1])) + s.Equal(expectedMsgsBySeqNum[3], string(actualMsgs[2])) // When the store is refreshed from its backing store - suite.msgStore.Refresh() + s.Require().Nil(s.msgStore.Refresh()) // And the messages are retrieved from the MessageStore - actualMsgs, err = suite.msgStore.GetMessages(1, 3) - require.Nil(t, err) + actualMsgs, err = s.msgStore.GetMessages(1, 3) + s.Require().Nil(err) // Then the messages should still be - require.Len(t, actualMsgs, 3) - assert.Equal(t, expectedMsgsBySeqNum[1], string(actualMsgs[0])) - assert.Equal(t, expectedMsgsBySeqNum[2], string(actualMsgs[1])) - assert.Equal(t, expectedMsgsBySeqNum[3], string(actualMsgs[2])) + s.Require().Len(actualMsgs, 3) + s.Equal(expectedMsgsBySeqNum[1], string(actualMsgs[0])) + s.Equal(expectedMsgsBySeqNum[2], string(actualMsgs[1])) + s.Equal(expectedMsgsBySeqNum[3], string(actualMsgs[2])) } func (suite *MessageStoreTestSuite) TestMessageStore_GetMessages_EmptyStore() { @@ -163,12 +157,12 @@ func (suite *MessageStoreTestSuite) TestMessageStore_GetMessages_VariousRanges() } } -func (suite *MessageStoreTestSuite) TestMessageStore_CreationTime() { - assert.False(suite.T(), suite.msgStore.CreationTime().IsZero()) +func (s *MessageStoreTestSuite) TestMessageStore_CreationTime() { + s.False(s.msgStore.CreationTime().IsZero()) t0 := time.Now() - suite.msgStore.Reset() + s.Require().Nil(s.msgStore.Reset()) t1 := time.Now() - require.True(suite.T(), suite.msgStore.CreationTime().After(t0)) - require.True(suite.T(), suite.msgStore.CreationTime().Before(t1)) + s.Require().True(s.msgStore.CreationTime().After(t0)) + s.Require().True(s.msgStore.CreationTime().Before(t1)) } diff --git a/tls.go b/tls.go index 7986c4f5a..951ac7e87 100644 --- a/tls.go +++ b/tls.go @@ -115,6 +115,7 @@ func setMinVersionExplicit(settings *SessionSettings, tlsConfig *tls.Config) { switch minVersion { case "SSL30": + //nolint:staticcheck // SA1019 min version ok tlsConfig.MinVersion = tls.VersionSSL30 case "TLS10": tlsConfig.MinVersion = tls.VersionTLS10 diff --git a/tls_test.go b/tls_test.go index a858dc6db..fe6745a19 100644 --- a/tls_test.go +++ b/tls_test.go @@ -150,6 +150,7 @@ func (s *TLSTestSuite) TestMinimumTLSVersion() { s.Nil(err) s.NotNil(tlsConfig) + //nolint:staticcheck s.Equal(tlsConfig.MinVersion, uint16(tls.VersionSSL30)) // TLS10 From 6fb31779a0a5b46020389fa72c9d2658c75d12a7 Mon Sep 17 00:00:00 2001 From: chris busbey Date: Tue, 14 Jul 2020 06:56:38 -0500 Subject: [PATCH 072/139] delint mongo error handling --- mongostore.go | 60 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/mongostore.go b/mongostore.go index 76789dbe9..e50af2c16 100644 --- a/mongostore.go +++ b/mongostore.go @@ -6,7 +6,7 @@ import ( "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" - + "github.com/pkg/errors" "github.com/quickfixgo/quickfix/config" ) @@ -66,7 +66,11 @@ func newMongoStore(sessionID SessionID, mongoURL string, mongoDatabase string, m messagesCollection: messagesCollection, sessionsCollection: sessionsCollection, } - store.cache.Reset() + + if err = store.cache.Reset(); err != nil { + err = errors.Wrap(err, "cache reset") + return + } if store.db, err = mgo.Dial(mongoURL); err != nil { return @@ -139,27 +143,43 @@ func (store *mongoStore) Refresh() error { return store.populateCache() } -func (store *mongoStore) populateCache() (err error) { +func (store *mongoStore) populateCache() error { msgFilter := generateMessageFilter(&store.sessionID) query := store.db.DB(store.mongoDatabase).C(store.sessionsCollection).Find(msgFilter) - if cnt, err := query.Count(); err == nil && cnt > 0 { + cnt, err := query.Count() + if err != nil { + return errors.Wrap(err, "count") + } + + if cnt > 0 { // session record found, load it sessionData := &mongoQuickFixEntryData{} - err = query.One(&sessionData) - if err == nil { - store.cache.creationTime = sessionData.CreationTime - store.cache.SetNextTargetMsgSeqNum(sessionData.IncomingSeqNum) - store.cache.SetNextSenderMsgSeqNum(sessionData.OutgoingSeqNum) + if err = query.One(&sessionData); err != nil { + return errors.Wrap(err, "query one") + } + + store.cache.creationTime = sessionData.CreationTime + if err = store.cache.SetNextTargetMsgSeqNum(sessionData.IncomingSeqNum); err != nil { + return errors.Wrap(err, "cache set next target") } - } else if err == nil && cnt == 0 { - // session record not found, create it - msgFilter.CreationTime = store.cache.creationTime - msgFilter.IncomingSeqNum = store.cache.NextTargetMsgSeqNum() - msgFilter.OutgoingSeqNum = store.cache.NextSenderMsgSeqNum() - err = store.db.DB(store.mongoDatabase).C(store.sessionsCollection).Insert(msgFilter) + + if err = store.cache.SetNextSenderMsgSeqNum(sessionData.OutgoingSeqNum); err != nil { + return errors.Wrap(err, "cache set next sender") + } + + return nil } - return + + // session record not found, create it + msgFilter.CreationTime = store.cache.creationTime + msgFilter.IncomingSeqNum = store.cache.NextTargetMsgSeqNum() + msgFilter.OutgoingSeqNum = store.cache.NextSenderMsgSeqNum() + + if err = store.db.DB(store.mongoDatabase).C(store.sessionsCollection).Insert(msgFilter); err != nil { + return errors.Wrap(err, "insert") + } + return nil } // NextSenderMsgSeqNum returns the next MsgSeqNum that will be sent @@ -200,13 +220,17 @@ func (store *mongoStore) SetNextTargetMsgSeqNum(next int) error { // IncrNextSenderMsgSeqNum increments the next MsgSeqNum that will be sent func (store *mongoStore) IncrNextSenderMsgSeqNum() error { - store.cache.IncrNextSenderMsgSeqNum() + if err := store.cache.IncrNextSenderMsgSeqNum(); err != nil { + return errors.Wrap(err, "cache incr") + } return store.SetNextSenderMsgSeqNum(store.cache.NextSenderMsgSeqNum()) } // IncrNextTargetMsgSeqNum increments the next MsgSeqNum that should be received func (store *mongoStore) IncrNextTargetMsgSeqNum() error { - store.cache.IncrNextTargetMsgSeqNum() + if err := store.cache.IncrNextTargetMsgSeqNum(); err != nil { + return errors.Wrap(err, "cache incr") + } return store.SetNextTargetMsgSeqNum(store.cache.NextTargetMsgSeqNum()) } From b77b5c01cb9b209bcea71eee9b4d1b6ca21ccddb Mon Sep 17 00:00:00 2001 From: chris busbey Date: Tue, 14 Jul 2020 19:44:05 -0500 Subject: [PATCH 073/139] more delint --- filestore.go | 38 +++++++++++++++++++++++++++---------- internal/time_range_test.go | 1 + sqlstore.go | 12 ++++++++---- 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/filestore.go b/filestore.go index 11f2b6fda..6d010f897 100644 --- a/filestore.go +++ b/filestore.go @@ -2,6 +2,7 @@ package quickfix import ( "fmt" + "io" "io/ioutil" "os" "path" @@ -145,8 +146,13 @@ func (store *fileStore) Refresh() (err error) { } } - store.SetNextSenderMsgSeqNum(store.NextSenderMsgSeqNum()) - store.SetNextTargetMsgSeqNum(store.NextTargetMsgSeqNum()) + if err := store.SetNextSenderMsgSeqNum(store.NextSenderMsgSeqNum()); err != nil { + return errors.Wrap(err, "set next sender") + } + + if err := store.SetNextTargetMsgSeqNum(store.NextTargetMsgSeqNum()); err != nil { + return errors.Wrap(err, "set next target") + } return nil } @@ -173,13 +179,17 @@ func (store *fileStore) populateCache() (creationTimePopulated bool, err error) if senderSeqNumBytes, err := ioutil.ReadFile(store.senderSeqNumsFname); err == nil { if senderSeqNum, err := strconv.Atoi(string(senderSeqNumBytes)); err == nil { - store.cache.SetNextSenderMsgSeqNum(senderSeqNum) + if err = store.cache.SetNextSenderMsgSeqNum(senderSeqNum); err != nil { + return creationTimePopulated, errors.Wrap(err, "cache set next sender") + } } } if targetSeqNumBytes, err := ioutil.ReadFile(store.targetSeqNumsFname); err == nil { if targetSeqNum, err := strconv.Atoi(string(targetSeqNumBytes)); err == nil { - store.cache.SetNextTargetMsgSeqNum(targetSeqNum) + if err = store.cache.SetNextTargetMsgSeqNum(targetSeqNum); err != nil { + return creationTimePopulated, errors.Wrap(err, "cache set next target") + } } } @@ -187,7 +197,7 @@ func (store *fileStore) populateCache() (creationTimePopulated bool, err error) } func (store *fileStore) setSession() error { - if _, err := store.sessionFile.Seek(0, os.SEEK_SET); err != nil { + if _, err := store.sessionFile.Seek(0, io.SeekStart); err != nil { return fmt.Errorf("unable to rewind file: %s: %s", store.sessionFname, err.Error()) } @@ -205,7 +215,7 @@ func (store *fileStore) setSession() error { } func (store *fileStore) setSeqNum(f *os.File, seqNum int) error { - if _, err := f.Seek(0, os.SEEK_SET); err != nil { + if _, err := f.Seek(0, io.SeekStart); err != nil { return fmt.Errorf("unable to rewind file: %s: %s", f.Name(), err.Error()) } if _, err := fmt.Fprintf(f, "%019d", seqNum); err != nil { @@ -229,25 +239,33 @@ func (store *fileStore) NextTargetMsgSeqNum() int { // SetNextSenderMsgSeqNum sets the next MsgSeqNum that will be sent func (store *fileStore) SetNextSenderMsgSeqNum(next int) error { - store.cache.SetNextSenderMsgSeqNum(next) + if err := store.cache.SetNextSenderMsgSeqNum(next); err != nil { + return errors.Wrap(err, "cache") + } return store.setSeqNum(store.senderSeqNumsFile, next) } // SetNextTargetMsgSeqNum sets the next MsgSeqNum that should be received func (store *fileStore) SetNextTargetMsgSeqNum(next int) error { - store.cache.SetNextTargetMsgSeqNum(next) + if err := store.cache.SetNextTargetMsgSeqNum(next); err != nil { + return errors.Wrap(err, "cache") + } return store.setSeqNum(store.targetSeqNumsFile, next) } // IncrNextSenderMsgSeqNum increments the next MsgSeqNum that will be sent func (store *fileStore) IncrNextSenderMsgSeqNum() error { - store.cache.IncrNextSenderMsgSeqNum() + if err := store.cache.IncrNextSenderMsgSeqNum(); err != nil { + return errors.Wrap(err, "cache") + } return store.setSeqNum(store.senderSeqNumsFile, store.cache.NextSenderMsgSeqNum()) } // IncrNextTargetMsgSeqNum increments the next MsgSeqNum that should be received func (store *fileStore) IncrNextTargetMsgSeqNum() error { - store.cache.IncrNextTargetMsgSeqNum() + if err := store.cache.IncrNextTargetMsgSeqNum(); err != nil { + return errors.Wrap(err, "cache") + } return store.setSeqNum(store.targetSeqNumsFile, store.cache.NextTargetMsgSeqNum()) } diff --git a/internal/time_range_test.go b/internal/time_range_test.go index df392118a..a28a495f5 100644 --- a/internal/time_range_test.go +++ b/internal/time_range_test.go @@ -374,6 +374,7 @@ func TestTimeRangeIsInSameRangeWithDay(t *testing.T) { time1 = time.Date(2004, time.July, 27, 3, 0, 0, 0, time.UTC) time2 = time.Date(2004, time.July, 27, 3, 0, 0, 0, time.UTC) + assert.True(t, NewUTCWeekRange(startTime, endTime, startDay, endDay).IsInSameRange(time1, time2)) time1 = time.Date(2004, time.July, 26, 10, 0, 0, 0, time.UTC) time2 = time.Date(2004, time.July, 27, 3, 0, 0, 0, time.UTC) diff --git a/sqlstore.go b/sqlstore.go index 01eb87332..7137a6ee4 100644 --- a/sqlstore.go +++ b/sqlstore.go @@ -118,7 +118,7 @@ func (store *sqlStore) Refresh() error { return store.populateCache() } -func (store *sqlStore) populateCache() (err error) { +func (store *sqlStore) populateCache() error { s := store.sessionID var creationTime time.Time var incomingSeqNum, outgoingSeqNum int @@ -131,13 +131,17 @@ func (store *sqlStore) populateCache() (err error) { s.SenderCompID, s.SenderSubID, s.SenderLocationID, s.TargetCompID, s.TargetSubID, s.TargetLocationID) - err = row.Scan(&creationTime, &incomingSeqNum, &outgoingSeqNum) + err := row.Scan(&creationTime, &incomingSeqNum, &outgoingSeqNum) // session record found, load it if err == nil { store.cache.creationTime = creationTime - store.cache.SetNextTargetMsgSeqNum(incomingSeqNum) - store.cache.SetNextSenderMsgSeqNum(outgoingSeqNum) + if err = store.cache.SetNextTargetMsgSeqNum(incomingSeqNum); err != nil { + return errors.Wrap(err, "cache set next target") + } + if err = store.cache.SetNextSenderMsgSeqNum(outgoingSeqNum); err != nil { + return errors.Wrap(err, "cache set next sender") + } return nil } From 283735bd000159a7333b05d5756045c533570f27 Mon Sep 17 00:00:00 2001 From: chris busbey Date: Tue, 14 Jul 2020 19:49:58 -0500 Subject: [PATCH 074/139] remove unused ref --- datadictionary/datadictionary.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/datadictionary/datadictionary.go b/datadictionary/datadictionary.go index 4623b83be..98963e1b5 100644 --- a/datadictionary/datadictionary.go +++ b/datadictionary/datadictionary.go @@ -203,21 +203,6 @@ func (f FieldDef) childTags() []int { return tags } -func (f FieldDef) requiredChildTags() []int { - var tags []int - - for _, f := range f.Fields { - if !f.Required() { - continue - } - - tags = append(tags, f.Tag()) - tags = append(tags, f.requiredChildTags()...) - } - - return tags -} - //FieldType holds information relating to a field. Includes Tag, type, and enums, if defined. type FieldType struct { name string From 88db7e70a43efc28cd6e9f85883c33955ecfcb4d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2020 06:54:08 +0000 Subject: [PATCH 075/139] Bump github.com/mattn/go-sqlite3 from 1.14.0 to 1.14.1 Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.0 to 1.14.1. - [Release notes](https://github.com/mattn/go-sqlite3/releases) - [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.0...v1.14.1) Signed-off-by: dependabot-preview[bot] --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 0b72b49d9..93d04b08e 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 - github.com/mattn/go-sqlite3 v1.14.0 + github.com/mattn/go-sqlite3 v1.14.1 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 github.com/stretchr/testify v1.6.1 diff --git a/go.sum b/go.sum index ee5907a8a..6db4e8a39 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,8 @@ github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= +github.com/mattn/go-sqlite3 v1.14.1 h1:AHx9Ra40wIzl+GelgX2X6AWxmT5tfxhI1PL0523HcSw= +github.com/mattn/go-sqlite3 v1.14.1/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= From 1a5aee681cec8dc9a6cbb30d0fa7948d15e4ea40 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 31 Aug 2020 06:52:58 +0000 Subject: [PATCH 076/139] Bump github.com/mattn/go-sqlite3 from 1.14.1 to 1.14.2 Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.1 to 1.14.2. - [Release notes](https://github.com/mattn/go-sqlite3/releases) - [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.1...v1.14.2) Signed-off-by: dependabot-preview[bot] --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 93d04b08e..4d14b510c 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 - github.com/mattn/go-sqlite3 v1.14.1 + github.com/mattn/go-sqlite3 v1.14.2 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 github.com/stretchr/testify v1.6.1 diff --git a/go.sum b/go.sum index 6db4e8a39..a732dbc4b 100644 --- a/go.sum +++ b/go.sum @@ -12,6 +12,8 @@ github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/ github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/mattn/go-sqlite3 v1.14.1 h1:AHx9Ra40wIzl+GelgX2X6AWxmT5tfxhI1PL0523HcSw= github.com/mattn/go-sqlite3 v1.14.1/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= +github.com/mattn/go-sqlite3 v1.14.2 h1:A2EQLwjYf/hfYaM20FVjs1UewCTTFR7RmjEHkLjldIA= +github.com/mattn/go-sqlite3 v1.14.2/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= From dd777ad6b587b0f44ca93a10fe6ffd57b2db6563 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2020 06:52:16 +0000 Subject: [PATCH 077/139] Bump github.com/mattn/go-sqlite3 from 1.14.2 to 1.14.3 Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.2 to 1.14.3. - [Release notes](https://github.com/mattn/go-sqlite3/releases) - [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.2...v1.14.3) Signed-off-by: dependabot-preview[bot] --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4d14b510c..38ccbf2c2 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 - github.com/mattn/go-sqlite3 v1.14.2 + github.com/mattn/go-sqlite3 v1.14.3 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 github.com/stretchr/testify v1.6.1 diff --git a/go.sum b/go.sum index a732dbc4b..bc0ee816f 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ github.com/mattn/go-sqlite3 v1.14.1 h1:AHx9Ra40wIzl+GelgX2X6AWxmT5tfxhI1PL0523Hc github.com/mattn/go-sqlite3 v1.14.1/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/mattn/go-sqlite3 v1.14.2 h1:A2EQLwjYf/hfYaM20FVjs1UewCTTFR7RmjEHkLjldIA= github.com/mattn/go-sqlite3 v1.14.2/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= +github.com/mattn/go-sqlite3 v1.14.3 h1:j7a/xn1U6TKA/PHHxqZuzh64CdtRc7rU9M+AvkOl5bA= +github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= From 87b99ee647b4605b0191a05231af6760487f7389 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2020 06:49:00 +0000 Subject: [PATCH 078/139] Bump github.com/mattn/go-sqlite3 from 1.14.3 to 1.14.4 Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.3 to 1.14.4. - [Release notes](https://github.com/mattn/go-sqlite3/releases) - [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.3...v1.14.4) Signed-off-by: dependabot-preview[bot] --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 38ccbf2c2..144593188 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 - github.com/mattn/go-sqlite3 v1.14.3 + github.com/mattn/go-sqlite3 v1.14.4 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 github.com/stretchr/testify v1.6.1 diff --git a/go.sum b/go.sum index bc0ee816f..02d69244c 100644 --- a/go.sum +++ b/go.sum @@ -16,6 +16,8 @@ github.com/mattn/go-sqlite3 v1.14.2 h1:A2EQLwjYf/hfYaM20FVjs1UewCTTFR7RmjEHkLjld github.com/mattn/go-sqlite3 v1.14.2/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/mattn/go-sqlite3 v1.14.3 h1:j7a/xn1U6TKA/PHHxqZuzh64CdtRc7rU9M+AvkOl5bA= github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= +github.com/mattn/go-sqlite3 v1.14.4 h1:4rQjbDxdu9fSgI/r3KN72G3c2goxknAqHHgPWWs8UlI= +github.com/mattn/go-sqlite3 v1.14.4/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= From 1e9528d0e0c5333db74871e0c7f11991602ea2df Mon Sep 17 00:00:00 2001 From: jacky <576102544@qq.com> Date: Wed, 14 Oct 2020 21:05:49 +0800 Subject: [PATCH 079/139] add gormstroe --- go.mod | 1 + go.sum | 29 +++++++--------- gormstroe.go | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 17 deletions(-) create mode 100644 gormstroe.go diff --git a/go.mod b/go.mod index 144593188..eff0a37cd 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.13 require ( github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 + github.com/jinzhu/gorm v1.9.16 // indirect github.com/mattn/go-sqlite3 v1.14.4 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 diff --git a/go.sum b/go.sum index 02d69244c..77e093384 100644 --- a/go.sum +++ b/go.sum @@ -4,40 +4,37 @@ github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 h1:dmVRVC/Mmuw github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= -github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= +github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= -github.com/mattn/go-sqlite3 v1.14.1 h1:AHx9Ra40wIzl+GelgX2X6AWxmT5tfxhI1PL0523HcSw= -github.com/mattn/go-sqlite3 v1.14.1/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= -github.com/mattn/go-sqlite3 v1.14.2 h1:A2EQLwjYf/hfYaM20FVjs1UewCTTFR7RmjEHkLjldIA= -github.com/mattn/go-sqlite3 v1.14.2/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= -github.com/mattn/go-sqlite3 v1.14.3 h1:j7a/xn1U6TKA/PHHxqZuzh64CdtRc7rU9M+AvkOl5bA= -github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/mattn/go-sqlite3 v1.14.4 h1:4rQjbDxdu9fSgI/r3KN72G3c2goxknAqHHgPWWs8UlI= github.com/mattn/go-sqlite3 v1.14.4/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/shopspring/decimal v0.0.0-20190905144223-a36b5d85f337 h1:Da9XEUfFxgyDOqUfwgoTDcWzmnlOnCGi6i4iPS+8Fbw= -github.com/shopspring/decimal v0.0.0-20190905144223-a36b5d85f337/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 h1:qPnAdmjNA41t3QBTx2mFGf/SD1IoslhYu7AmdsVzCcs= -golang.org/x/net v0.0.0-20190926025831-c00fd9afed17/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= @@ -48,7 +45,5 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/gormstroe.go b/gormstroe.go new file mode 100644 index 000000000..d9fd3d177 --- /dev/null +++ b/gormstroe.go @@ -0,0 +1,95 @@ +package quickfix + +import ( + "time" + + "github.com/jinzhu/gorm" +) + +type gormStoreFactory struct { + settings *Settings +} + +func NewGormStoreFactory(settings *Settings) MessageStoreFactory { + return gormStoreFactory{settings: settings} +} + +type gromStore struct { + sessionID SessionID + cache *memoryStore + db *gorm.DB + placeholder placeholderFunc +} + +func (f gormStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, err error) { + panic(`todo conn db`) +} + +// Reset deletes the store records and sets the seqnums back to 1 +func (store *gromStore) Reset() error { + panic(`todo`) +} + +// Refresh reloads the store from the database +func (store *gromStore) Refresh() error { + if err := store.cache.Reset(); err != nil { + return err + } + return store.populateCache() +} + +func (store *gromStore) populateCache() error { + panic(`todo`) +} + +// NextSenderMsgSeqNum returns the next MsgSeqNum that will be sent +func (store *gromStore) NextSenderMsgSeqNum() int { + return store.cache.NextSenderMsgSeqNum() +} + +// NextTargetMsgSeqNum returns the next MsgSeqNum that should be received +func (store *gromStore) NextTargetMsgSeqNum() int { + return store.cache.NextTargetMsgSeqNum() +} + +// SetNextSenderMsgSeqNum sets the next MsgSeqNum that will be sent +func (store *gromStore) SetNextSenderMsgSeqNum(next int) error { + panic(`todo`) +} + +// SetNextTargetMsgSeqNum sets the next MsgSeqNum that should be received +func (store *gromStore) SetNextTargetMsgSeqNum(next int) error { + panic(`todo`) +} + +// IncrNextSenderMsgSeqNum increments the next MsgSeqNum that will be sent +func (store *gromStore) IncrNextSenderMsgSeqNum() error { + panic(`todo`) +} + +// IncrNextTargetMsgSeqNum increments the next MsgSeqNum that should be received +func (store *gromStore) IncrNextTargetMsgSeqNum() error { + panic(`todo`) +} + +// CreationTime returns the creation time of the store +func (store *gromStore) CreationTime() time.Time { + return store.cache.CreationTime() +} + +func (store *gromStore) SaveMessage(seqNum int, msg []byte) error { + panic(`todo`) +} + +func (store *gromStore) GetMessages(beginSeqNum, endSeqNum int) ([][]byte, error) { + panic(`todo`) +} + +// Close closes the store's database connection +func (store *gromStore) Close() error { + if store.db != nil { + store.db.Close() + store.db = nil + } + return nil +} From 372aa4c6086a0b1e358889359e05b31df436ee45 Mon Sep 17 00:00:00 2001 From: jacky <576102544@qq.com> Date: Thu, 15 Oct 2020 15:14:55 +0800 Subject: [PATCH 080/139] modify go.mod --- CONTRIBUTING.md | 4 +- README.md | 46 +++++++++---------- _test/echo_server.go | 6 +-- acceptor.go | 2 +- cmd/generate-fix/generate-fix.go | 4 +- cmd/generate-fix/internal/generate.go | 2 +- cmd/generate-fix/internal/globals.go | 2 +- cmd/generate-fix/internal/template_helpers.go | 2 +- cmd/generate-fix/internal/templates.go | 10 ++-- config/configuration.go | 2 +- datadictionary/component_type_test.go | 2 +- datadictionary/field_def_test.go | 2 +- datadictionary/field_type_test.go | 2 +- datadictionary/group_field_def_test.go | 2 +- datadictionary/message_def_test.go | 2 +- dialer.go | 2 +- dialer_test.go | 2 +- doc.go | 2 +- file_log.go | 2 +- filestore.go | 2 +- fix_utc_timestamp_test.go | 2 +- go.mod | 4 +- go.sum | 7 +++ in_session.go | 2 +- in_session_test.go | 2 +- latent_state.go | 2 +- logon_state.go | 2 +- logon_state_test.go | 2 +- logout_state.go | 2 +- logout_state_test.go | 2 +- message.go | 2 +- message_test.go | 2 +- mongostore.go | 2 +- not_session_time.go | 2 +- parser.go | 2 +- pending_timeout.go | 2 +- pending_timeout_test.go | 2 +- quickfix_test.go | 2 +- resend_state.go | 2 +- resend_state_test.go | 2 +- session.go | 4 +- session_factory.go | 6 +-- session_factory_test.go | 4 +- session_settings_test.go | 2 +- session_state.go | 2 +- session_test.go | 2 +- settings.go | 2 +- settings_test.go | 2 +- sqlstore.go | 2 +- tls.go | 2 +- tls_test.go | 2 +- validation.go | 2 +- validation_test.go | 2 +- 53 files changed, 94 insertions(+), 87 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2f86a01d9..56a325da7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,14 +2,14 @@ We welcome pull requests, bug fixes and issue reports. -Please direct questions about using the library to the [Mailing List](https://groups.google.com/forum/#!forum/quickfixgo). +Please direct questions about using the library to the [Mailing List](https://groups.google.com/forum/#!forum/long-bridge). Before proposing a large change, please discuss your change by raising an issue. ## Submitting Changes * Push your changes to a topic branch in your fork of the repository -* Submit a pull request to the repository in the QuickFIXGo Organization +* Submit a pull request to the repository in the long-bridge Organization ## Notes diff --git a/README.md b/README.md index d615b4db7..5992bdf96 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,51 @@ QuickFIX/Go =========== -[![GoDoc](https://godoc.org/github.com/quickfixgo/quickfix?status.png)](https://godoc.org/github.com/quickfixgo/quickfix) [![Build Status](https://travis-ci.org/quickfixgo/quickfix.svg?branch=master)](https://travis-ci.org/quickfixgo/quickfix) [![Go Report Card](https://goreportcard.com/badge/github.com/quickfixgo/quickfix)](https://goreportcard.com/report/github.com/quickfixgo/quickfix) +[![GoDoc](https://godoc.org/github.com/long-bridge/quickfix?status.png)](https://godoc.org/github.com/long-bridge/quickfix) [![Build Status](https://travis-ci.org/long-bridge/quickfix.svg?branch=master)](https://travis-ci.org/long-bridge/quickfix) [![Go Report Card](https://goreportcard.com/badge/github.com/long-bridge/quickfix)](https://goreportcard.com/report/github.com/long-bridge/quickfix) -- Website: http://www.quickfixgo.org -- Mailing list: [Google Groups](https://groups.google.com/forum/#!forum/quickfixgo) +- Website: http://www.long-bridge.org +- Mailing list: [Google Groups](https://groups.google.com/forum/#!forum/long-bridge) Open Source [FIX Protocol](http://www.fixprotocol.org/) library implemented in Go Getting Started and Documentation --------------------------------- -* [User Manual](http://quickfixgo.org/docs) -* [API Documentation](https://godoc.org/github.com/quickfixgo/quickfix) +* [User Manual](http://long-bridge.org/docs) +* [API Documentation](https://godoc.org/github.com/long-bridge/quickfix) ### Installation To install QuickFIX/Go, use `go get`: ```sh -$ go get github.com/quickfixgo/quickfix +$ go get github.com/long-bridge/quickfix ``` ### Staying up to date -To update QuickFIX/Go to the latest version, use `go get -u github.com/quickfixgo/quickfix`. +To update QuickFIX/Go to the latest version, use `go get -u github.com/long-bridge/quickfix`. ### Example Apps -See [examples](https://github.com/quickfixgo/examples) for some simple examples of using QuickFIX/Go. +See [examples](https://github.com/long-bridge/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: -* [github.com/quickfixgo/tag](https://github.com/quickfixgo/tag) -* [github.com/quickfixgo/field](https://github.com/quickfixgo/field) -* [github.com/quickfixgo/enum](https://github.com/quickfixgo/enum) -* [github.com/quickfixgo/fix40](https://github.com/quickfixgo/fix40) -* [github.com/quickfixgo/fix41](https://github.com/quickfixgo/fix41) -* [github.com/quickfixgo/fix42](https://github.com/quickfixgo/fix42) -* [github.com/quickfixgo/fix43](https://github.com/quickfixgo/fix43) -* [github.com/quickfixgo/fix44](https://github.com/quickfixgo/fix44) -* [github.com/quickfixgo/fix50](https://github.com/quickfixgo/fix50) -* [github.com/quickfixgo/fix50sp1](https://github.com/quickfixgo/fix50sp1) -* [github.com/quickfixgo/fix50sp2](https://github.com/quickfixgo/fix50sp2) -* [github.com/quickfixgo/fixt11](https://github.com/quickfixgo/fixt11) +* [github.com/long-bridge/tag](https://github.com/long-bridge/tag) +* [github.com/long-bridge/field](https://github.com/long-bridge/field) +* [github.com/long-bridge/enum](https://github.com/long-bridge/enum) +* [github.com/long-bridge/fix40](https://github.com/long-bridge/fix40) +* [github.com/long-bridge/fix41](https://github.com/long-bridge/fix41) +* [github.com/long-bridge/fix42](https://github.com/long-bridge/fix42) +* [github.com/long-bridge/fix43](https://github.com/long-bridge/fix43) +* [github.com/long-bridge/fix44](https://github.com/long-bridge/fix44) +* [github.com/long-bridge/fix50](https://github.com/long-bridge/fix50) +* [github.com/long-bridge/fix50sp1](https://github.com/long-bridge/fix50sp1) +* [github.com/long-bridge/fix50sp2](https://github.com/long-bridge/fix50sp2) +* [github.com/long-bridge/fixt11](https://github.com/long-bridge/fixt11) 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. @@ -56,7 +56,7 @@ Developing QuickFIX/Go If you wish to work on QuickFIX/Go itself, you will first need [Go](http://www.golang.org) installed and configured on your machine (version 1.13+ is preferred, but the minimum required version is 1.6). -Next, using [Git](https://git-scm.com/), clone the repository via `git clone git@github.com:quickfixgo/quickfix.git` +Next, using [Git](https://git-scm.com/), clone the repository via `git clone git@github.com:long-bridge/quickfix.git` ### Installing Dependencies @@ -80,7 +80,7 @@ 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](https://github.com/quickfixgo). 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 +Generated code from the FIX40-FIX50SP2 specs are available as separate repos under the [QuickFIX/Go organization](https://github.com/long-bridge). 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 ```sh $ make generate-dist @@ -128,4 +128,4 @@ Note that to specify a specific revision, you can manually edit the `go.mod` fil Licensing --------- -This software is available under the QuickFIX Software License. Please see the [LICENSE.txt](https://github.com/quickfixgo/quickfix/blob/master/LICENSE.txt) for the terms specified by the QuickFIX Software License. +This software is available under the QuickFIX Software License. Please see the [LICENSE.txt](https://github.com/long-bridge/quickfix/blob/master/LICENSE.txt) for the terms specified by the QuickFIX Software License. diff --git a/_test/echo_server.go b/_test/echo_server.go index ddd729789..d8fe4c1c6 100644 --- a/_test/echo_server.go +++ b/_test/echo_server.go @@ -7,9 +7,9 @@ import ( "os" "os/signal" - "github.com/quickfixgo/quickfix" - "github.com/quickfixgo/quickfix/gen/field" - "github.com/quickfixgo/quickfix/gen/tag" + "github.com/long-bridge/quickfix" + "github.com/long-bridge/quickfix/gen/field" + "github.com/long-bridge/quickfix/gen/tag" ) var router *quickfix.MessageRouter = quickfix.NewMessageRouter() diff --git a/acceptor.go b/acceptor.go index ac0ab6e52..cdada26c3 100644 --- a/acceptor.go +++ b/acceptor.go @@ -11,7 +11,7 @@ import ( "sync" "github.com/armon/go-proxyproto" - "github.com/quickfixgo/quickfix/config" + "github.com/long-bridge/quickfix/config" ) //Acceptor accepts connections from FIX clients and manages the associated sessions. diff --git a/cmd/generate-fix/generate-fix.go b/cmd/generate-fix/generate-fix.go index 5ec5ff47a..5e2145b8f 100644 --- a/cmd/generate-fix/generate-fix.go +++ b/cmd/generate-fix/generate-fix.go @@ -12,8 +12,8 @@ import ( "sync" "text/template" - "github.com/quickfixgo/quickfix/cmd/generate-fix/internal" - "github.com/quickfixgo/quickfix/datadictionary" + "github.com/long-bridge/quickfix/cmd/generate-fix/internal" + "github.com/long-bridge/quickfix/datadictionary" ) var ( diff --git a/cmd/generate-fix/internal/generate.go b/cmd/generate-fix/internal/generate.go index 3dc428980..011eae371 100644 --- a/cmd/generate-fix/internal/generate.go +++ b/cmd/generate-fix/internal/generate.go @@ -13,7 +13,7 @@ import ( var ( useFloat = flag.Bool("use-float", false, "By default, FIX float fields are represented as arbitrary-precision fixed-point decimal numbers. Set to 'true' to instead generate FIX float fields as float64 values.") - pkgRoot = flag.String("pkg-root", "github.com/quickfixgo", "Set a string here to provide a custom import path for generated packages.") + pkgRoot = flag.String("pkg-root", "github.com/long-bridge", "Set a string here to provide a custom import path for generated packages.") tabWidth = 8 printerMode = printer.UseSpaces | printer.TabIndent ) diff --git a/cmd/generate-fix/internal/globals.go b/cmd/generate-fix/internal/globals.go index 45e49467d..c97711c79 100644 --- a/cmd/generate-fix/internal/globals.go +++ b/cmd/generate-fix/internal/globals.go @@ -4,7 +4,7 @@ import ( "fmt" "sort" - "github.com/quickfixgo/quickfix/datadictionary" + "github.com/long-bridge/quickfix/datadictionary" ) type fieldTypeMap map[string]*datadictionary.FieldType diff --git a/cmd/generate-fix/internal/template_helpers.go b/cmd/generate-fix/internal/template_helpers.go index 55de54481..11e6641ac 100644 --- a/cmd/generate-fix/internal/template_helpers.go +++ b/cmd/generate-fix/internal/template_helpers.go @@ -3,7 +3,7 @@ package internal import ( "fmt" - "github.com/quickfixgo/quickfix/datadictionary" + "github.com/long-bridge/quickfix/datadictionary" ) func checkIfDecimalImportRequiredForFields(fTypes []*datadictionary.FieldType) (ok bool, err error) { diff --git a/cmd/generate-fix/internal/templates.go b/cmd/generate-fix/internal/templates.go index cae2d567d..b90818800 100644 --- a/cmd/generate-fix/internal/templates.go +++ b/cmd/generate-fix/internal/templates.go @@ -166,7 +166,7 @@ import( {{- end }} - "github.com/quickfixgo/quickfix" + "github.com/long-bridge/quickfix" {{- if checkIfEnumImportRequired .MessageDef}} "{{ importRootPath }}/enum" {{- end }} @@ -201,7 +201,7 @@ import( "{{ . }}" {{- end }} - "github.com/quickfixgo/quickfix" + "github.com/long-bridge/quickfix" {{- if checkIfEnumImportRequired .MessageDef}} "{{ importRootPath }}/enum" {{- end }} @@ -229,7 +229,7 @@ import( "{{ . }}" {{- end }} - "github.com/quickfixgo/quickfix" + "github.com/long-bridge/quickfix" {{- if checkIfEnumImportRequired .MessageDef}} "{{ importRootPath }}/enum" {{- end }} @@ -296,7 +296,7 @@ func Route(router RouteOut) (string, string, quickfix.MessageRoute) { TagTemplate = template.Must(template.New("Tag").Parse(` package tag -import("github.com/quickfixgo/quickfix") +import("github.com/long-bridge/quickfix") const ( {{- range .}} @@ -308,7 +308,7 @@ const ( FieldTemplate = template.Must(template.New("Field").Funcs(tmplFuncs).Parse(` package field import( - "github.com/quickfixgo/quickfix" + "github.com/long-bridge/quickfix" "{{ importRootPath }}/enum" "{{ importRootPath }}/tag" {{ if checkIfDecimalImportRequiredForFields . }} "github.com/shopspring/decimal" {{ end }} diff --git a/config/configuration.go b/config/configuration.go index adfd9ff54..8251cc04a 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -1,6 +1,6 @@ package config -//NOTE: Additions to this file should be made to both config/doc.go and http://www.quickfixgo.org/docs/ +//NOTE: Additions to this file should be made to both config/doc.go and http://www.long-bridge.org/docs/ //Const configuration settings const ( diff --git a/datadictionary/component_type_test.go b/datadictionary/component_type_test.go index 6de2b345a..9331b8929 100644 --- a/datadictionary/component_type_test.go +++ b/datadictionary/component_type_test.go @@ -3,7 +3,7 @@ package datadictionary_test import ( "testing" - "github.com/quickfixgo/quickfix/datadictionary" + "github.com/long-bridge/quickfix/datadictionary" "github.com/stretchr/testify/assert" ) diff --git a/datadictionary/field_def_test.go b/datadictionary/field_def_test.go index 9c0a68abb..9dc908ab2 100644 --- a/datadictionary/field_def_test.go +++ b/datadictionary/field_def_test.go @@ -3,7 +3,7 @@ package datadictionary_test import ( "testing" - "github.com/quickfixgo/quickfix/datadictionary" + "github.com/long-bridge/quickfix/datadictionary" "github.com/stretchr/testify/assert" ) diff --git a/datadictionary/field_type_test.go b/datadictionary/field_type_test.go index 2a4328dff..c96186fa7 100644 --- a/datadictionary/field_type_test.go +++ b/datadictionary/field_type_test.go @@ -3,7 +3,7 @@ package datadictionary_test import ( "testing" - "github.com/quickfixgo/quickfix/datadictionary" + "github.com/long-bridge/quickfix/datadictionary" "github.com/stretchr/testify/assert" ) diff --git a/datadictionary/group_field_def_test.go b/datadictionary/group_field_def_test.go index e1e963298..eaae00847 100644 --- a/datadictionary/group_field_def_test.go +++ b/datadictionary/group_field_def_test.go @@ -3,7 +3,7 @@ package datadictionary_test import ( "testing" - "github.com/quickfixgo/quickfix/datadictionary" + "github.com/long-bridge/quickfix/datadictionary" "github.com/stretchr/testify/assert" ) diff --git a/datadictionary/message_def_test.go b/datadictionary/message_def_test.go index 666751fed..3781238c0 100644 --- a/datadictionary/message_def_test.go +++ b/datadictionary/message_def_test.go @@ -3,7 +3,7 @@ package datadictionary_test import ( "testing" - "github.com/quickfixgo/quickfix/datadictionary" + "github.com/long-bridge/quickfix/datadictionary" "github.com/stretchr/testify/assert" ) diff --git a/dialer.go b/dialer.go index 1645076bf..b214fd6c8 100644 --- a/dialer.go +++ b/dialer.go @@ -4,7 +4,7 @@ import ( "fmt" "net" - "github.com/quickfixgo/quickfix/config" + "github.com/long-bridge/quickfix/config" "golang.org/x/net/proxy" ) diff --git a/dialer_test.go b/dialer_test.go index 510c18f04..2160c1dcd 100644 --- a/dialer_test.go +++ b/dialer_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/quickfixgo/quickfix/config" + "github.com/long-bridge/quickfix/config" "github.com/stretchr/testify/suite" ) diff --git a/doc.go b/doc.go index 76f7b7b71..e5451bb14 100644 --- a/doc.go +++ b/doc.go @@ -1,6 +1,6 @@ /* 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). -User manual and additional information available at http://quickfixgo.org +User manual and additional information available at http://long-bridge.org */ package quickfix diff --git a/file_log.go b/file_log.go index 02f27b001..5d36f5433 100644 --- a/file_log.go +++ b/file_log.go @@ -6,7 +6,7 @@ import ( "os" "path" - "github.com/quickfixgo/quickfix/config" + "github.com/long-bridge/quickfix/config" ) type fileLog struct { diff --git a/filestore.go b/filestore.go index 6d010f897..251719e73 100644 --- a/filestore.go +++ b/filestore.go @@ -9,8 +9,8 @@ import ( "strconv" "time" + "github.com/long-bridge/quickfix/config" "github.com/pkg/errors" - "github.com/quickfixgo/quickfix/config" ) type msgDef struct { diff --git a/fix_utc_timestamp_test.go b/fix_utc_timestamp_test.go index b29039587..739c91884 100644 --- a/fix_utc_timestamp_test.go +++ b/fix_utc_timestamp_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/quickfixgo/quickfix" + "github.com/long-bridge/quickfix" ) func TestFIXUTCTimestampWrite(t *testing.T) { diff --git a/go.mod b/go.mod index eff0a37cd..77f7be906 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ -module github.com/quickfixgo/quickfix +module github.com/long-bridge/quickfix go 1.13 require ( github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 - github.com/jinzhu/gorm v1.9.16 // indirect + github.com/jinzhu/gorm v1.9.16 github.com/mattn/go-sqlite3 v1.14.4 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 diff --git a/go.sum b/go.sum index 77e093384..a5160419f 100644 --- a/go.sum +++ b/go.sum @@ -4,17 +4,23 @@ github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 h1:dmVRVC/Mmuw github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM= github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/mattn/go-sqlite3 v1.14.4 h1:4rQjbDxdu9fSgI/r3KN72G3c2goxknAqHHgPWWs8UlI= @@ -32,6 +38,7 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= diff --git a/in_session.go b/in_session.go index d4dfc701d..97bc02952 100644 --- a/in_session.go +++ b/in_session.go @@ -4,7 +4,7 @@ import ( "bytes" "time" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/internal" ) type inSession struct{ loggedOn } diff --git a/in_session_test.go b/in_session_test.go index c8c0b1523..87c89c66f 100644 --- a/in_session_test.go +++ b/in_session_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/internal" "github.com/stretchr/testify/suite" ) diff --git a/latent_state.go b/latent_state.go index e6e5bece4..a60dfb767 100644 --- a/latent_state.go +++ b/latent_state.go @@ -1,6 +1,6 @@ package quickfix -import "github.com/quickfixgo/quickfix/internal" +import "github.com/long-bridge/quickfix/internal" type latentState struct{ inSessionTime } diff --git a/logon_state.go b/logon_state.go index d254b92b3..da7e76ab0 100644 --- a/logon_state.go +++ b/logon_state.go @@ -3,7 +3,7 @@ package quickfix import ( "bytes" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/internal" ) type logonState struct{ connectedNotLoggedOn } diff --git a/logon_state_test.go b/logon_state_test.go index 3ba29af1d..4632367c2 100644 --- a/logon_state_test.go +++ b/logon_state_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/internal" "github.com/stretchr/testify/suite" ) diff --git a/logout_state.go b/logout_state.go index 071512ce1..b5c033ac2 100644 --- a/logout_state.go +++ b/logout_state.go @@ -1,6 +1,6 @@ package quickfix -import "github.com/quickfixgo/quickfix/internal" +import "github.com/long-bridge/quickfix/internal" type logoutState struct{ connectedNotLoggedOn } diff --git a/logout_state_test.go b/logout_state_test.go index ce1ae84b6..24f87dd48 100644 --- a/logout_state_test.go +++ b/logout_state_test.go @@ -3,7 +3,7 @@ package quickfix import ( "testing" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/internal" "github.com/stretchr/testify/suite" ) diff --git a/message.go b/message.go index f800cbebf..fd74ea2a9 100644 --- a/message.go +++ b/message.go @@ -6,7 +6,7 @@ import ( "math" "time" - "github.com/quickfixgo/quickfix/datadictionary" + "github.com/long-bridge/quickfix/datadictionary" ) //Header is first section of a FIX Message diff --git a/message_test.go b/message_test.go index 3766c9221..9bafb0f49 100644 --- a/message_test.go +++ b/message_test.go @@ -5,7 +5,7 @@ import ( "reflect" "testing" - "github.com/quickfixgo/quickfix/datadictionary" + "github.com/long-bridge/quickfix/datadictionary" "github.com/stretchr/testify/suite" ) diff --git a/mongostore.go b/mongostore.go index e50af2c16..e66b0f1fc 100644 --- a/mongostore.go +++ b/mongostore.go @@ -7,7 +7,7 @@ import ( "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" "github.com/pkg/errors" - "github.com/quickfixgo/quickfix/config" + "github.com/long-bridge/quickfix/config" ) type mongoStoreFactory struct { diff --git a/not_session_time.go b/not_session_time.go index 2e3b04c3d..f187dd739 100644 --- a/not_session_time.go +++ b/not_session_time.go @@ -1,6 +1,6 @@ package quickfix -import "github.com/quickfixgo/quickfix/internal" +import "github.com/long-bridge/quickfix/internal" type notSessionTime struct{ latentState } diff --git a/parser.go b/parser.go index 8816345d4..c3565e217 100644 --- a/parser.go +++ b/parser.go @@ -6,7 +6,7 @@ import ( "io" "time" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/internal" ) const ( diff --git a/pending_timeout.go b/pending_timeout.go index 87154dddd..d362f670f 100644 --- a/pending_timeout.go +++ b/pending_timeout.go @@ -1,6 +1,6 @@ package quickfix -import "github.com/quickfixgo/quickfix/internal" +import "github.com/long-bridge/quickfix/internal" type pendingTimeout struct { sessionState diff --git a/pending_timeout_test.go b/pending_timeout_test.go index a9e4bf8f1..893fcc537 100644 --- a/pending_timeout_test.go +++ b/pending_timeout_test.go @@ -3,7 +3,7 @@ package quickfix import ( "testing" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/internal" "github.com/stretchr/testify/suite" ) diff --git a/quickfix_test.go b/quickfix_test.go index 2f511b77d..065565936 100644 --- a/quickfix_test.go +++ b/quickfix_test.go @@ -3,7 +3,7 @@ package quickfix import ( "time" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/internal" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/resend_state.go b/resend_state.go index a89d3f697..36cfce8b1 100644 --- a/resend_state.go +++ b/resend_state.go @@ -1,6 +1,6 @@ package quickfix -import "github.com/quickfixgo/quickfix/internal" +import "github.com/long-bridge/quickfix/internal" type resendState struct { loggedOn diff --git a/resend_state_test.go b/resend_state_test.go index aa13cc871..a470408e7 100644 --- a/resend_state_test.go +++ b/resend_state_test.go @@ -3,7 +3,7 @@ package quickfix import ( "testing" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/internal" "github.com/stretchr/testify/suite" ) diff --git a/session.go b/session.go index d68096ace..3c60aae1e 100644 --- a/session.go +++ b/session.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/quickfixgo/quickfix/datadictionary" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/datadictionary" + "github.com/long-bridge/quickfix/internal" ) //The Session is the primary FIX abstraction for message communication diff --git a/session_factory.go b/session_factory.go index f4f3fc0ef..e491ff0d5 100644 --- a/session_factory.go +++ b/session_factory.go @@ -6,9 +6,9 @@ import ( "strconv" "time" - "github.com/quickfixgo/quickfix/config" - "github.com/quickfixgo/quickfix/datadictionary" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/config" + "github.com/long-bridge/quickfix/datadictionary" + "github.com/long-bridge/quickfix/internal" ) var dayLookup = map[string]time.Weekday{ diff --git a/session_factory_test.go b/session_factory_test.go index 88f08f1aa..3a6619696 100644 --- a/session_factory_test.go +++ b/session_factory_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/quickfixgo/quickfix/config" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/config" + "github.com/long-bridge/quickfix/internal" "github.com/stretchr/testify/suite" ) diff --git a/session_settings_test.go b/session_settings_test.go index 34687ae2c..b1c7ce77a 100644 --- a/session_settings_test.go +++ b/session_settings_test.go @@ -3,7 +3,7 @@ package quickfix import ( "testing" - "github.com/quickfixgo/quickfix/config" + "github.com/long-bridge/quickfix/config" ) func TestSessionSettings_StringSettings(t *testing.T) { diff --git a/session_state.go b/session_state.go index c8b1f42a4..63b89504b 100644 --- a/session_state.go +++ b/session_state.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/internal" ) type stateMachine struct { diff --git a/session_test.go b/session_test.go index 293b94805..bb0d97c52 100644 --- a/session_test.go +++ b/session_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/quickfixgo/quickfix/internal" + "github.com/long-bridge/quickfix/internal" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/settings.go b/settings.go index 870cf3d71..ebd9016bb 100644 --- a/settings.go +++ b/settings.go @@ -7,7 +7,7 @@ import ( "io" "regexp" - "github.com/quickfixgo/quickfix/config" + "github.com/long-bridge/quickfix/config" ) //The Settings type represents a collection of global and session settings. diff --git a/settings_test.go b/settings_test.go index b9c219760..330678de1 100644 --- a/settings_test.go +++ b/settings_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/quickfixgo/quickfix/config" + "github.com/long-bridge/quickfix/config" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/sqlstore.go b/sqlstore.go index 3569359af..6e6424f68 100644 --- a/sqlstore.go +++ b/sqlstore.go @@ -6,8 +6,8 @@ import ( "regexp" "time" + "github.com/long-bridge/quickfix/config" "github.com/pkg/errors" - "github.com/quickfixgo/quickfix/config" ) type sqlStoreFactory struct { diff --git a/tls.go b/tls.go index 951ac7e87..68b7006d0 100644 --- a/tls.go +++ b/tls.go @@ -6,7 +6,7 @@ import ( "fmt" "io/ioutil" - "github.com/quickfixgo/quickfix/config" + "github.com/long-bridge/quickfix/config" ) func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) { diff --git a/tls_test.go b/tls_test.go index fe6745a19..e19f5158c 100644 --- a/tls_test.go +++ b/tls_test.go @@ -4,7 +4,7 @@ import ( "crypto/tls" "testing" - "github.com/quickfixgo/quickfix/config" + "github.com/long-bridge/quickfix/config" "github.com/stretchr/testify/suite" ) diff --git a/validation.go b/validation.go index 59edfac31..c6817454a 100644 --- a/validation.go +++ b/validation.go @@ -1,7 +1,7 @@ package quickfix import ( - "github.com/quickfixgo/quickfix/datadictionary" + "github.com/long-bridge/quickfix/datadictionary" ) type validator interface { diff --git a/validation_test.go b/validation_test.go index 10a8a7e3f..172536d21 100644 --- a/validation_test.go +++ b/validation_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/quickfixgo/quickfix/datadictionary" + "github.com/long-bridge/quickfix/datadictionary" "github.com/stretchr/testify/assert" ) From 54811a3f72411c1d2713bf4b35e18e9a26695e75 Mon Sep 17 00:00:00 2001 From: jacky <576102544@qq.com> Date: Thu, 15 Oct 2020 17:51:02 +0800 Subject: [PATCH 081/139] add grom.db sup --- gormstroe.go | 165 +++++++++++++++++++++++++++++++++++++++++----- gormstroe_test.go | 1 + 2 files changed, 151 insertions(+), 15 deletions(-) create mode 100644 gormstroe_test.go diff --git a/gormstroe.go b/gormstroe.go index d9fd3d177..0c83bf2e4 100644 --- a/gormstroe.go +++ b/gormstroe.go @@ -1,33 +1,72 @@ package quickfix import ( + "fmt" "time" "github.com/jinzhu/gorm" + "github.com/pkg/errors" ) type gormStoreFactory struct { settings *Settings + db *gorm.DB } -func NewGormStoreFactory(settings *Settings) MessageStoreFactory { - return gormStoreFactory{settings: settings} +func NewGormStoreFactory(settings *Settings, db *gorm.DB) MessageStoreFactory { + return gormStoreFactory{settings: settings, db: db} } type gromStore struct { - sessionID SessionID - cache *memoryStore - db *gorm.DB - placeholder placeholderFunc + sessionID SessionID + cache *memoryStore + db *gorm.DB } func (f gormStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, err error) { - panic(`todo conn db`) + _, ok := f.settings.SessionSettings()[sessionID] + if !ok { + return nil, fmt.Errorf("unknown session: %v", sessionID) + } + + store := &gromStore{ + sessionID: sessionID, + cache: &memoryStore{}, + db: f.db, + } + if err = store.cache.Reset(); err != nil { + err = errors.Wrap(err, "cache reset") + return + } + return store, nil + } // Reset deletes the store records and sets the seqnums back to 1 func (store *gromStore) Reset() error { - panic(`todo`) + s := store.sessionID + err := store.db.Exec(`DELETE FROM messages + WHERE beginstring=? AND session_qualifier=? + AND sendercompid=? AND sendersubid=? AND senderlocid=? + AND targetcompid=? AND targetsubid=? AND targetlocid=?`, s.BeginString, s.Qualifier, + s.SenderCompID, s.SenderSubID, s.SenderLocationID, + s.TargetCompID, s.TargetSubID, s.TargetLocationID).Error + if err != nil { + return err + } + if err = store.cache.Reset(); err != nil { + return err + } + err = store.db.Table(`sessions`).Where(`beginstring=? AND session_qualifier=? + AND sendercompid=? AND sendersubid=? AND senderlocid=? + AND targetcompid=? AND targetsubid=? AND targetlocid=?`, s.BeginString, s.Qualifier, + s.SenderCompID, s.SenderSubID, s.SenderLocationID, + s.TargetCompID, s.TargetSubID, s.TargetLocationID).Updates(map[string]interface{}{ + "creation_time": store.cache.CreationTime(), + "incoming_seqnum": store.cache.NextTargetMsgSeqNum(), + "outgoing_seqnum": store.cache.NextSenderMsgSeqNum(), + }).Error + return err } // Refresh reloads the store from the database @@ -39,7 +78,42 @@ func (store *gromStore) Refresh() error { } func (store *gromStore) populateCache() error { - panic(`todo`) + var dest struct { + CreationTime time.Time + IncomingSeqNum int + OutgoingSeqNum int + } + s := store.sessionID + err := store.db.Table(`sessions`).Where(`beginstring=? AND session_qualifier=? + AND sendercompid=? AND sendersubid=? AND senderlocid=? + AND targetcompid=? AND targetsubid=? AND targetlocid=?`, s.BeginString, s.Qualifier, + s.SenderCompID, s.SenderSubID, s.SenderLocationID, + s.TargetCompID, s.TargetSubID, s.TargetLocationID).Find(&dest).Error + + if err == nil { + store.cache.creationTime = dest.CreationTime + if err = store.cache.SetNextTargetMsgSeqNum(dest.IncomingSeqNum); err != nil { + return errors.Wrap(err, "cache set next target") + } + if err = store.cache.SetNextSenderMsgSeqNum(dest.OutgoingSeqNum); err != nil { + return errors.Wrap(err, "cache set next sender") + } + return nil + } + if gorm.IsRecordNotFoundError(err) { + return store.db.Exec(`INSERT INTO sessions ( + creation_time, incoming_seqnum, outgoing_seqnum, + beginstring, session_qualifier, + sendercompid, sendersubid, senderlocid, + targetcompid, targetsubid, targetlocid) + VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, store.cache.creationTime, + store.cache.NextTargetMsgSeqNum(), + store.cache.NextSenderMsgSeqNum(), + s.BeginString, s.Qualifier, + s.SenderCompID, s.SenderSubID, s.SenderLocationID, + s.TargetCompID, s.TargetSubID, s.TargetLocationID).Error + } + return err } // NextSenderMsgSeqNum returns the next MsgSeqNum that will be sent @@ -54,22 +128,48 @@ func (store *gromStore) NextTargetMsgSeqNum() int { // SetNextSenderMsgSeqNum sets the next MsgSeqNum that will be sent func (store *gromStore) SetNextSenderMsgSeqNum(next int) error { - panic(`todo`) + s := store.sessionID + + err := store.db.Table(`sessions`).Where(`beginstring=? AND session_qualifier=? + AND sendercompid=? AND sendersubid=? AND senderlocid=? + AND targetcompid=? AND targetsubid=? AND targetlocid=?`, s.BeginString, s.Qualifier, + s.SenderCompID, s.SenderSubID, s.SenderLocationID, + s.TargetCompID, s.TargetSubID, s.TargetLocationID).Update(`outgoing_seqnum`, next).Error + if err != nil { + return err + } + return store.cache.SetNextSenderMsgSeqNum(next) } // SetNextTargetMsgSeqNum sets the next MsgSeqNum that should be received func (store *gromStore) SetNextTargetMsgSeqNum(next int) error { - panic(`todo`) + s := store.sessionID + + err := store.db.Table(`sessions`).Where(`beginstring=? AND session_qualifier=? + AND sendercompid=? AND sendersubid=? AND senderlocid=? + AND targetcompid=? AND targetsubid=? AND targetlocid=?`, s.BeginString, s.Qualifier, + s.SenderCompID, s.SenderSubID, s.SenderLocationID, + s.TargetCompID, s.TargetSubID, s.TargetLocationID).Update(`incoming_seqnum`, next).Error + if err != nil { + return err + } + return store.cache.SetNextTargetMsgSeqNum(next) } // IncrNextSenderMsgSeqNum increments the next MsgSeqNum that will be sent func (store *gromStore) IncrNextSenderMsgSeqNum() error { - panic(`todo`) + if err := store.cache.IncrNextSenderMsgSeqNum(); err != nil { + return errors.Wrap(err, "cache incr next") + } + return store.SetNextSenderMsgSeqNum(store.cache.NextSenderMsgSeqNum()) } // IncrNextTargetMsgSeqNum increments the next MsgSeqNum that should be received func (store *gromStore) IncrNextTargetMsgSeqNum() error { - panic(`todo`) + if err := store.cache.IncrNextTargetMsgSeqNum(); err != nil { + return errors.Wrap(err, "cache incr next") + } + return store.SetNextTargetMsgSeqNum(store.cache.NextTargetMsgSeqNum()) } // CreationTime returns the creation time of the store @@ -78,11 +178,46 @@ func (store *gromStore) CreationTime() time.Time { } func (store *gromStore) SaveMessage(seqNum int, msg []byte) error { - panic(`todo`) + s := store.sessionID + return store.db.Exec(`INSERT INTO messages ( + msgseqnum, message, + beginstring, session_qualifier, + sendercompid, sendersubid, senderlocid, + targetcompid, targetsubid, targetlocid) + VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, seqNum, string(msg), + s.BeginString, s.Qualifier, + s.SenderCompID, s.SenderSubID, s.SenderLocationID, + s.TargetCompID, s.TargetSubID, s.TargetLocationID).Error } func (store *gromStore) GetMessages(beginSeqNum, endSeqNum int) ([][]byte, error) { - panic(`todo`) + s := store.sessionID + var msgs [][]byte + rows, err := store.db.Raw(`SELECT message FROM messages + WHERE beginstring=? AND session_qualifier=? + AND sendercompid=? AND sendersubid=? AND senderlocid=? + AND targetcompid=? AND targetsubid=? AND targetlocid=? + AND msgseqnum>=? AND msgseqnum<=? + ORDER BY msgseqnum`, s.BeginString, s.Qualifier, + s.SenderCompID, s.SenderSubID, s.SenderLocationID, + s.TargetCompID, s.TargetSubID, s.TargetLocationID, + beginSeqNum, endSeqNum).Rows() + + if err != nil { + return nil, err + } + for rows.Next() { + var message string + if err := rows.Scan(&message); err != nil { + return nil, err + } + msgs = append(msgs, []byte(message)) + } + if err := rows.Err(); err != nil { + return nil, err + } + return msgs, nil + } // Close closes the store's database connection diff --git a/gormstroe_test.go b/gormstroe_test.go new file mode 100644 index 000000000..24807a11f --- /dev/null +++ b/gormstroe_test.go @@ -0,0 +1 @@ +package quickfix From 5b24ee53750abe10896eb8546fcf7d1d31b50a1e Mon Sep 17 00:00:00 2001 From: jacky <576102544@qq.com> Date: Fri, 16 Oct 2020 11:20:16 +0800 Subject: [PATCH 082/139] add populateCache --- gormstroe.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gormstroe.go b/gormstroe.go index 0c83bf2e4..6e2082c90 100644 --- a/gormstroe.go +++ b/gormstroe.go @@ -38,6 +38,9 @@ func (f gormStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, er err = errors.Wrap(err, "cache reset") return } + if err = store.populateCache(); err != nil { + return nil, err + } return store, nil } From 51cfdad3b2f9a1022089b2c5e5437b7bc5f92683 Mon Sep 17 00:00:00 2001 From: jacky <576102544@qq.com> Date: Fri, 16 Oct 2020 15:33:54 +0800 Subject: [PATCH 083/139] add populateCache --- go.mod | 1 + go.sum | 10 ++++++++++ gormstroe.go | 7 +++---- gormstroe_test.go | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 77f7be906..4fbb9e17f 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/mattn/go-sqlite3 v1.14.4 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 + github.com/smartystreets/goconvey v1.6.4 github.com/stretchr/testify v1.6.1 golang.org/x/net v0.0.0-20200707034311-ab3426394381 ) diff --git a/go.sum b/go.sum index a5160419f..770e6cdce 100644 --- a/go.sum +++ b/go.sum @@ -14,12 +14,16 @@ github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gG github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= @@ -31,6 +35,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= @@ -41,6 +49,7 @@ golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= @@ -50,6 +59,7 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/gormstroe.go b/gormstroe.go index 6e2082c90..9676d5fcb 100644 --- a/gormstroe.go +++ b/gormstroe.go @@ -82,9 +82,9 @@ func (store *gromStore) Refresh() error { func (store *gromStore) populateCache() error { var dest struct { - CreationTime time.Time - IncomingSeqNum int - OutgoingSeqNum int + CreationTime time.Time `gorm:"column:creation_time"` + IncomingSeqNum int `gorm:"column:incoming_seqnum"` + OutgoingSeqNum int `gorm:"column:outgoing_seqnum"` } s := store.sessionID err := store.db.Table(`sessions`).Where(`beginstring=? AND session_qualifier=? @@ -92,7 +92,6 @@ func (store *gromStore) populateCache() error { AND targetcompid=? AND targetsubid=? AND targetlocid=?`, s.BeginString, s.Qualifier, s.SenderCompID, s.SenderSubID, s.SenderLocationID, s.TargetCompID, s.TargetSubID, s.TargetLocationID).Find(&dest).Error - if err == nil { store.cache.creationTime = dest.CreationTime if err = store.cache.SetNextTargetMsgSeqNum(dest.IncomingSeqNum); err != nil { diff --git a/gormstroe_test.go b/gormstroe_test.go index 24807a11f..afd0cf812 100644 --- a/gormstroe_test.go +++ b/gormstroe_test.go @@ -1 +1,33 @@ package quickfix + +import ( + "testing" + + "github.com/jinzhu/gorm" + _ "github.com/jinzhu/gorm/dialects/postgres" + . "github.com/smartystreets/goconvey/convey" +) + +func NewGormDB() (*gorm.DB, error) { + return gorm.Open("postgres", "host=127.0.0.1 user=postgres dbname=initiator sslmode=disable password=123456") +} +func Test_GromStoreCreate(t *testing.T) { + Convey(`GromStoreCreate`, t, func() { + db, err := NewGormDB() + db.LogMode(true) + So(err, ShouldBeNil) + So(db, ShouldNotBeNil) + sessionID := SessionID{BeginString: "FIX.4.2", TargetCompID: "IB", SenderCompID: "LB"} + appSettings := NewSettings() + appSettings.sessionSettings = map[SessionID]*SessionSettings{ + sessionID: {}, + } + Convey(`none session`, func() { + + }) + Convey(`have session`, func() { + f := NewGormStoreFactory(appSettings, db) + f.Create(sessionID) + }) + }) +} From da9e816d62ee7bd29f2e241eaf3d96adfe277070 Mon Sep 17 00:00:00 2001 From: jacky <576102544@qq.com> Date: Sat, 17 Oct 2020 15:30:14 +0800 Subject: [PATCH 084/139] modfiy require --- README.md | 10 +++++----- _test/echo_server.go | 6 +++--- acceptor.go | 2 +- cmd/generate-fix/generate-fix.go | 4 ++-- cmd/generate-fix/internal/globals.go | 2 +- cmd/generate-fix/internal/template_helpers.go | 2 +- cmd/generate-fix/internal/templates.go | 10 +++++----- datadictionary/component_type_test.go | 2 +- datadictionary/field_def_test.go | 2 +- datadictionary/field_type_test.go | 2 +- datadictionary/group_field_def_test.go | 2 +- datadictionary/message_def_test.go | 2 +- dialer.go | 2 +- dialer_test.go | 2 +- file_log.go | 2 +- filestore.go | 2 +- fix_utc_timestamp_test.go | 2 +- go.mod | 2 +- gormstroe_test.go | 2 +- in_session.go | 2 +- in_session_test.go | 2 +- latent_state.go | 2 +- logon_state.go | 2 +- logon_state_test.go | 2 +- logout_state.go | 2 +- logout_state_test.go | 2 +- message.go | 2 +- message_test.go | 2 +- mongostore.go | 2 +- not_session_time.go | 2 +- parser.go | 2 +- pending_timeout.go | 2 +- pending_timeout_test.go | 2 +- quickfix_test.go | 2 +- resend_state.go | 2 +- resend_state_test.go | 2 +- session.go | 4 ++-- session_factory.go | 6 +++--- session_factory_test.go | 4 ++-- session_settings_test.go | 2 +- session_state.go | 2 +- session_test.go | 2 +- settings.go | 2 +- settings_test.go | 2 +- sqlstore.go | 2 +- tls.go | 2 +- tls_test.go | 2 +- validation.go | 2 +- validation_test.go | 2 +- 49 files changed, 64 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index 5992bdf96..880eac602 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ QuickFIX/Go =========== -[![GoDoc](https://godoc.org/github.com/long-bridge/quickfix?status.png)](https://godoc.org/github.com/long-bridge/quickfix) [![Build Status](https://travis-ci.org/long-bridge/quickfix.svg?branch=master)](https://travis-ci.org/long-bridge/quickfix) [![Go Report Card](https://goreportcard.com/badge/github.com/long-bridge/quickfix)](https://goreportcard.com/report/github.com/long-bridge/quickfix) +[![GoDoc](https://godoc.org/github.com/quickfixgo/quickfix?status.png)](https://godoc.org/github.com/quickfixgo/quickfix) [![Build Status](https://travis-ci.org/long-bridge/quickfix.svg?branch=master)](https://travis-ci.org/long-bridge/quickfix) [![Go Report Card](https://goreportcard.com/badge/github.com/quickfixgo/quickfix)](https://goreportcard.com/report/github.com/quickfixgo/quickfix) - Website: http://www.long-bridge.org - Mailing list: [Google Groups](https://groups.google.com/forum/#!forum/long-bridge) @@ -12,19 +12,19 @@ Getting Started and Documentation --------------------------------- * [User Manual](http://long-bridge.org/docs) -* [API Documentation](https://godoc.org/github.com/long-bridge/quickfix) +* [API Documentation](https://godoc.org/github.com/quickfixgo/quickfix) ### Installation To install QuickFIX/Go, use `go get`: ```sh -$ go get github.com/long-bridge/quickfix +$ go get github.com/quickfixgo/quickfix ``` ### Staying up to date -To update QuickFIX/Go to the latest version, use `go get -u github.com/long-bridge/quickfix`. +To update QuickFIX/Go to the latest version, use `go get -u github.com/quickfixgo/quickfix`. ### Example Apps @@ -128,4 +128,4 @@ Note that to specify a specific revision, you can manually edit the `go.mod` fil Licensing --------- -This software is available under the QuickFIX Software License. Please see the [LICENSE.txt](https://github.com/long-bridge/quickfix/blob/master/LICENSE.txt) for the terms specified by the QuickFIX Software License. +This software is available under the QuickFIX Software License. Please see the [LICENSE.txt](https://github.com/quickfixgo/quickfix/blob/master/LICENSE.txt) for the terms specified by the QuickFIX Software License. diff --git a/_test/echo_server.go b/_test/echo_server.go index d8fe4c1c6..ddd729789 100644 --- a/_test/echo_server.go +++ b/_test/echo_server.go @@ -7,9 +7,9 @@ import ( "os" "os/signal" - "github.com/long-bridge/quickfix" - "github.com/long-bridge/quickfix/gen/field" - "github.com/long-bridge/quickfix/gen/tag" + "github.com/quickfixgo/quickfix" + "github.com/quickfixgo/quickfix/gen/field" + "github.com/quickfixgo/quickfix/gen/tag" ) var router *quickfix.MessageRouter = quickfix.NewMessageRouter() diff --git a/acceptor.go b/acceptor.go index cdada26c3..ac0ab6e52 100644 --- a/acceptor.go +++ b/acceptor.go @@ -11,7 +11,7 @@ import ( "sync" "github.com/armon/go-proxyproto" - "github.com/long-bridge/quickfix/config" + "github.com/quickfixgo/quickfix/config" ) //Acceptor accepts connections from FIX clients and manages the associated sessions. diff --git a/cmd/generate-fix/generate-fix.go b/cmd/generate-fix/generate-fix.go index 5e2145b8f..5ec5ff47a 100644 --- a/cmd/generate-fix/generate-fix.go +++ b/cmd/generate-fix/generate-fix.go @@ -12,8 +12,8 @@ import ( "sync" "text/template" - "github.com/long-bridge/quickfix/cmd/generate-fix/internal" - "github.com/long-bridge/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/cmd/generate-fix/internal" + "github.com/quickfixgo/quickfix/datadictionary" ) var ( diff --git a/cmd/generate-fix/internal/globals.go b/cmd/generate-fix/internal/globals.go index c97711c79..45e49467d 100644 --- a/cmd/generate-fix/internal/globals.go +++ b/cmd/generate-fix/internal/globals.go @@ -4,7 +4,7 @@ import ( "fmt" "sort" - "github.com/long-bridge/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/datadictionary" ) type fieldTypeMap map[string]*datadictionary.FieldType diff --git a/cmd/generate-fix/internal/template_helpers.go b/cmd/generate-fix/internal/template_helpers.go index 11e6641ac..55de54481 100644 --- a/cmd/generate-fix/internal/template_helpers.go +++ b/cmd/generate-fix/internal/template_helpers.go @@ -3,7 +3,7 @@ package internal import ( "fmt" - "github.com/long-bridge/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/datadictionary" ) func checkIfDecimalImportRequiredForFields(fTypes []*datadictionary.FieldType) (ok bool, err error) { diff --git a/cmd/generate-fix/internal/templates.go b/cmd/generate-fix/internal/templates.go index b90818800..cae2d567d 100644 --- a/cmd/generate-fix/internal/templates.go +++ b/cmd/generate-fix/internal/templates.go @@ -166,7 +166,7 @@ import( {{- end }} - "github.com/long-bridge/quickfix" + "github.com/quickfixgo/quickfix" {{- if checkIfEnumImportRequired .MessageDef}} "{{ importRootPath }}/enum" {{- end }} @@ -201,7 +201,7 @@ import( "{{ . }}" {{- end }} - "github.com/long-bridge/quickfix" + "github.com/quickfixgo/quickfix" {{- if checkIfEnumImportRequired .MessageDef}} "{{ importRootPath }}/enum" {{- end }} @@ -229,7 +229,7 @@ import( "{{ . }}" {{- end }} - "github.com/long-bridge/quickfix" + "github.com/quickfixgo/quickfix" {{- if checkIfEnumImportRequired .MessageDef}} "{{ importRootPath }}/enum" {{- end }} @@ -296,7 +296,7 @@ func Route(router RouteOut) (string, string, quickfix.MessageRoute) { TagTemplate = template.Must(template.New("Tag").Parse(` package tag -import("github.com/long-bridge/quickfix") +import("github.com/quickfixgo/quickfix") const ( {{- range .}} @@ -308,7 +308,7 @@ const ( FieldTemplate = template.Must(template.New("Field").Funcs(tmplFuncs).Parse(` package field import( - "github.com/long-bridge/quickfix" + "github.com/quickfixgo/quickfix" "{{ importRootPath }}/enum" "{{ importRootPath }}/tag" {{ if checkIfDecimalImportRequiredForFields . }} "github.com/shopspring/decimal" {{ end }} diff --git a/datadictionary/component_type_test.go b/datadictionary/component_type_test.go index 9331b8929..6de2b345a 100644 --- a/datadictionary/component_type_test.go +++ b/datadictionary/component_type_test.go @@ -3,7 +3,7 @@ package datadictionary_test import ( "testing" - "github.com/long-bridge/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/assert" ) diff --git a/datadictionary/field_def_test.go b/datadictionary/field_def_test.go index 9dc908ab2..9c0a68abb 100644 --- a/datadictionary/field_def_test.go +++ b/datadictionary/field_def_test.go @@ -3,7 +3,7 @@ package datadictionary_test import ( "testing" - "github.com/long-bridge/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/assert" ) diff --git a/datadictionary/field_type_test.go b/datadictionary/field_type_test.go index c96186fa7..2a4328dff 100644 --- a/datadictionary/field_type_test.go +++ b/datadictionary/field_type_test.go @@ -3,7 +3,7 @@ package datadictionary_test import ( "testing" - "github.com/long-bridge/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/assert" ) diff --git a/datadictionary/group_field_def_test.go b/datadictionary/group_field_def_test.go index eaae00847..e1e963298 100644 --- a/datadictionary/group_field_def_test.go +++ b/datadictionary/group_field_def_test.go @@ -3,7 +3,7 @@ package datadictionary_test import ( "testing" - "github.com/long-bridge/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/assert" ) diff --git a/datadictionary/message_def_test.go b/datadictionary/message_def_test.go index 3781238c0..666751fed 100644 --- a/datadictionary/message_def_test.go +++ b/datadictionary/message_def_test.go @@ -3,7 +3,7 @@ package datadictionary_test import ( "testing" - "github.com/long-bridge/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/assert" ) diff --git a/dialer.go b/dialer.go index b214fd6c8..1645076bf 100644 --- a/dialer.go +++ b/dialer.go @@ -4,7 +4,7 @@ import ( "fmt" "net" - "github.com/long-bridge/quickfix/config" + "github.com/quickfixgo/quickfix/config" "golang.org/x/net/proxy" ) diff --git a/dialer_test.go b/dialer_test.go index 2160c1dcd..510c18f04 100644 --- a/dialer_test.go +++ b/dialer_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/long-bridge/quickfix/config" + "github.com/quickfixgo/quickfix/config" "github.com/stretchr/testify/suite" ) diff --git a/file_log.go b/file_log.go index 5d36f5433..02f27b001 100644 --- a/file_log.go +++ b/file_log.go @@ -6,7 +6,7 @@ import ( "os" "path" - "github.com/long-bridge/quickfix/config" + "github.com/quickfixgo/quickfix/config" ) type fileLog struct { diff --git a/filestore.go b/filestore.go index 251719e73..182c26a88 100644 --- a/filestore.go +++ b/filestore.go @@ -9,7 +9,7 @@ import ( "strconv" "time" - "github.com/long-bridge/quickfix/config" + "github.com/quickfixgo/quickfix/config" "github.com/pkg/errors" ) diff --git a/fix_utc_timestamp_test.go b/fix_utc_timestamp_test.go index 739c91884..b29039587 100644 --- a/fix_utc_timestamp_test.go +++ b/fix_utc_timestamp_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/long-bridge/quickfix" + "github.com/quickfixgo/quickfix" ) func TestFIXUTCTimestampWrite(t *testing.T) { diff --git a/go.mod b/go.mod index 4fbb9e17f..314de9f7f 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/long-bridge/quickfix +module github.com/quickfixgo/quickfix go 1.13 diff --git a/gormstroe_test.go b/gormstroe_test.go index afd0cf812..d0e9196fb 100644 --- a/gormstroe_test.go +++ b/gormstroe_test.go @@ -23,7 +23,7 @@ func Test_GromStoreCreate(t *testing.T) { sessionID: {}, } Convey(`none session`, func() { - + }) Convey(`have session`, func() { f := NewGormStoreFactory(appSettings, db) diff --git a/in_session.go b/in_session.go index 97bc02952..d4dfc701d 100644 --- a/in_session.go +++ b/in_session.go @@ -4,7 +4,7 @@ import ( "bytes" "time" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/internal" ) type inSession struct{ loggedOn } diff --git a/in_session_test.go b/in_session_test.go index 87c89c66f..c8c0b1523 100644 --- a/in_session_test.go +++ b/in_session_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/suite" ) diff --git a/latent_state.go b/latent_state.go index a60dfb767..e6e5bece4 100644 --- a/latent_state.go +++ b/latent_state.go @@ -1,6 +1,6 @@ package quickfix -import "github.com/long-bridge/quickfix/internal" +import "github.com/quickfixgo/quickfix/internal" type latentState struct{ inSessionTime } diff --git a/logon_state.go b/logon_state.go index da7e76ab0..d254b92b3 100644 --- a/logon_state.go +++ b/logon_state.go @@ -3,7 +3,7 @@ package quickfix import ( "bytes" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/internal" ) type logonState struct{ connectedNotLoggedOn } diff --git a/logon_state_test.go b/logon_state_test.go index 4632367c2..3ba29af1d 100644 --- a/logon_state_test.go +++ b/logon_state_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/suite" ) diff --git a/logout_state.go b/logout_state.go index b5c033ac2..071512ce1 100644 --- a/logout_state.go +++ b/logout_state.go @@ -1,6 +1,6 @@ package quickfix -import "github.com/long-bridge/quickfix/internal" +import "github.com/quickfixgo/quickfix/internal" type logoutState struct{ connectedNotLoggedOn } diff --git a/logout_state_test.go b/logout_state_test.go index 24f87dd48..ce1ae84b6 100644 --- a/logout_state_test.go +++ b/logout_state_test.go @@ -3,7 +3,7 @@ package quickfix import ( "testing" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/suite" ) diff --git a/message.go b/message.go index fd74ea2a9..f800cbebf 100644 --- a/message.go +++ b/message.go @@ -6,7 +6,7 @@ import ( "math" "time" - "github.com/long-bridge/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/datadictionary" ) //Header is first section of a FIX Message diff --git a/message_test.go b/message_test.go index 9bafb0f49..3766c9221 100644 --- a/message_test.go +++ b/message_test.go @@ -5,7 +5,7 @@ import ( "reflect" "testing" - "github.com/long-bridge/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/suite" ) diff --git a/mongostore.go b/mongostore.go index e66b0f1fc..e50af2c16 100644 --- a/mongostore.go +++ b/mongostore.go @@ -7,7 +7,7 @@ import ( "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" "github.com/pkg/errors" - "github.com/long-bridge/quickfix/config" + "github.com/quickfixgo/quickfix/config" ) type mongoStoreFactory struct { diff --git a/not_session_time.go b/not_session_time.go index f187dd739..2e3b04c3d 100644 --- a/not_session_time.go +++ b/not_session_time.go @@ -1,6 +1,6 @@ package quickfix -import "github.com/long-bridge/quickfix/internal" +import "github.com/quickfixgo/quickfix/internal" type notSessionTime struct{ latentState } diff --git a/parser.go b/parser.go index c3565e217..8816345d4 100644 --- a/parser.go +++ b/parser.go @@ -6,7 +6,7 @@ import ( "io" "time" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/internal" ) const ( diff --git a/pending_timeout.go b/pending_timeout.go index d362f670f..87154dddd 100644 --- a/pending_timeout.go +++ b/pending_timeout.go @@ -1,6 +1,6 @@ package quickfix -import "github.com/long-bridge/quickfix/internal" +import "github.com/quickfixgo/quickfix/internal" type pendingTimeout struct { sessionState diff --git a/pending_timeout_test.go b/pending_timeout_test.go index 893fcc537..a9e4bf8f1 100644 --- a/pending_timeout_test.go +++ b/pending_timeout_test.go @@ -3,7 +3,7 @@ package quickfix import ( "testing" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/suite" ) diff --git a/quickfix_test.go b/quickfix_test.go index 065565936..2f511b77d 100644 --- a/quickfix_test.go +++ b/quickfix_test.go @@ -3,7 +3,7 @@ package quickfix import ( "time" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/resend_state.go b/resend_state.go index 36cfce8b1..a89d3f697 100644 --- a/resend_state.go +++ b/resend_state.go @@ -1,6 +1,6 @@ package quickfix -import "github.com/long-bridge/quickfix/internal" +import "github.com/quickfixgo/quickfix/internal" type resendState struct { loggedOn diff --git a/resend_state_test.go b/resend_state_test.go index a470408e7..aa13cc871 100644 --- a/resend_state_test.go +++ b/resend_state_test.go @@ -3,7 +3,7 @@ package quickfix import ( "testing" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/suite" ) diff --git a/session.go b/session.go index 3c60aae1e..d68096ace 100644 --- a/session.go +++ b/session.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/long-bridge/quickfix/datadictionary" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/internal" ) //The Session is the primary FIX abstraction for message communication diff --git a/session_factory.go b/session_factory.go index e491ff0d5..f4f3fc0ef 100644 --- a/session_factory.go +++ b/session_factory.go @@ -6,9 +6,9 @@ import ( "strconv" "time" - "github.com/long-bridge/quickfix/config" - "github.com/long-bridge/quickfix/datadictionary" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/config" + "github.com/quickfixgo/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/internal" ) var dayLookup = map[string]time.Weekday{ diff --git a/session_factory_test.go b/session_factory_test.go index 3a6619696..88f08f1aa 100644 --- a/session_factory_test.go +++ b/session_factory_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/long-bridge/quickfix/config" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/config" + "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/suite" ) diff --git a/session_settings_test.go b/session_settings_test.go index b1c7ce77a..34687ae2c 100644 --- a/session_settings_test.go +++ b/session_settings_test.go @@ -3,7 +3,7 @@ package quickfix import ( "testing" - "github.com/long-bridge/quickfix/config" + "github.com/quickfixgo/quickfix/config" ) func TestSessionSettings_StringSettings(t *testing.T) { diff --git a/session_state.go b/session_state.go index 63b89504b..c8b1f42a4 100644 --- a/session_state.go +++ b/session_state.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/internal" ) type stateMachine struct { diff --git a/session_test.go b/session_test.go index bb0d97c52..293b94805 100644 --- a/session_test.go +++ b/session_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/long-bridge/quickfix/internal" + "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/settings.go b/settings.go index ebd9016bb..870cf3d71 100644 --- a/settings.go +++ b/settings.go @@ -7,7 +7,7 @@ import ( "io" "regexp" - "github.com/long-bridge/quickfix/config" + "github.com/quickfixgo/quickfix/config" ) //The Settings type represents a collection of global and session settings. diff --git a/settings_test.go b/settings_test.go index 330678de1..b9c219760 100644 --- a/settings_test.go +++ b/settings_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/long-bridge/quickfix/config" + "github.com/quickfixgo/quickfix/config" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/sqlstore.go b/sqlstore.go index 6e6424f68..751ecbd3f 100644 --- a/sqlstore.go +++ b/sqlstore.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/long-bridge/quickfix/config" + "github.com/quickfixgo/quickfix/config" "github.com/pkg/errors" ) diff --git a/tls.go b/tls.go index 68b7006d0..951ac7e87 100644 --- a/tls.go +++ b/tls.go @@ -6,7 +6,7 @@ import ( "fmt" "io/ioutil" - "github.com/long-bridge/quickfix/config" + "github.com/quickfixgo/quickfix/config" ) func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) { diff --git a/tls_test.go b/tls_test.go index e19f5158c..fe6745a19 100644 --- a/tls_test.go +++ b/tls_test.go @@ -4,7 +4,7 @@ import ( "crypto/tls" "testing" - "github.com/long-bridge/quickfix/config" + "github.com/quickfixgo/quickfix/config" "github.com/stretchr/testify/suite" ) diff --git a/validation.go b/validation.go index c6817454a..59edfac31 100644 --- a/validation.go +++ b/validation.go @@ -1,7 +1,7 @@ package quickfix import ( - "github.com/long-bridge/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/datadictionary" ) type validator interface { diff --git a/validation_test.go b/validation_test.go index 172536d21..10a8a7e3f 100644 --- a/validation_test.go +++ b/validation_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/long-bridge/quickfix/datadictionary" + "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/assert" ) From 721b739678fe07cc067e0003cc3f49ad7b89c5de Mon Sep 17 00:00:00 2001 From: jacky <576102544@qq.com> Date: Mon, 26 Oct 2020 13:28:07 +0800 Subject: [PATCH 085/139] add setting yaml --- settings.go | 29 +++++++++++++++++++++++++++++ settings_test.go | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/settings.go b/settings.go index 870cf3d71..0741b7b9b 100644 --- a/settings.go +++ b/settings.go @@ -130,6 +130,35 @@ func ParseSettings(reader io.Reader) (*Settings, error) { return s, err } +//ParseMapSettings creates and initializes a Settings instance with config map. +func ParseMapSettings(configMap map[string]map[string]string) (*Settings, error) { + if configMap == nil { + return nil, errors.New(`configMap must not be nil`) + } + settings := NewSettings() + + sessionSettings := NewSessionSettings() + if defaultMap, ok := configMap[`default`]; ok { + for k, v := range defaultMap { + sessionSettings.Set(k, v) + } + } + + if sessionMap, ok := configMap[`session`]; ok { + for k, v := range sessionMap { + sessionSettings.Set(k, v) + } + + } + + _, err := settings.AddSession(sessionSettings) + if err != nil { + return nil, err + } + return settings, nil + +} + //GlobalSettings are default setting inherited by all session settings. func (s *Settings) GlobalSettings() *SessionSettings { s.lazyInit() diff --git a/settings_test.go b/settings_test.go index b9c219760..9f509fe15 100644 --- a/settings_test.go +++ b/settings_test.go @@ -289,7 +289,39 @@ DataDictionary=somewhere/FIX42.xml assert.Equal(t, tc.expected, actual) } } +func TestSettings_ParseSettingsMapConfig(t *testing.T) { + configMap := map[string]map[string]string{} + configMap[`default`] = map[string]string{ + `SocketConnectHost`: "127.0.0.1", + `SocketConnectPort`: "5001", + `HeartBtInt`: "5", + `SenderCompID`: "TW", + `TargetCompID`: "ISLD", + `ResetOnLogon`: "Y", + `FileLogPath`: "tmp", + } + configMap[`session`] = map[string]string{ + `BeginString`: "FIX.4.2", + } + + s, err := ParseMapSettings(configMap) + assert.Nil(t, err) + sessionSettings := s.SessionSettings()[SessionID{BeginString: "FIX.4.3", SenderCompID: "TW", TargetCompID: "ISLD"}] + assert.Nil(t, sessionSettings) + + sessionSettings = s.SessionSettings()[SessionID{BeginString: "FIX.4.2", SenderCompID: "TW", TargetCompID: "ISLD"}] + socketConnectHostVal, err := sessionSettings.Setting("SocketConnectHost") + assert.Nil(t, err) + assert.Equal(t, `127.0.0.1`, socketConnectHostVal) + socketConnectPortVal, err := sessionSettings.Setting("SocketConnectPort") + assert.Nil(t, err) + assert.Equal(t, `5001`, socketConnectPortVal) + beginStringVal, err := sessionSettings.Setting("BeginString") + assert.Nil(t, err) + assert.Equal(t, `FIX.4.2`, beginStringVal) + +} func TestSettings_ParseSettings_WithEqualsSignInValue(t *testing.T) { s, err := ParseSettings(strings.NewReader(` [DEFAULT] From bf594356f7471d2da9740e09e94879990013bbf7 Mon Sep 17 00:00:00 2001 From: jacky <576102544@qq.com> Date: Mon, 26 Oct 2020 14:05:55 +0800 Subject: [PATCH 086/139] add GlobalSettings --- settings.go | 6 ++---- settings_test.go | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/settings.go b/settings.go index 0741b7b9b..de9431301 100644 --- a/settings.go +++ b/settings.go @@ -137,7 +137,7 @@ func ParseMapSettings(configMap map[string]map[string]string) (*Settings, error) } settings := NewSettings() - sessionSettings := NewSessionSettings() + sessionSettings := settings.GlobalSettings() if defaultMap, ok := configMap[`default`]; ok { for k, v := range defaultMap { sessionSettings.Set(k, v) @@ -157,9 +157,7 @@ func ParseMapSettings(configMap map[string]map[string]string) (*Settings, error) } return settings, nil -} - -//GlobalSettings are default setting inherited by all session settings. +} //GlobalSettings are default setting inherited by all session settings. func (s *Settings) GlobalSettings() *SessionSettings { s.lazyInit() return s.globalSettings diff --git a/settings_test.go b/settings_test.go index 9f509fe15..f6061abc6 100644 --- a/settings_test.go +++ b/settings_test.go @@ -317,10 +317,18 @@ func TestSettings_ParseSettingsMapConfig(t *testing.T) { assert.Nil(t, err) assert.Equal(t, `5001`, socketConnectPortVal) + fileLogPathVal, err := sessionSettings.Setting("FileLogPath") + assert.Nil(t, err) + assert.Equal(t, `tmp`, fileLogPathVal) + beginStringVal, err := sessionSettings.Setting("BeginString") assert.Nil(t, err) assert.Equal(t, `FIX.4.2`, beginStringVal) + globalLogPath, err := s.GlobalSettings().Setting(config.FileLogPath) + assert.Nil(t, err) + assert.Equal(t, `tmp`, globalLogPath) + } func TestSettings_ParseSettings_WithEqualsSignInValue(t *testing.T) { s, err := ParseSettings(strings.NewReader(` From 729159c6b070bc6f14554969fd0fcadf8cb7bf2d Mon Sep 17 00:00:00 2001 From: jacky <576102544@qq.com> Date: Tue, 3 Nov 2020 11:54:10 +0800 Subject: [PATCH 087/139] add tagTargetSubID and tagSenderSubID --- registry.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/registry.go b/registry.go index 3c1fb2af8..728a271a2 100644 --- a/registry.go +++ b/registry.go @@ -30,12 +30,21 @@ func Send(m Messagable) (err error) { var senderCompID FIXString if err := msg.Header.GetField(tagSenderCompID, &senderCompID); err != nil { - - return nil + return err } - sessionID := SessionID{BeginString: string(beginString), TargetCompID: string(targetCompID), SenderCompID: string(senderCompID)} + var senderSubID FIXString + msg.Header.GetField(tagSenderSubID, &senderSubID) + + var targetSubID FIXString + msg.Header.GetField(tagTargetSubID, &targetSubID) + + if len(senderSubID) > 0 && len(targetSubID) > 0 { + sessionID := SessionID{BeginString: beginString.String(), TargetCompID: targetCompID.String(), SenderCompID: senderCompID.String(), SenderSubID: senderSubID.String(), TargetSubID: targetSubID.String()} + return SendToTarget(msg, sessionID) + } + sessionID := SessionID{BeginString: beginString.String(), TargetCompID: targetCompID.String(), SenderCompID: senderCompID.String()} return SendToTarget(msg, sessionID) } From 5990e09c004cdb8655d8d24523f02b4a4c2f969c Mon Sep 17 00:00:00 2001 From: jacky <576102544@qq.com> Date: Mon, 9 Nov 2020 17:03:04 +0800 Subject: [PATCH 088/139] If it is determined that the message is repeated, skip this insertion --- _sql/postgresql/messages_table.sql | 1 + gormstroe.go | 17 ++++++++++++++++- gormstroe_test.go | 24 +++++++++++++++++++++++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/_sql/postgresql/messages_table.sql b/_sql/postgresql/messages_table.sql index 38507c091..e87209e85 100644 --- a/_sql/postgresql/messages_table.sql +++ b/_sql/postgresql/messages_table.sql @@ -9,6 +9,7 @@ CREATE TABLE messages ( session_qualifier VARCHAR(64) NOT NULL, msgseqnum INTEGER NOT NULL, message TEXT NOT NULL, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid, targetcompid, targetsubid, targetlocid, session_qualifier, msgseqnum) diff --git a/gormstroe.go b/gormstroe.go index 9676d5fcb..5322b4de4 100644 --- a/gormstroe.go +++ b/gormstroe.go @@ -181,7 +181,7 @@ func (store *gromStore) CreationTime() time.Time { func (store *gromStore) SaveMessage(seqNum int, msg []byte) error { s := store.sessionID - return store.db.Exec(`INSERT INTO messages ( + err := store.db.Exec(`INSERT INTO messages ( msgseqnum, message, beginstring, session_qualifier, sendercompid, sendersubid, senderlocid, @@ -190,6 +190,21 @@ func (store *gromStore) SaveMessage(seqNum int, msg []byte) error { s.BeginString, s.Qualifier, s.SenderCompID, s.SenderSubID, s.SenderLocationID, s.TargetCompID, s.TargetSubID, s.TargetLocationID).Error + if err != nil { + counter := 0 + store.db.Table("messages").Where(`beginstring=? AND session_qualifier=? + AND sendercompid=? AND sendersubid=? AND senderlocid=? + AND targetcompid=? AND targetsubid=? AND targetlocid=? + AND msgseqnum=?`, s.BeginString, s.Qualifier, + s.SenderCompID, s.SenderSubID, s.SenderLocationID, + s.TargetCompID, s.TargetSubID, s.TargetLocationID, + seqNum).Limit(1).Count(&counter) + //If it is determined that the message is repeated, skip this insertion + if counter == 1 { + return nil + } + } + return err } func (store *gromStore) GetMessages(beginSeqNum, endSeqNum int) ([][]byte, error) { diff --git a/gormstroe_test.go b/gormstroe_test.go index d0e9196fb..66b064355 100644 --- a/gormstroe_test.go +++ b/gormstroe_test.go @@ -23,7 +23,7 @@ func Test_GromStoreCreate(t *testing.T) { sessionID: {}, } Convey(`none session`, func() { - + }) Convey(`have session`, func() { f := NewGormStoreFactory(appSettings, db) @@ -31,3 +31,25 @@ func Test_GromStoreCreate(t *testing.T) { }) }) } + +func Test_GromStoreSaveMessage(t *testing.T) { + Convey(`GromStoreSaveMessage`, t, func() { + db, err := NewGormDB() + db.LogMode(true) + So(err, ShouldBeNil) + So(db, ShouldNotBeNil) + sessionID := SessionID{BeginString: "FIX.4.2", TargetCompID: "IB", SenderCompID: "LB"} + appSettings := NewSettings() + appSettings.sessionSettings = map[SessionID]*SessionSettings{ + sessionID: {}, + } + Convey(`duplicate key`, func() { + f := NewGormStoreFactory(appSettings, db) + store, err := f.Create(sessionID) + So(err, ShouldBeNil) + err = store.SaveMessage(1, []byte(`test msg`)) + err = store.SaveMessage(1, []byte(`test msg`)) + So(err, ShouldBeNil) + }) + }) +} From f4440347d03421cb69991a8f186ae65484340f37 Mon Sep 17 00:00:00 2001 From: jacky <576102544@qq.com> Date: Thu, 24 Dec 2020 11:03:47 +0800 Subject: [PATCH 089/139] add readLoop.parser.ReadMessage log --- connection.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/connection.go b/connection.go index 4e5768a36..2439cc2fd 100644 --- a/connection.go +++ b/connection.go @@ -1,6 +1,9 @@ package quickfix -import "io" +import ( + "io" + "log" +) func writeLoop(connection io.Writer, messageOut chan []byte, log Log) { for { @@ -21,6 +24,7 @@ func readLoop(parser *parser, msgIn chan fixIn) { for { msg, err := parser.ReadMessage() if err != nil { + log.Printf(`readLoop.parser.ReadMessage error,error_info[%v] \r\n`, err.Error()) return } msgIn <- fixIn{msg, parser.lastRead} From 9c12adc96d144ab62f3e193a68f6ccf0d7907f90 Mon Sep 17 00:00:00 2001 From: jacky <576102544@qq.com> Date: Fri, 2 Apr 2021 14:30:07 +0800 Subject: [PATCH 090/139] fix readLoop log --- connection.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connection.go b/connection.go index 2439cc2fd..c52b55538 100644 --- a/connection.go +++ b/connection.go @@ -24,7 +24,7 @@ func readLoop(parser *parser, msgIn chan fixIn) { for { msg, err := parser.ReadMessage() if err != nil { - log.Printf(`readLoop.parser.ReadMessage error,error_info[%v] \r\n`, err.Error()) + log.Println(`parser read message failed,conection readLoop just quit, error_info->`, err.Error()) return } msgIn <- fixIn{msg, parser.lastRead} From 89a2c6ef3e90da68fd8dedb9a6913c15ae54c6bd Mon Sep 17 00:00:00 2001 From: jacky Date: Sat, 13 Aug 2022 14:55:51 +0800 Subject: [PATCH 091/139] Session Setting Support SendRateLimiter --- config/configuration.go | 1 + go.mod | 1 + go.sum | 2 ++ internal/rate_limit.go | 39 ++++++++++++++++++++++++++++++++++++ internal/session_settings.go | 3 +++ session.go | 1 + session_factory.go | 7 +++++++ session_factory_test.go | 19 ++++++++++++++++++ 8 files changed, 73 insertions(+) create mode 100644 internal/rate_limit.go diff --git a/config/configuration.go b/config/configuration.go index 8251cc04a..451c54892 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -64,4 +64,5 @@ const ( RejectInvalidMessage string = "RejectInvalidMessage" DynamicSessions string = "DynamicSessions" DynamicQualifier string = "DynamicQualifier" + SendRatePerSecond string = "SendRatePerSecond" ) diff --git a/go.mod b/go.mod index 314de9f7f..52102ed74 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 github.com/jinzhu/gorm v1.9.16 + github.com/juju/ratelimit v1.0.2 github.com/mattn/go-sqlite3 v1.14.4 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 diff --git a/go.sum b/go.sum index 770e6cdce..b4e9327f7 100644 --- a/go.sum +++ b/go.sum @@ -24,6 +24,8 @@ github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/juju/ratelimit v1.0.2 h1:sRxmtRiajbvrcLQT7S+JbqU0ntsb9W2yhSdNN8tWfaI= +github.com/juju/ratelimit v1.0.2/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= diff --git a/internal/rate_limit.go b/internal/rate_limit.go new file mode 100644 index 000000000..cf269d5d2 --- /dev/null +++ b/internal/rate_limit.go @@ -0,0 +1,39 @@ +package internal + +import ( + "time" + + "github.com/juju/ratelimit" +) + +const ( + OnceTakeCount = 1 + DefaultFillInterval = time.Second +) + +type RateLimiter struct { + ratePerSecond int64 + bucket *ratelimit.Bucket +} + +func NewRateLimiter(ratePerSecond int64) *RateLimiter { + rateLimiter := &RateLimiter{ + ratePerSecond: ratePerSecond, + } + if rateLimiter.RateLimitIsOpen() { + rateLimiter.bucket = ratelimit.NewBucketWithQuantum(DefaultFillInterval, ratePerSecond, ratePerSecond) + } + return rateLimiter +} + +func (l *RateLimiter) RateLimitIsOpen() bool { + return l.ratePerSecond > 0 +} + +func (l *RateLimiter) WaitRateLimit() { + //if set ratePerSecond zero, not control send rate + if !l.RateLimitIsOpen() { + return + } + l.bucket.Wait(OnceTakeCount) +} diff --git a/internal/session_settings.go b/internal/session_settings.go index 4c82b000d..b43a1f987 100644 --- a/internal/session_settings.go +++ b/internal/session_settings.go @@ -25,4 +25,7 @@ type SessionSettings struct { LogoutTimeout time.Duration LogonTimeout time.Duration SocketConnectAddress []string + + //rate limt + SendRateLimiter *RateLimiter } diff --git a/session.go b/session.go index d68096ace..c1465a8e4 100644 --- a/session.go +++ b/session.go @@ -332,6 +332,7 @@ func (s *session) persist(seqNum int, msgBytes []byte) error { func (s *session) sendQueued() { for _, msgBytes := range s.toSend { + s.SendRateLimiter.WaitRateLimit() s.sendBytes(msgBytes) } diff --git a/session_factory.go b/session_factory.go index f4f3fc0ef..654a14dd3 100644 --- a/session_factory.go +++ b/session_factory.go @@ -295,6 +295,13 @@ func (f sessionFactory) newSession( if s.store, err = storeFactory.Create(s.sessionID); err != nil { return } + var sendRatePerSecond int + if settings.HasSetting(config.SendRatePerSecond) { + if sendRatePerSecond, err = settings.IntSetting(config.SendRatePerSecond); err != nil { + return + } + } + s.SendRateLimiter = internal.NewRateLimiter(int64(sendRatePerSecond)) s.sessionEvent = make(chan internal.Event) s.messageEvent = make(chan bool, 1) diff --git a/session_factory_test.go b/session_factory_test.go index 88f08f1aa..1e3078356 100644 --- a/session_factory_test.go +++ b/session_factory_test.go @@ -356,6 +356,7 @@ func (s *SessionFactorySuite) TestNewSessionBuildInitiators() { s.Equal(10*time.Second, session.LogonTimeout) s.Equal(2*time.Second, session.LogoutTimeout) s.Equal("127.0.0.1:5000", session.SocketConnectAddress[0]) + s.False(session.SendRateLimiter.RateLimitIsOpen()) } func (s *SessionFactorySuite) TestNewSessionBuildInitiatorsValidHeartBtInt() { @@ -575,3 +576,21 @@ func (s *SessionFactorySuite) TestPersistMessages() { s.Equal(test.expected, session.DisableMessagePersist) } } + +func (s *SessionFactorySuite) TestSendRatePerSecond() { + s.sessionFactory.BuildInitiators = true + s.SessionSettings.Set(config.HeartBtInt, "34") + s.SessionSettings.Set(config.SocketConnectHost, "127.0.0.1") + s.SessionSettings.Set(config.SocketConnectPort, "5000") + s.SessionSettings.Set(config.SendRatePerSecond, "10") + + session, err := s.newSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App) + s.Nil(err) + s.True(session.InitiateLogon) + s.Equal(34*time.Second, session.HeartBtInt) + s.Equal(30*time.Second, session.ReconnectInterval) + s.Equal(10*time.Second, session.LogonTimeout) + s.Equal(2*time.Second, session.LogoutTimeout) + s.Equal("127.0.0.1:5000", session.SocketConnectAddress[0]) + s.True(session.SendRateLimiter.RateLimitIsOpen()) +} From 24d05ebf4700d5d10a76e650cc104b229fa5892a Mon Sep 17 00:00:00 2001 From: jacky Date: Sat, 13 Aug 2022 15:35:35 +0800 Subject: [PATCH 092/139] Session Setting Support SendRateLimiter --- logon_state.go | 1 + 1 file changed, 1 insertion(+) diff --git a/logon_state.go b/logon_state.go index d254b92b3..9e9b20683 100644 --- a/logon_state.go +++ b/logon_state.go @@ -15,6 +15,7 @@ func (s logonState) FixMsgIn(session *session, msg *Message) (nextState sessionS if err != nil { return handleStateError(session, err) } + session.application.FromAdmin(msg, session.sessionID) if !bytes.Equal(msgType, msgTypeLogon) { session.log.OnEventf("Invalid Session State: Received Msg %s while waiting for Logon", msg) From 254d0f3c73ab73658eeb6eb095aeb8dd3af1e007 Mon Sep 17 00:00:00 2001 From: jacky Date: Thu, 25 Aug 2022 14:40:32 +0800 Subject: [PATCH 093/139] refactor rate limit --- go.mod | 1 - go.sum | 2 - internal/rate_limit.go | 72 ++++++++++++++++-------- internal/ratelimit_test.go | 103 +++++++++++++++++++++++++++++++++++ internal/session_settings.go | 3 +- session.go | 4 +- session_factory.go | 2 +- session_factory_test.go | 2 - 8 files changed, 159 insertions(+), 30 deletions(-) create mode 100644 internal/ratelimit_test.go diff --git a/go.mod b/go.mod index 52102ed74..314de9f7f 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ require ( github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 github.com/jinzhu/gorm v1.9.16 - github.com/juju/ratelimit v1.0.2 github.com/mattn/go-sqlite3 v1.14.4 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 diff --git a/go.sum b/go.sum index b4e9327f7..770e6cdce 100644 --- a/go.sum +++ b/go.sum @@ -24,8 +24,6 @@ github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/ratelimit v1.0.2 h1:sRxmtRiajbvrcLQT7S+JbqU0ntsb9W2yhSdNN8tWfaI= -github.com/juju/ratelimit v1.0.2/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= diff --git a/internal/rate_limit.go b/internal/rate_limit.go index cf269d5d2..5b867bf02 100644 --- a/internal/rate_limit.go +++ b/internal/rate_limit.go @@ -1,39 +1,67 @@ package internal import ( + "container/list" + "sync" "time" - - "github.com/juju/ratelimit" ) -const ( - OnceTakeCount = 1 - DefaultFillInterval = time.Second -) +type token struct { + enableTime time.Time +} -type RateLimiter struct { - ratePerSecond int64 - bucket *ratelimit.Bucket +type LimitBucket struct { + fillInterval time.Duration + queue *list.List + mutex sync.Mutex } -func NewRateLimiter(ratePerSecond int64) *RateLimiter { - rateLimiter := &RateLimiter{ - ratePerSecond: ratePerSecond, +func New(fillInterval time.Duration, limit uint64) *LimitBucket { + bucket := &LimitBucket{ + fillInterval: fillInterval, + queue: list.New(), } - if rateLimiter.RateLimitIsOpen() { - rateLimiter.bucket = ratelimit.NewBucketWithQuantum(DefaultFillInterval, ratePerSecond, ratePerSecond) + now := time.Now() + for i := 0; i < int(limit); i++ { + bucket.queue.PushBack(&token{ + enableTime: now, + }) } - return rateLimiter + return bucket } -func (l *RateLimiter) RateLimitIsOpen() bool { - return l.ratePerSecond > 0 +func (bucket *LimitBucket) Wait() { + for { + if bucket.tryTakeToken() { + return + } + } +} + +func (bucket *LimitBucket) WaitForTimeout(timeout time.Duration) { + begin := time.Now() + for { + if time.Now().After(begin.Add(timeout)) { + return + } + if bucket.tryTakeToken() { + return + } + } } -func (l *RateLimiter) WaitRateLimit() { - //if set ratePerSecond zero, not control send rate - if !l.RateLimitIsOpen() { - return +func (bucket *LimitBucket) tryTakeToken() bool { + bucket.mutex.Lock() + defer bucket.mutex.Unlock() + front := bucket.queue.Front() + fristToken := front.Value.(*token) + now := time.Now() + if now.After(fristToken.enableTime) { + bucket.queue.Remove(front) + bucket.queue.PushBack(&token{ + enableTime: now.Add(bucket.fillInterval), + }) + return true } - l.bucket.Wait(OnceTakeCount) + return false } diff --git a/internal/ratelimit_test.go b/internal/ratelimit_test.go new file mode 100644 index 000000000..db3ee0864 --- /dev/null +++ b/internal/ratelimit_test.go @@ -0,0 +1,103 @@ +package internal + +import ( + "fmt" + "math/rand" + "testing" + "time" +) + +func TestWaitNormal(t *testing.T) { + bucket := New(time.Second*1, 2) + + for i := 0; i < 10; i++ { + bucket.Wait() + t.Log(time.Now(), "|", i) + } +} + +func TestWaitForTimeout(t *testing.T) { + bucket := New(time.Second*3, 3) + + for i := 0; i < 10; i++ { + bucket.WaitForTimeout(time.Second) + t.Log(time.Now(), "|", i) + } + + for i := 0; i < 10; i++ { + bucket.WaitForTimeout(time.Second * 5) + t.Log(time.Now(), "|", i) + } +} + +func TestWaitRandom(t *testing.T) { + bucket := New(time.Second*1, 3) + for i := 0; i < 10; i++ { + bucket.Wait() + time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) + t.Log(time.Now(), "|", i) + } +} + +// func TestWaitConcurrenyOld(t *testing.T) { +// bucket := NewRateLimiter(8) + +// for i := 0; i < 5; i++ { +// bucket.WaitRateLimit() +// t.Log("1:", time.Now(), "|", i) +// } +// time.Sleep(time.Millisecond * 900) +// go func() { +// for i := 0; i < 55; i++ { +// bucket.WaitRateLimit() +// t.Log("2:", time.Now(), "|", i) +// } +// }() + +// time.Sleep(time.Second * 30) +// } + +func TestWaitConcurreny1(t *testing.T) { + bucket := New(time.Second, 8) + + for i := 0; i < 5; i++ { + bucket.Wait() + t.Log("1:", time.Now(), "|", i) + } + time.Sleep(time.Millisecond * 900) + go func() { + for i := 0; i < 55; i++ { + bucket.Wait() + t.Log("1:", time.Now(), "|", i) + } + }() + + time.Sleep(time.Second * 30) +} + +func write(messageOut chan string) { + for { + text := <-messageOut + fmt.Println(time.Now(), text) + time.Sleep(time.Millisecond * time.Duration(100)) + } +} + +func TestWaitConcurreny2(t *testing.T) { + bucket := New(time.Second*2, 5) + messageOut := make(chan string) + go write(messageOut) + go func() { + for i := 0; i < 20; i++ { + bucket.Wait() + messageOut <- fmt.Sprintf("No.1 Worker, task:%v", i) + } + }() + go func() { + for i := 0; i < 20; i++ { + bucket.Wait() + messageOut <- fmt.Sprintf("No.2 Worker, task:%v", i) + } + }() + time.Sleep(time.Second * 30) +} diff --git a/internal/session_settings.go b/internal/session_settings.go index b43a1f987..6c91ec20d 100644 --- a/internal/session_settings.go +++ b/internal/session_settings.go @@ -27,5 +27,6 @@ type SessionSettings struct { SocketConnectAddress []string //rate limt - SendRateLimiter *RateLimiter + //SendRateLimiter *RateLimiter + LimitBucket *LimitBucket } diff --git a/session.go b/session.go index c1465a8e4..7b086d9b8 100644 --- a/session.go +++ b/session.go @@ -332,7 +332,9 @@ func (s *session) persist(seqNum int, msgBytes []byte) error { func (s *session) sendQueued() { for _, msgBytes := range s.toSend { - s.SendRateLimiter.WaitRateLimit() + if s.LimitBucket != nil { + s.LimitBucket.Wait() + } s.sendBytes(msgBytes) } diff --git a/session_factory.go b/session_factory.go index 654a14dd3..ed31f3ba1 100644 --- a/session_factory.go +++ b/session_factory.go @@ -300,8 +300,8 @@ func (f sessionFactory) newSession( if sendRatePerSecond, err = settings.IntSetting(config.SendRatePerSecond); err != nil { return } + s.LimitBucket = internal.New(time.Second, uint64(sendRatePerSecond)) } - s.SendRateLimiter = internal.NewRateLimiter(int64(sendRatePerSecond)) s.sessionEvent = make(chan internal.Event) s.messageEvent = make(chan bool, 1) diff --git a/session_factory_test.go b/session_factory_test.go index 1e3078356..63a5a004b 100644 --- a/session_factory_test.go +++ b/session_factory_test.go @@ -356,7 +356,6 @@ func (s *SessionFactorySuite) TestNewSessionBuildInitiators() { s.Equal(10*time.Second, session.LogonTimeout) s.Equal(2*time.Second, session.LogoutTimeout) s.Equal("127.0.0.1:5000", session.SocketConnectAddress[0]) - s.False(session.SendRateLimiter.RateLimitIsOpen()) } func (s *SessionFactorySuite) TestNewSessionBuildInitiatorsValidHeartBtInt() { @@ -592,5 +591,4 @@ func (s *SessionFactorySuite) TestSendRatePerSecond() { s.Equal(10*time.Second, session.LogonTimeout) s.Equal(2*time.Second, session.LogoutTimeout) s.Equal("127.0.0.1:5000", session.SocketConnectAddress[0]) - s.True(session.SendRateLimiter.RateLimitIsOpen()) } From b617d62e58d79e98b47f1812657a3eedfc9c0a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E5=A5=87=E6=A5=A0?= Date: Wed, 26 Oct 2022 11:37:14 +0800 Subject: [PATCH 094/139] add ParseMapSettingsV2 func --- settings.go | 28 ++++++++++++++- settings_test.go | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+), 1 deletion(-) diff --git a/settings.go b/settings.go index de9431301..d05f40b22 100644 --- a/settings.go +++ b/settings.go @@ -157,7 +157,33 @@ func ParseMapSettings(configMap map[string]map[string]string) (*Settings, error) } return settings, nil -} //GlobalSettings are default setting inherited by all session settings. +} + +//ParseMapSettingsV2 creates and initializes a Settings instance with globalConfig and sessionConfigs. +func ParseMapSettingsV2(globalConfig map[string]string, sessionConfigs []map[string]string) (*Settings, error) { + if globalConfig == nil || sessionConfigs == nil { + return nil, errors.New(`globalConfig and sessionConfigs must not be nil`) + } + s := NewSettings() + + // parse global settings + for k, v := range globalConfig { + s.GlobalSettings().Set(k, v) + } + + // parse session settings + for _, sessionConfig := range sessionConfigs { + sessionSetting := NewSessionSettings() + for k, v := range sessionConfig { + sessionSetting.Set(k, v) + } + s.AddSession(sessionSetting) + } + + return s, nil +} + +//GlobalSettings are default setting inherited by all session settings. func (s *Settings) GlobalSettings() *SessionSettings { s.lazyInit() return s.globalSettings diff --git a/settings_test.go b/settings_test.go index f6061abc6..57ea619f4 100644 --- a/settings_test.go +++ b/settings_test.go @@ -1,6 +1,7 @@ package quickfix import ( + "reflect" "strings" "testing" @@ -411,3 +412,91 @@ func TestSettings_SessionIDFromSessionSettings(t *testing.T) { } } } + +func TestParseMapSettingsV2(t *testing.T) { + type args struct { + globalConfig map[string]string + sessionConfigs []map[string]string + } + tests := []struct { + name string + args args + want *Settings + wantErr bool + }{ + { + name: "correct globalConfig, correct sessionConfigs", + args: args{ + globalConfig: map[string]string{ + "HeartBtInt": "30", + }, + sessionConfigs: []map[string]string{ + { + "SenderCompID": "TestSender", + "TargetCompID": "TestTarget", + "BeginString": BeginStringFIX44, + }, + }, + }, + want: &Settings{ + globalSettings: &SessionSettings{ + settings: map[string]string{ + "HeartBtInt": "30", + }, + }, + sessionSettings: map[SessionID]*SessionSettings{ + { + SenderCompID: "TestSender", + TargetCompID: "TestTarget", + BeginString: BeginStringFIX44, + }: { + settings: map[string]string{ + "SenderCompID": "TestSender", + "TargetCompID": "TestTarget", + "BeginString": BeginStringFIX44, + }, + }, + }, + }, + wantErr: false, + }, + { + name: "correct globalConfig, nil sessionConfigs", + args: args{ + globalConfig: map[string]string{ + "HeartBtInt": "30", + }, + sessionConfigs: nil, + }, + want: nil, + wantErr: true, + }, + { + name: "nil globalConfig, correct sessionConfigs", + args: args{ + globalConfig: nil, + sessionConfigs: []map[string]string{ + { + "SenderCompID": "TestSender", + "TargetCompID": "TestTarget", + "BeginString": BeginStringFIX44, + }, + }, + }, + want: nil, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := ParseMapSettingsV2(tt.args.globalConfig, tt.args.sessionConfigs) + if (err != nil) != tt.wantErr { + t.Errorf("ParseMapSettingsV2() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("ParseMapSettingsV2() = %v, want %v", got, tt.want) + } + }) + } +} From 6dec1ab106e15aa53b0cc8149729a72789288836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E5=A5=87=E6=A5=A0?= Date: Thu, 27 Oct 2022 11:20:38 +0800 Subject: [PATCH 095/139] add test case --- settings_test.go | 54 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/settings_test.go b/settings_test.go index 57ea619f4..cacd90e96 100644 --- a/settings_test.go +++ b/settings_test.go @@ -425,7 +425,7 @@ func TestParseMapSettingsV2(t *testing.T) { wantErr bool }{ { - name: "correct globalConfig, correct sessionConfigs", + name: "correct globalConfig, correct one sessionConfig", args: args{ globalConfig: map[string]string{ "HeartBtInt": "30", @@ -460,6 +460,58 @@ func TestParseMapSettingsV2(t *testing.T) { }, wantErr: false, }, + { + name: "correct globalConfig, correct multiple sessionConfigs", + args: args{ + globalConfig: map[string]string{ + "HeartBtInt": "30", + }, + sessionConfigs: []map[string]string{ + { + "SenderCompID": "TestSender1", + "TargetCompID": "TestTarget1", + "BeginString": BeginStringFIX44, + }, + { + "SenderCompID": "TestSender2", + "TargetCompID": "TestTarget2", + "BeginString": BeginStringFIX42, + }, + }, + }, + want: &Settings{ + globalSettings: &SessionSettings{ + settings: map[string]string{ + "HeartBtInt": "30", + }, + }, + sessionSettings: map[SessionID]*SessionSettings{ + { + SenderCompID: "TestSender1", + TargetCompID: "TestTarget1", + BeginString: BeginStringFIX44, + }: { + settings: map[string]string{ + "SenderCompID": "TestSender1", + "TargetCompID": "TestTarget1", + "BeginString": BeginStringFIX44, + }, + }, + { + SenderCompID: "TestSender2", + TargetCompID: "TestTarget2", + BeginString: BeginStringFIX42, + }: { + settings: map[string]string{ + "SenderCompID": "TestSender2", + "TargetCompID": "TestTarget2", + "BeginString": BeginStringFIX42, + }, + }, + }, + }, + wantErr: false, + }, { name: "correct globalConfig, nil sessionConfigs", args: args{ From f621bb0ff6d4607e0fde5b2c373d70047a515a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E5=A5=87=E6=A5=A0?= Date: Thu, 27 Oct 2022 11:53:19 +0800 Subject: [PATCH 096/139] catch errors in AddSession --- settings.go | 6 +++++- settings_test.go | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/settings.go b/settings.go index d05f40b22..f5371b730 100644 --- a/settings.go +++ b/settings.go @@ -177,7 +177,11 @@ func ParseMapSettingsV2(globalConfig map[string]string, sessionConfigs []map[str for k, v := range sessionConfig { sessionSetting.Set(k, v) } - s.AddSession(sessionSetting) + + _, err := s.AddSession(sessionSetting) + if err != nil { + return nil, err + } } return s, nil diff --git a/settings_test.go b/settings_test.go index cacd90e96..cab120eea 100644 --- a/settings_test.go +++ b/settings_test.go @@ -538,6 +538,22 @@ func TestParseMapSettingsV2(t *testing.T) { want: nil, wantErr: true, }, + { + name: "correct globalConfig, invalid sessionConfigs", + args: args{ + globalConfig: map[string]string{ + "HeartBtInt": "30", + }, + sessionConfigs: []map[string]string{ + { + "SenderCompID": "TestSender", + "TargetCompID": "TestTarget", + }, + }, + }, + want: nil, + wantErr: true, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From 8e161fb42255bbd13f7c498f4aaf619357608d2d Mon Sep 17 00:00:00 2001 From: xuchao Date: Mon, 13 Feb 2023 21:08:31 +0800 Subject: [PATCH 097/139] upgrade_gormv2 --- .idea/.gitignore | 8 ++++ .idea/modules.xml | 8 ++++ .idea/quickfix.iml | 9 +++++ .idea/vcs.xml | 6 +++ go.mod | 6 ++- go.sum | 94 ++++++++++++++++++++++++++++++++++++++-------- gormstore_model.go | 41 ++++++++++++++++++++ gormstroe.go | 32 ++++++++++++++-- gormstroe_test.go | 14 +++++-- 9 files changed, 193 insertions(+), 25 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/modules.xml create mode 100644 .idea/quickfix.iml create mode 100644 .idea/vcs.xml create mode 100644 gormstore_model.go diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..13566b81b --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..e06ebba25 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/quickfix.iml b/.idea/quickfix.iml new file mode 100644 index 000000000..5e764c4f0 --- /dev/null +++ b/.idea/quickfix.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..94a25f7f4 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/go.mod b/go.mod index 314de9f7f..49f0fd073 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,8 @@ require ( github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 github.com/smartystreets/goconvey v1.6.4 - github.com/stretchr/testify v1.6.1 - golang.org/x/net v0.0.0-20200707034311-ab3426394381 + github.com/stretchr/testify v1.8.0 + golang.org/x/net v0.3.0 + gorm.io/driver/postgres v1.4.7 + gorm.io/gorm v1.24.5 ) diff --git a/go.sum b/go.sum index 770e6cdce..81dd5eaa1 100644 --- a/go.sum +++ b/go.sum @@ -2,28 +2,44 @@ github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBK github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 h1:dmVRVC/MmuwC2edm/P6oWIP+9n+p9IgVgK0lq9mBQjU= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.2.0 h1:NdPpngX0Y6z6XDFKqmFQaE+bCtkqzvQIOt1wvBlAqs8= +github.com/jackc/pgx/v5 v5.2.0/go.mod h1:Ptn7zmohNsWEsdxRawMzk3gaKma2obW+NWTnKa0S4nk= +github.com/jackc/puddle/v2 v2.1.2/go.mod h1:2lpufsF5mRHO6SuZkm0fNYxM6SWHfvyFj62KwNzgels= github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= @@ -33,34 +49,82 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= +golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/postgres v1.4.7 h1:J06jXZCNq7Pdf7LIPn8tZn9LsWjd81BRSKveKNr0ZfA= +gorm.io/driver/postgres v1.4.7/go.mod h1:UJChCNLFKeBqQRE+HrkFUbKbq9idPXmTOk2u4Wok8S4= +gorm.io/gorm v1.24.2/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= +gorm.io/gorm v1.24.5 h1:g6OPREKqqlWq4kh/3MCQbZKImeB9e6Xgc4zD+JgNZGE= +gorm.io/gorm v1.24.5/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= diff --git a/gormstore_model.go b/gormstore_model.go new file mode 100644 index 000000000..a244def41 --- /dev/null +++ b/gormstore_model.go @@ -0,0 +1,41 @@ +package quickfix + +import ( + "time" +) + +type GormSessions struct { + BeginString string `gorm:"column:beginstring;primaryKey;type:varchar(8)"` + SenderCompId string `gorm:"column:sendercompid;primaryKey;type:varchar(64)"` + SenderSubId string `gorm:"column:sendersubid;primaryKey;type:varchar(64)"` + SenderLocId string `gorm:"column:senderlocid;primaryKey;type:varchar(64)"` + TargetCompId string `gorm:"column:targetcompid;primaryKey;type:varchar(64)"` + TargetSubId string `gorm:"column:targetsubid;primaryKey;type:varchar(64)"` + TargetLocId string `gorm:"column:targetlocid;primaryKey;type:varchar(64)"` + SessionQualifier string `gorm:"column:session_qualifier;primaryKey;type:varchar(64)"` + CreationTime time.Time `gorm:"column:creation_time"` + IncomingSeqNum int64 `gorm:"column:incoming_seqnum"` + OutgoingSeqNum int64 `gorm:"column:outgoing_seqnum"` +} + +func (g GormSessions) TableName() string { + return "sessions" +} + +type GormMessages struct { + BeginString string `gorm:"column:beginstring;primaryKey;type:varchar(8)"` + SenderCompId string `gorm:"column:sendercompid;primaryKey;type:varchar(64)"` + SenderSubId string `gorm:"column:sendersubid;primaryKey;type:varchar(64)"` + SenderLocId string `gorm:"column:senderlocid;primaryKey;type:varchar(64)"` + TargetCompId string `gorm:"column:targetcompid;primaryKey;type:varchar(64)"` + TargetSubId string `gorm:"column:targetsubid;primaryKey;type:varchar(64)"` + TargetLocId string `gorm:"column:targetlocid;primaryKey;type:varchar(64)"` + SessionQualifier string `gorm:"column:session_qualifier;primaryKey;type:varchar(64)"` + CreatedAt time.Time `gorm:"column:created_at"` + Message string `gorm:"column:message;type:text"` + MsgSeqNum int64 `gorm:"column:msgseqnum;primaryKey"` +} + +func (g GormMessages) TableName() string { + return "messages" +} diff --git a/gormstroe.go b/gormstroe.go index 5322b4de4..d97654524 100644 --- a/gormstroe.go +++ b/gormstroe.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/jinzhu/gorm" "github.com/pkg/errors" + "gorm.io/gorm" ) type gormStoreFactory struct { @@ -34,6 +34,11 @@ func (f gormStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, er cache: &memoryStore{}, db: f.db, } + err = store.initTables() + if err != nil { + err = errors.Wrap(err, "initTables err") + return + } if err = store.cache.Reset(); err != nil { err = errors.Wrap(err, "cache reset") return @@ -45,6 +50,22 @@ func (f gormStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, er } +func (store *gromStore) initTables() (err error) { + if !store.db.Migrator().HasTable("sessions") { + err = store.db.Migrator().CreateTable(&GormSessions{}) + if err != nil { + return errors.Wrap(err, "gromStore.initTables err") + } + } + if !store.db.Migrator().HasTable("messages") { + err = store.db.Migrator().CreateTable(&GormMessages{}) + if err != nil { + return errors.Wrap(err, "gromStore.initTables err") + } + } + return nil +} + // Reset deletes the store records and sets the seqnums back to 1 func (store *gromStore) Reset() error { s := store.sessionID @@ -102,7 +123,7 @@ func (store *gromStore) populateCache() error { } return nil } - if gorm.IsRecordNotFoundError(err) { + if err == gorm.ErrRecordNotFound { return store.db.Exec(`INSERT INTO sessions ( creation_time, incoming_seqnum, outgoing_seqnum, beginstring, session_qualifier, @@ -191,7 +212,7 @@ func (store *gromStore) SaveMessage(seqNum int, msg []byte) error { s.SenderCompID, s.SenderSubID, s.SenderLocationID, s.TargetCompID, s.TargetSubID, s.TargetLocationID).Error if err != nil { - counter := 0 + var counter int64 store.db.Table("messages").Where(`beginstring=? AND session_qualifier=? AND sendercompid=? AND sendersubid=? AND senderlocid=? AND targetcompid=? AND targetsubid=? AND targetlocid=? @@ -240,7 +261,10 @@ func (store *gromStore) GetMessages(beginSeqNum, endSeqNum int) ([][]byte, error // Close closes the store's database connection func (store *gromStore) Close() error { if store.db != nil { - store.db.Close() + db, err := store.db.DB() + if err != nil { + db.Close() + } store.db = nil } return nil diff --git a/gormstroe_test.go b/gormstroe_test.go index 66b064355..86fb7c993 100644 --- a/gormstroe_test.go +++ b/gormstroe_test.go @@ -1,20 +1,27 @@ package quickfix import ( + "fmt" "testing" - "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/postgres" . "github.com/smartystreets/goconvey/convey" + "gorm.io/driver/postgres" + "gorm.io/gorm" ) func NewGormDB() (*gorm.DB, error) { - return gorm.Open("postgres", "host=127.0.0.1 user=postgres dbname=initiator sslmode=disable password=123456") + dsn := "host=127.0.0.1 user=postgres dbname=lb_test port=5432 sslmode=disable TimeZone=Asia/Shanghai" + db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{}) + if err == nil { + fmt.Println(db.Migrator().DropTable(&GormMessages{})) + db.Migrator().DropTable(&GormSessions{}) + } + return db, err } func Test_GromStoreCreate(t *testing.T) { Convey(`GromStoreCreate`, t, func() { db, err := NewGormDB() - db.LogMode(true) So(err, ShouldBeNil) So(db, ShouldNotBeNil) sessionID := SessionID{BeginString: "FIX.4.2", TargetCompID: "IB", SenderCompID: "LB"} @@ -35,7 +42,6 @@ func Test_GromStoreCreate(t *testing.T) { func Test_GromStoreSaveMessage(t *testing.T) { Convey(`GromStoreSaveMessage`, t, func() { db, err := NewGormDB() - db.LogMode(true) So(err, ShouldBeNil) So(db, ShouldNotBeNil) sessionID := SessionID{BeginString: "FIX.4.2", TargetCompID: "IB", SenderCompID: "LB"} From 902d91166523fd8e13af4be7f908080cf56ff5b8 Mon Sep 17 00:00:00 2001 From: xuchao Date: Mon, 13 Feb 2023 21:09:23 +0800 Subject: [PATCH 098/139] rm idea files --- .idea/.gitignore | 8 ---- .idea/modules.xml | 8 ---- .idea/quickfix.iml | 9 ---- .idea/vcs.xml | 6 --- .idea/workspace.xml | 100 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+), 31 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/modules.xml delete mode 100644 .idea/quickfix.iml delete mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b81b..000000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index e06ebba25..000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/quickfix.iml b/.idea/quickfix.iml deleted file mode 100644 index 5e764c4f0..000000000 --- a/.idea/quickfix.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f4..000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 000000000..50841edd5 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + \ No newline at end of file From 56d7cd9f96b4eefa8ccbd5813638349025c4bf32 Mon Sep 17 00:00:00 2001 From: xuchao Date: Mon, 13 Feb 2023 22:17:14 +0800 Subject: [PATCH 099/139] upgrade gomod --- .idea/modules.xml | 8 ++ .idea/quickfix.iml | 9 ++ .idea/vcs.xml | 6 ++ .idea/workspace.xml | 38 ++++----- go.mod | 15 +++- go.sum | 204 ++++++++++++++++++++++++++++++++++++-------- gormstroe_test.go | 3 - 7 files changed, 222 insertions(+), 61 deletions(-) create mode 100644 .idea/modules.xml create mode 100644 .idea/quickfix.iml create mode 100644 .idea/vcs.xml diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..e06ebba25 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/quickfix.iml b/.idea/quickfix.iml new file mode 100644 index 000000000..5e764c4f0 --- /dev/null +++ b/.idea/quickfix.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..94a25f7f4 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 50841edd5..0ef542166 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,9 +5,9 @@ + - - { + "keyToString": { + "DefaultGoTemplateProperty": "Go File", + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "RunOnceActivity.go.format.on.save.advertiser.fired": "true", + "RunOnceActivity.go.formatter.settings.were.checked": "true", + "RunOnceActivity.go.migrated.go.modules.settings": "true", + "RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true", + "RunOnceActivity.go.watchers.conflict.with.on.save.actions.check.performed": "true", + "WebServerToolWindowFactoryState": "false", + "go.import.settings.migrated": "true", + "go.sdk.automatically.set": "true", + "last_opened_file_path": "/Users/xuchaochi/go/src/quickfix", + "nodejs_package_manager_path": "npm" } -}]]> - +} + @@ -84,9 +84,9 @@ - + diff --git a/go.mod b/go.mod index 49f0fd073..002b30906 100644 --- a/go.mod +++ b/go.mod @@ -3,15 +3,24 @@ module github.com/quickfixgo/quickfix go 1.13 require ( + github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 // indirect github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 - github.com/jinzhu/gorm v1.9.16 + github.com/jcmturner/gokrb5/v8 v8.2.0 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/mattn/go-sqlite3 v1.14.4 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 github.com/smartystreets/goconvey v1.6.4 github.com/stretchr/testify v1.8.0 + golang.org/x/crypto v0.4.0 // indirect golang.org/x/net v0.3.0 - gorm.io/driver/postgres v1.4.7 - gorm.io/gorm v1.24.5 + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/jcmturner/aescts.v1 v1.0.1 // indirect + gopkg.in/jcmturner/dnsutils.v1 v1.0.1 // indirect + gopkg.in/jcmturner/goidentity.v3 v3.0.0 // indirect + gopkg.in/jcmturner/gokrb5.v7 v7.5.0 // indirect + gopkg.in/jcmturner/rpc.v1 v1.1.0 // indirect + gorm.io/driver/postgres v1.3.1 + gorm.io/gorm v1.23.3 ) diff --git a/go.sum b/go.sum index 81dd5eaa1..51fbbe965 100644 --- a/go.sum +++ b/go.sum @@ -1,130 +1,262 @@ -github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= -github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 h1:P5U+E4x5OkVEKQDklVPmzs71WM56RTTRqV4OrDC//Y4= +github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 h1:dmVRVC/MmuwC2edm/P6oWIP+9n+p9IgVgK0lq9mBQjU= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= +github.com/gorilla/sessions v1.2.0 h1:S7P+1Hm5V/AT9cjEcUD5uDaQSX0OE577aCXgoaKpYbQ= +github.com/gorilla/sessions v1.2.0/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.10.1 h1:DzdIHIjG1AxGwoEEqS+mGsURyjt4enSmqzACXvVzOT8= +github.com/jackc/pgconn v1.10.1/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.2.0 h1:r7JypeP2D3onoQTCxWdTpCtJ4D+qpKr0TxvoyMhZ5ns= +github.com/jackc/pgproto3/v2 v2.2.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.2.0 h1:NdPpngX0Y6z6XDFKqmFQaE+bCtkqzvQIOt1wvBlAqs8= -github.com/jackc/pgx/v5 v5.2.0/go.mod h1:Ptn7zmohNsWEsdxRawMzk3gaKma2obW+NWTnKa0S4nk= -github.com/jackc/puddle/v2 v2.1.2/go.mod h1:2lpufsF5mRHO6SuZkm0fNYxM6SWHfvyFj62KwNzgels= -github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= -github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.9.1 h1:MJc2s0MFS8C3ok1wQTdQxWuXQcB6+HwAm5x1CzW7mf0= +github.com/jackc/pgtype v1.9.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.14.1 h1:71oo1KAGI6mXhLiTMn6iDFcp3e7+zon/capWjl2OEFU= +github.com/jackc/pgx/v4 v4.14.1/go.mod h1:RgDuE4Z34o7XE92RpLsvFiOEfrAUT0Xt2KxvX73W06M= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= +github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= +github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= +github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= +github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= +github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= +github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= +github.com/jcmturner/gokrb5/v8 v8.2.0 h1:lzPl/30ZLkTveYsYZPKMcgXc8MbnE6RsTd4F9KgiLtk= +github.com/jcmturner/gokrb5/v8 v8.2.0/go.mod h1:T1hnNppQsBtxW0tCHMHTkAt8n/sABdzZgZdoFrZaZNM= +github.com/jcmturner/rpc/v2 v2.0.2 h1:gMB4IwRXYsWw4Bc6o/az2HJgFUA1ffSh90i26ZJ6Xl0= +github.com/jcmturner/rpc/v2 v2.0.2/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.4 h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= -github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= -github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.6.0 h1:I5DPxhYJChW9KYc66se+oKFFQX6VuQrKiprsX6ivRZc= +github.com/lib/pq v1.6.0/go.mod h1:4vXEAYvW1fRQ2/FhZ78H73A60MHw1geSm145z2mdY1g= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-sqlite3 v1.14.4 h1:4rQjbDxdu9fSgI/r3KN72G3c2goxknAqHHgPWWs8UlI= github.com/mattn/go-sqlite3 v1.14.4/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= +gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= +gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= +gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= +gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.4.7 h1:J06jXZCNq7Pdf7LIPn8tZn9LsWjd81BRSKveKNr0ZfA= -gorm.io/driver/postgres v1.4.7/go.mod h1:UJChCNLFKeBqQRE+HrkFUbKbq9idPXmTOk2u4Wok8S4= -gorm.io/gorm v1.24.2/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= -gorm.io/gorm v1.24.5 h1:g6OPREKqqlWq4kh/3MCQbZKImeB9e6Xgc4zD+JgNZGE= -gorm.io/gorm v1.24.5/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= +gorm.io/driver/postgres v0.2.4 h1:WeYJbJX66Yj5R+hnBgfjpmtoUYGpphSSiakhAorVYfc= +gorm.io/driver/postgres v0.2.4/go.mod h1:nKAMTWR3HotfKKWcK4A/ZrxU55IqzONLyCxeXyHdzfA= +gorm.io/driver/postgres v1.3.1 h1:Pyv+gg1Gq1IgsLYytj/S2k7ebII3CzEdpqQkPOdH24g= +gorm.io/driver/postgres v1.3.1/go.mod h1:WwvWOuR9unCLpGWCL6Y3JOeBWvbKi6JLhayiVclSZZU= +gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.3 h1:jYh3nm7uLZkrMVfA8WVNjDZryKfr7W+HTlInVgKFJAg= +gorm.io/gorm v1.23.3/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff --git a/gormstroe_test.go b/gormstroe_test.go index 86fb7c993..8075f50fa 100644 --- a/gormstroe_test.go +++ b/gormstroe_test.go @@ -1,10 +1,8 @@ package quickfix import ( - "fmt" "testing" - _ "github.com/jinzhu/gorm/dialects/postgres" . "github.com/smartystreets/goconvey/convey" "gorm.io/driver/postgres" "gorm.io/gorm" @@ -14,7 +12,6 @@ func NewGormDB() (*gorm.DB, error) { dsn := "host=127.0.0.1 user=postgres dbname=lb_test port=5432 sslmode=disable TimeZone=Asia/Shanghai" db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{}) if err == nil { - fmt.Println(db.Migrator().DropTable(&GormMessages{})) db.Migrator().DropTable(&GormSessions{}) } return db, err From db41406cf4f93374618a6243366da4af4e4d5807 Mon Sep 17 00:00:00 2001 From: xuchao Date: Mon, 13 Feb 2023 22:17:44 +0800 Subject: [PATCH 100/139] upgrade gomod --- .idea/modules.xml | 8 ---- .idea/quickfix.iml | 9 ---- .idea/vcs.xml | 6 --- .idea/workspace.xml | 100 -------------------------------------------- 4 files changed, 123 deletions(-) delete mode 100644 .idea/modules.xml delete mode 100644 .idea/quickfix.iml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index e06ebba25..000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/quickfix.iml b/.idea/quickfix.iml deleted file mode 100644 index 5e764c4f0..000000000 --- a/.idea/quickfix.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f4..000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 0ef542166..000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - { - "keyToString": { - "DefaultGoTemplateProperty": "Go File", - "RunOnceActivity.OpenProjectViewOnStart": "true", - "RunOnceActivity.ShowReadmeOnStart": "true", - "RunOnceActivity.go.format.on.save.advertiser.fired": "true", - "RunOnceActivity.go.formatter.settings.were.checked": "true", - "RunOnceActivity.go.migrated.go.modules.settings": "true", - "RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true", - "RunOnceActivity.go.watchers.conflict.with.on.save.actions.check.performed": "true", - "WebServerToolWindowFactoryState": "false", - "go.import.settings.migrated": "true", - "go.sdk.automatically.set": "true", - "last_opened_file_path": "/Users/xuchaochi/go/src/quickfix", - "nodejs_package_manager_path": "npm" - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - \ No newline at end of file From e3865a9b4ee88518e648eadf2d61b89a3a5f9cb4 Mon Sep 17 00:00:00 2001 From: xuchao Date: Wed, 22 Feb 2023 01:11:53 +0800 Subject: [PATCH 101/139] fix record not found --- .gitignore | 2 + go.mod | 10 +-- go.sum | 198 +++++++++++++++++++++++++++++++++++++-------- gormstore_model.go | 4 +- gormstroe.go | 8 +- gormstroe_test.go | 31 +++++++ 6 files changed, 203 insertions(+), 50 deletions(-) diff --git a/.gitignore b/.gitignore index c6137fd7a..d5b3e32c3 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ _test/echo_server _test/tmp _vendor* gen +*.db +.idea \ No newline at end of file diff --git a/go.mod b/go.mod index 002b30906..f3ad95c95 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,11 @@ module github.com/quickfixgo/quickfix go 1.13 require ( - github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 // indirect github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 + github.com/glebarez/sqlite v1.4.1 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 - github.com/jcmturner/gokrb5/v8 v8.2.0 // indirect github.com/kr/pretty v0.3.0 // indirect - github.com/mattn/go-sqlite3 v1.14.4 + github.com/mattn/go-sqlite3 v1.14.10 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 github.com/smartystreets/goconvey v1.6.4 @@ -16,11 +15,6 @@ require ( golang.org/x/crypto v0.4.0 // indirect golang.org/x/net v0.3.0 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect - gopkg.in/jcmturner/aescts.v1 v1.0.1 // indirect - gopkg.in/jcmturner/dnsutils.v1 v1.0.1 // indirect - gopkg.in/jcmturner/goidentity.v3 v3.0.0 // indirect - gopkg.in/jcmturner/gokrb5.v7 v7.5.0 // indirect - gopkg.in/jcmturner/rpc.v1 v1.1.0 // indirect gorm.io/driver/postgres v1.3.1 gorm.io/gorm v1.23.3 ) diff --git a/go.sum b/go.sum index 51fbbe965..e321e3213 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,9 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 h1:P5U+E4x5OkVEKQDklVPmzs71WM56RTTRqV4OrDC//Y4= -github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 h1:dmVRVC/MmuwC2edm/P6oWIP+9n+p9IgVgK0lq9mBQjU= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= @@ -12,21 +12,24 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/glebarez/go-sqlite v1.15.1 h1:1gRIcUp1EFZ9wn7qBVFte332R6elCC6nJl4+YWu7SNI= +github.com/glebarez/go-sqlite v1.15.1/go.mod h1:rAfxRB8nJkvpDoj3sCegn4Sm/w4xX3o2lx7GiJ5vs0k= +github.com/glebarez/sqlite v1.4.1 h1:IrFURFnrjiPhRW8D8N7YvUssBNzfbrTb4xN6Mk7W7rM= +github.com/glebarez/sqlite v1.4.1/go.mod h1:OI0VEF6vz0qLnOr3ooLCuVdsxwNrPlo9Bscqjg9x2bM= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= -github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= -github.com/gorilla/sessions v1.2.0 h1:S7P+1Hm5V/AT9cjEcUD5uDaQSX0OE577aCXgoaKpYbQ= -github.com/gorilla/sessions v1.2.0/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= @@ -44,6 +47,7 @@ github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= @@ -75,24 +79,13 @@ github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= -github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= -github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= -github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= -github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= -github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= -github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= -github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= -github.com/jcmturner/gokrb5/v8 v8.2.0 h1:lzPl/30ZLkTveYsYZPKMcgXc8MbnE6RsTd4F9KgiLtk= -github.com/jcmturner/gokrb5/v8 v8.2.0/go.mod h1:T1hnNppQsBtxW0tCHMHTkAt8n/sABdzZgZdoFrZaZNM= -github.com/jcmturner/rpc/v2 v2.0.2 h1:gMB4IwRXYsWw4Bc6o/az2HJgFUA1ffSh90i26ZJ6Xl0= -github.com/jcmturner/rpc/v2 v2.0.2/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.4 h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -108,21 +101,24 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.6.0 h1:I5DPxhYJChW9KYc66se+oKFFQX6VuQrKiprsX6ivRZc= -github.com/lib/pq v1.6.0/go.mod h1:4vXEAYvW1fRQ2/FhZ78H73A60MHw1geSm145z2mdY1g= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-sqlite3 v1.14.4 h1:4rQjbDxdu9fSgI/r3KN72G3c2goxknAqHHgPWWs8UlI= -github.com/mattn/go-sqlite3 v1.14.4/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-sqlite3 v1.14.10 h1:MLn+5bFRlWMGoSRmJour3CL1w/qL96mvipqpwQW/Sfk= +github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -152,6 +148,7 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -170,8 +167,6 @@ golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaE golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -182,17 +177,19 @@ golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80 golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -204,10 +201,17 @@ golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -231,11 +235,13 @@ golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -243,20 +249,144 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= -gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= -gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= -gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= -gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v0.2.4 h1:WeYJbJX66Yj5R+hnBgfjpmtoUYGpphSSiakhAorVYfc= -gorm.io/driver/postgres v0.2.4/go.mod h1:nKAMTWR3HotfKKWcK4A/ZrxU55IqzONLyCxeXyHdzfA= gorm.io/driver/postgres v1.3.1 h1:Pyv+gg1Gq1IgsLYytj/S2k7ebII3CzEdpqQkPOdH24g= gorm.io/driver/postgres v1.3.1/go.mod h1:WwvWOuR9unCLpGWCL6Y3JOeBWvbKi6JLhayiVclSZZU= gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.3 h1:jYh3nm7uLZkrMVfA8WVNjDZryKfr7W+HTlInVgKFJAg= gorm.io/gorm v1.23.3/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.33.6/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.33.9/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.33.11/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.34.0/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.0/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.4/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.5/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.7/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.8/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.10/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.15/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.16/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.17/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.18/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.20/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.22/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.24/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/ccgo/v3 v3.9.5/go.mod h1:umuo2EP2oDSBnD3ckjaVUXMrmeAw8C8OSICVa0iFf60= +modernc.org/ccgo/v3 v3.10.0/go.mod h1:c0yBmkRFi7uW4J7fwx/JiijwOjeAeR2NoSaRVFPmjMw= +modernc.org/ccgo/v3 v3.11.0/go.mod h1:dGNposbDp9TOZ/1KBxghxtUp/bzErD0/0QW4hhSaBMI= +modernc.org/ccgo/v3 v3.11.1/go.mod h1:lWHxfsn13L3f7hgGsGlU28D9eUOf6y3ZYHKoPaKU0ag= +modernc.org/ccgo/v3 v3.11.3/go.mod h1:0oHunRBMBiXOKdaglfMlRPBALQqsfrCKXgw9okQ3GEw= +modernc.org/ccgo/v3 v3.12.4/go.mod h1:Bk+m6m2tsooJchP/Yk5ji56cClmN6R1cqc9o/YtbgBQ= +modernc.org/ccgo/v3 v3.12.6/go.mod h1:0Ji3ruvpFPpz+yu+1m0wk68pdr/LENABhTrDkMDWH6c= +modernc.org/ccgo/v3 v3.12.8/go.mod h1:Hq9keM4ZfjCDuDXxaHptpv9N24JhgBZmUG5q60iLgUo= +modernc.org/ccgo/v3 v3.12.11/go.mod h1:0jVcmyDwDKDGWbcrzQ+xwJjbhZruHtouiBEvDfoIsdg= +modernc.org/ccgo/v3 v3.12.14/go.mod h1:GhTu1k0YCpJSuWwtRAEHAol5W7g1/RRfS4/9hc9vF5I= +modernc.org/ccgo/v3 v3.12.18/go.mod h1:jvg/xVdWWmZACSgOiAhpWpwHWylbJaSzayCqNOJKIhs= +modernc.org/ccgo/v3 v3.12.20/go.mod h1:aKEdssiu7gVgSy/jjMastnv/q6wWGRbszbheXgWRHc8= +modernc.org/ccgo/v3 v3.12.21/go.mod h1:ydgg2tEprnyMn159ZO/N4pLBqpL7NOkJ88GT5zNU2dE= +modernc.org/ccgo/v3 v3.12.22/go.mod h1:nyDVFMmMWhMsgQw+5JH6B6o4MnZ+UQNw1pp52XYFPRk= +modernc.org/ccgo/v3 v3.12.25/go.mod h1:UaLyWI26TwyIT4+ZFNjkyTbsPsY3plAEB6E7L/vZV3w= +modernc.org/ccgo/v3 v3.12.29/go.mod h1:FXVjG7YLf9FetsS2OOYcwNhcdOLGt8S9bQ48+OP75cE= +modernc.org/ccgo/v3 v3.12.36/go.mod h1:uP3/Fiezp/Ga8onfvMLpREq+KUjUmYMxXPO8tETHtA8= +modernc.org/ccgo/v3 v3.12.38/go.mod h1:93O0G7baRST1vNj4wnZ49b1kLxt0xCW5Hsa2qRaZPqc= +modernc.org/ccgo/v3 v3.12.43/go.mod h1:k+DqGXd3o7W+inNujK15S5ZYuPoWYLpF5PYougCmthU= +modernc.org/ccgo/v3 v3.12.46/go.mod h1:UZe6EvMSqOxaJ4sznY7b23/k13R8XNlyWsO5bAmSgOE= +modernc.org/ccgo/v3 v3.12.47/go.mod h1:m8d6p0zNps187fhBwzY/ii6gxfjob1VxWb919Nk1HUk= +modernc.org/ccgo/v3 v3.12.50/go.mod h1:bu9YIwtg+HXQxBhsRDE+cJjQRuINuT9PUK4orOco/JI= +modernc.org/ccgo/v3 v3.12.51/go.mod h1:gaIIlx4YpmGO2bLye04/yeblmvWEmE4BBBls4aJXFiE= +modernc.org/ccgo/v3 v3.12.53/go.mod h1:8xWGGTFkdFEWBEsUmi+DBjwu/WLy3SSOrqEmKUjMeEg= +modernc.org/ccgo/v3 v3.12.54/go.mod h1:yANKFTm9llTFVX1FqNKHE0aMcQb1fuPJx6p8AcUx+74= +modernc.org/ccgo/v3 v3.12.55/go.mod h1:rsXiIyJi9psOwiBkplOaHye5L4MOOaCjHg1Fxkj7IeU= +modernc.org/ccgo/v3 v3.12.56/go.mod h1:ljeFks3faDseCkr60JMpeDb2GSO3TKAmrzm7q9YOcMU= +modernc.org/ccgo/v3 v3.12.57/go.mod h1:hNSF4DNVgBl8wYHpMvPqQWDQx8luqxDnNGCMM4NFNMc= +modernc.org/ccgo/v3 v3.12.60/go.mod h1:k/Nn0zdO1xHVWjPYVshDeWKqbRWIfif5dtsIOCUVMqM= +modernc.org/ccgo/v3 v3.12.66/go.mod h1:jUuxlCFZTUZLMV08s7B1ekHX5+LIAurKTTaugUr/EhQ= +modernc.org/ccgo/v3 v3.12.67/go.mod h1:Bll3KwKvGROizP2Xj17GEGOTrlvB1XcVaBrC90ORO84= +modernc.org/ccgo/v3 v3.12.73/go.mod h1:hngkB+nUUqzOf3iqsM48Gf1FZhY599qzVg1iX+BT3cQ= +modernc.org/ccgo/v3 v3.12.81/go.mod h1:p2A1duHoBBg1mFtYvnhAnQyI6vL0uw5PGYLSIgF6rYY= +modernc.org/ccgo/v3 v3.12.84/go.mod h1:ApbflUfa5BKadjHynCficldU1ghjen84tuM5jRynB7w= +modernc.org/ccgo/v3 v3.12.86/go.mod h1:dN7S26DLTgVSni1PVA3KxxHTcykyDurf3OgUzNqTSrU= +modernc.org/ccgo/v3 v3.12.90/go.mod h1:obhSc3CdivCRpYZmrvO88TXlW0NvoSVvdh/ccRjJYko= +modernc.org/ccgo/v3 v3.12.92/go.mod h1:5yDdN7ti9KWPi5bRVWPl8UNhpEAtCjuEE7ayQnzzqHA= +modernc.org/ccgo/v3 v3.13.1/go.mod h1:aBYVOUfIlcSnrsRVU8VRS35y2DIfpgkmVkYZ0tpIXi4= +modernc.org/ccgo/v3 v3.15.9/go.mod h1:md59wBwDT2LznX/OTCPoVS6KIsdRgY8xqQwBV+hkTH0= +modernc.org/ccgo/v3 v3.15.10/go.mod h1:wQKxoFn0ynxMuCLfFD09c8XPUCc8obfchoVR9Cn0fI8= +modernc.org/ccgo/v3 v3.15.12/go.mod h1:VFePOWoCd8uDGRJpq/zfJ29D0EVzMSyID8LCMWYbX6I= +modernc.org/ccgo/v3 v3.15.14/go.mod h1:144Sz2iBCKogb9OKwsu7hQEub3EVgOlyI8wMUPGKUXQ= +modernc.org/ccgo/v3 v3.15.15/go.mod h1:z5qltXjU4PJl0pE5nhYQCvA9DhPHiWsl5GWl89+NSYE= +modernc.org/ccgo/v3 v3.15.16/go.mod h1:XbKRMeMWMdq712Tr5ECgATYMrzJ+g9zAZEj2ktzBe24= +modernc.org/ccgo/v3 v3.15.17/go.mod h1:bofnFkpRFf5gLY+mBZIyTW6FEcp26xi2lgOFk2Rlvs0= +modernc.org/ccorpus v1.11.1/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v1.9.8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= +modernc.org/libc v1.9.11/go.mod h1:NyF3tsA5ArIjJ83XB0JlqhjTabTCHm9aX4XMPHyQn0Q= +modernc.org/libc v1.11.0/go.mod h1:2lOfPmj7cz+g1MrPNmX65QCzVxgNq2C5o0jdLY2gAYg= +modernc.org/libc v1.11.2/go.mod h1:ioIyrl3ETkugDO3SGZ+6EOKvlP3zSOycUETe4XM4n8M= +modernc.org/libc v1.11.5/go.mod h1:k3HDCP95A6U111Q5TmG3nAyUcp3kR5YFZTeDS9v8vSU= +modernc.org/libc v1.11.6/go.mod h1:ddqmzR6p5i4jIGK1d/EiSw97LBcE3dK24QEwCFvgNgE= +modernc.org/libc v1.11.11/go.mod h1:lXEp9QOOk4qAYOtL3BmMve99S5Owz7Qyowzvg6LiZso= +modernc.org/libc v1.11.13/go.mod h1:ZYawJWlXIzXy2Pzghaf7YfM8OKacP3eZQI81PDLFdY8= +modernc.org/libc v1.11.16/go.mod h1:+DJquzYi+DMRUtWI1YNxrlQO6TcA5+dRRiq8HWBWRC8= +modernc.org/libc v1.11.19/go.mod h1:e0dgEame6mkydy19KKaVPBeEnyJB4LGNb0bBH1EtQ3I= +modernc.org/libc v1.11.24/go.mod h1:FOSzE0UwookyT1TtCJrRkvsOrX2k38HoInhw+cSCUGk= +modernc.org/libc v1.11.26/go.mod h1:SFjnYi9OSd2W7f4ct622o/PAYqk7KHv6GS8NZULIjKY= +modernc.org/libc v1.11.27/go.mod h1:zmWm6kcFXt/jpzeCgfvUNswM0qke8qVwxqZrnddlDiE= +modernc.org/libc v1.11.28/go.mod h1:Ii4V0fTFcbq3qrv3CNn+OGHAvzqMBvC7dBNyC4vHZlg= +modernc.org/libc v1.11.31/go.mod h1:FpBncUkEAtopRNJj8aRo29qUiyx5AvAlAxzlx9GNaVM= +modernc.org/libc v1.11.34/go.mod h1:+Tzc4hnb1iaX/SKAutJmfzES6awxfU1BPvrrJO0pYLg= +modernc.org/libc v1.11.37/go.mod h1:dCQebOwoO1046yTrfUE5nX1f3YpGZQKNcITUYWlrAWo= +modernc.org/libc v1.11.39/go.mod h1:mV8lJMo2S5A31uD0k1cMu7vrJbSA3J3waQJxpV4iqx8= +modernc.org/libc v1.11.42/go.mod h1:yzrLDU+sSjLE+D4bIhS7q1L5UwXDOw99PLSX0BlZvSQ= +modernc.org/libc v1.11.44/go.mod h1:KFq33jsma7F5WXiYelU8quMJasCCTnHK0mkri4yPHgA= +modernc.org/libc v1.11.45/go.mod h1:Y192orvfVQQYFzCNsn+Xt0Hxt4DiO4USpLNXBlXg/tM= +modernc.org/libc v1.11.47/go.mod h1:tPkE4PzCTW27E6AIKIR5IwHAQKCAtudEIeAV1/SiyBg= +modernc.org/libc v1.11.49/go.mod h1:9JrJuK5WTtoTWIFQ7QjX2Mb/bagYdZdscI3xrvHbXjE= +modernc.org/libc v1.11.51/go.mod h1:R9I8u9TS+meaWLdbfQhq2kFknTW0O3aw3kEMqDDxMaM= +modernc.org/libc v1.11.53/go.mod h1:5ip5vWYPAoMulkQ5XlSJTy12Sz5U6blOQiYasilVPsU= +modernc.org/libc v1.11.54/go.mod h1:S/FVnskbzVUrjfBqlGFIPA5m7UwB3n9fojHhCNfSsnw= +modernc.org/libc v1.11.55/go.mod h1:j2A5YBRm6HjNkoSs/fzZrSxCuwWqcMYTDPLNx0URn3M= +modernc.org/libc v1.11.56/go.mod h1:pakHkg5JdMLt2OgRadpPOTnyRXm/uzu+Yyg/LSLdi18= +modernc.org/libc v1.11.58/go.mod h1:ns94Rxv0OWyoQrDqMFfWwka2BcaF6/61CqJRK9LP7S8= +modernc.org/libc v1.11.71/go.mod h1:DUOmMYe+IvKi9n6Mycyx3DbjfzSKrdr/0Vgt3j7P5gw= +modernc.org/libc v1.11.75/go.mod h1:dGRVugT6edz361wmD9gk6ax1AbDSe0x5vji0dGJiPT0= +modernc.org/libc v1.11.82/go.mod h1:NF+Ek1BOl2jeC7lw3a7Jj5PWyHPwWD4aq3wVKxqV1fI= +modernc.org/libc v1.11.86/go.mod h1:ePuYgoQLmvxdNT06RpGnaDKJmDNEkV7ZPKI2jnsvZoE= +modernc.org/libc v1.11.87/go.mod h1:Qvd5iXTeLhI5PS0XSyqMY99282y+3euapQFxM7jYnpY= +modernc.org/libc v1.11.88/go.mod h1:h3oIVe8dxmTcchcFuCcJ4nAWaoiwzKCdv82MM0oiIdQ= +modernc.org/libc v1.11.98/go.mod h1:ynK5sbjsU77AP+nn61+k+wxUGRx9rOFcIqWYYMaDZ4c= +modernc.org/libc v1.11.101/go.mod h1:wLLYgEiY2D17NbBOEp+mIJJJBGSiy7fLL4ZrGGZ+8jI= +modernc.org/libc v1.12.0/go.mod h1:2MH3DaF/gCU8i/UBiVE1VFRos4o523M7zipmwH8SIgQ= +modernc.org/libc v1.14.1/go.mod h1:npFeGWjmZTjFeWALQLrvklVmAxv4m80jnG3+xI8FdJk= +modernc.org/libc v1.14.2/go.mod h1:MX1GBLnRLNdvmK9azU9LCxZ5lMyhrbEMK8rG3X/Fe34= +modernc.org/libc v1.14.3/go.mod h1:GPIvQVOVPizzlqyRX3l756/3ppsAgg1QgPxjr5Q4agQ= +modernc.org/libc v1.14.6/go.mod h1:2PJHINagVxO4QW/5OQdRrvMYo+bm5ClpUFfyXCYl9ak= +modernc.org/libc v1.14.7/go.mod h1:f8xfWXW8LW41qb4X5+huVQo5dcfPlq7Cbny2TDheMv0= +modernc.org/libc v1.14.8/go.mod h1:9+JCLb1MWSY23smyOpIPbd5ED+rSS/ieiDWUpdyO3mo= +modernc.org/libc v1.14.10/go.mod h1:y1MtIWhwpJFpLYm6grAThtuXJKEsY6xkdZmXbRngIdo= +modernc.org/libc v1.14.11/go.mod h1:l5/Mz/GrZwOqzwRHA3abgSCnSeJzzTl+Ify0bAwKbAw= +modernc.org/libc v1.14.12 h1:pUBZTYoISfbb4pCf4PECENpbvwDBxeKc+/dS9LyOWFM= +modernc.org/libc v1.14.12/go.mod h1:fJdoe23MHu2ruPQkFPPqCpToDi5cckzsbmkI6Ez0LqQ= +modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.1 h1:ij3fYGe8zBF4Vu+g0oT7mB06r8sqGWKuJu1yXeR4by8= +modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= +modernc.org/memory v1.0.5/go.mod h1:B7OYswTRnfGg+4tDH1t1OeUNnsy2viGTdME4tzd+IjM= +modernc.org/memory v1.0.6/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.0.7 h1:UE3cxTRFa5tfUibAV7Jqq8P7zRY0OlJg+yWVIIaluEE= +modernc.org/memory v1.0.7/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.15.2 h1:Es0SrEJUQHH7rt6uC/Zh2gHQ0AUhgB+F2RQqpXf3MNs= +modernc.org/sqlite v1.15.2/go.mod h1:2P9bWfawhYMpYsBELqKREE+LFZo4uPApOuqszlZ7QX8= +modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/tcl v1.11.2/go.mod h1:BRzgpajcGdS2qTxniOx9c/dcxjlbA7p12eJNmiriQYo= +modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.3.2/go.mod h1:PEU2oK2OEA1CfzDTd+8E908qEXhC9s0MfyKp5LZsd+k= diff --git a/gormstore_model.go b/gormstore_model.go index a244def41..a5b57cac2 100644 --- a/gormstore_model.go +++ b/gormstore_model.go @@ -14,8 +14,8 @@ type GormSessions struct { TargetLocId string `gorm:"column:targetlocid;primaryKey;type:varchar(64)"` SessionQualifier string `gorm:"column:session_qualifier;primaryKey;type:varchar(64)"` CreationTime time.Time `gorm:"column:creation_time"` - IncomingSeqNum int64 `gorm:"column:incoming_seqnum"` - OutgoingSeqNum int64 `gorm:"column:outgoing_seqnum"` + IncomingSeqNum int `gorm:"column:incoming_seqnum"` + OutgoingSeqNum int `gorm:"column:outgoing_seqnum"` } func (g GormSessions) TableName() string { diff --git a/gormstroe.go b/gormstroe.go index d97654524..35d056428 100644 --- a/gormstroe.go +++ b/gormstroe.go @@ -102,17 +102,13 @@ func (store *gromStore) Refresh() error { } func (store *gromStore) populateCache() error { - var dest struct { - CreationTime time.Time `gorm:"column:creation_time"` - IncomingSeqNum int `gorm:"column:incoming_seqnum"` - OutgoingSeqNum int `gorm:"column:outgoing_seqnum"` - } + dest := GormSessions{} s := store.sessionID err := store.db.Table(`sessions`).Where(`beginstring=? AND session_qualifier=? AND sendercompid=? AND sendersubid=? AND senderlocid=? AND targetcompid=? AND targetsubid=? AND targetlocid=?`, s.BeginString, s.Qualifier, s.SenderCompID, s.SenderSubID, s.SenderLocationID, - s.TargetCompID, s.TargetSubID, s.TargetLocationID).Find(&dest).Error + s.TargetCompID, s.TargetSubID, s.TargetLocationID).First(&dest).Error if err == nil { store.cache.creationTime = dest.CreationTime if err = store.cache.SetNextTargetMsgSeqNum(dest.IncomingSeqNum); err != nil { diff --git a/gormstroe_test.go b/gormstroe_test.go index 8075f50fa..0065f9a8f 100644 --- a/gormstroe_test.go +++ b/gormstroe_test.go @@ -3,9 +3,11 @@ package quickfix import ( "testing" + "github.com/glebarez/sqlite" . "github.com/smartystreets/goconvey/convey" "gorm.io/driver/postgres" "gorm.io/gorm" + "gorm.io/gorm/logger" ) func NewGormDB() (*gorm.DB, error) { @@ -16,6 +18,16 @@ func NewGormDB() (*gorm.DB, error) { } return db, err } + +func NewGormSqliteDB() (db *gorm.DB, err error) { + db, err = gorm.Open(sqlite.Open("test.db?_pragma=busy_timeout(500000)"), &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + }) + sqldb, _ := db.DB() + sqldb.SetMaxOpenConns(1) + return +} + func Test_GromStoreCreate(t *testing.T) { Convey(`GromStoreCreate`, t, func() { db, err := NewGormDB() @@ -56,3 +68,22 @@ func Test_GromStoreSaveMessage(t *testing.T) { }) }) } + +func Test_SetNextSenderMsgSeqNum(t *testing.T) { + Convey(`SetNextSenderMsgSeqNum`, t, func() { + db, err := NewGormSqliteDB() + So(err, ShouldBeNil) + So(db, ShouldNotBeNil) + sessionID := SessionID{BeginString: "FIX.4.2", TargetCompID: "IB", SenderCompID: "LB"} + sessionID = SessionID{} + appSettings := NewSettings() + appSettings.sessionSettings = map[SessionID]*SessionSettings{ + sessionID: {}, + } + f := NewGormStoreFactory(appSettings, db) + store, err := f.Create(sessionID) + So(err, ShouldBeNil) + err = store.SetNextSenderMsgSeqNum(10) + So(err, ShouldBeNil) + }) +} From e615c97343e0d85917496ec869e28ad38edfb6e8 Mon Sep 17 00:00:00 2001 From: xuchao Date: Wed, 22 Feb 2023 02:01:45 +0800 Subject: [PATCH 102/139] del messages createtime --- gormstore_model.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/gormstore_model.go b/gormstore_model.go index a5b57cac2..fffcbf5a6 100644 --- a/gormstore_model.go +++ b/gormstore_model.go @@ -23,17 +23,16 @@ func (g GormSessions) TableName() string { } type GormMessages struct { - BeginString string `gorm:"column:beginstring;primaryKey;type:varchar(8)"` - SenderCompId string `gorm:"column:sendercompid;primaryKey;type:varchar(64)"` - SenderSubId string `gorm:"column:sendersubid;primaryKey;type:varchar(64)"` - SenderLocId string `gorm:"column:senderlocid;primaryKey;type:varchar(64)"` - TargetCompId string `gorm:"column:targetcompid;primaryKey;type:varchar(64)"` - TargetSubId string `gorm:"column:targetsubid;primaryKey;type:varchar(64)"` - TargetLocId string `gorm:"column:targetlocid;primaryKey;type:varchar(64)"` - SessionQualifier string `gorm:"column:session_qualifier;primaryKey;type:varchar(64)"` - CreatedAt time.Time `gorm:"column:created_at"` - Message string `gorm:"column:message;type:text"` - MsgSeqNum int64 `gorm:"column:msgseqnum;primaryKey"` + BeginString string `gorm:"column:beginstring;primaryKey;type:varchar(8)"` + SenderCompId string `gorm:"column:sendercompid;primaryKey;type:varchar(64)"` + SenderSubId string `gorm:"column:sendersubid;primaryKey;type:varchar(64)"` + SenderLocId string `gorm:"column:senderlocid;primaryKey;type:varchar(64)"` + TargetCompId string `gorm:"column:targetcompid;primaryKey;type:varchar(64)"` + TargetSubId string `gorm:"column:targetsubid;primaryKey;type:varchar(64)"` + TargetLocId string `gorm:"column:targetlocid;primaryKey;type:varchar(64)"` + SessionQualifier string `gorm:"column:session_qualifier;primaryKey;type:varchar(64)"` + Message string `gorm:"column:message;type:text"` + MsgSeqNum int64 `gorm:"column:msgseqnum;primaryKey"` } func (g GormMessages) TableName() string { From 3034c6b0bc1418b5daf198856c78bb729ecf9217 Mon Sep 17 00:00:00 2001 From: jacky Date: Tue, 28 Feb 2023 19:53:26 +0800 Subject: [PATCH 103/139] [CORE-0000] support db store --- go.mod | 4 +- go.sum | 18 ++++- nuts_store.go | 187 +++++++++++++++++++++++++++++++++++++++++++++ nuts_store_test.go | 81 ++++++++++++++++++++ 4 files changed, 287 insertions(+), 3 deletions(-) create mode 100644 nuts_store.go create mode 100644 nuts_store_test.go diff --git a/go.mod b/go.mod index 314de9f7f..4ae8449e1 100644 --- a/go.mod +++ b/go.mod @@ -7,9 +7,11 @@ require ( github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 github.com/jinzhu/gorm v1.9.16 github.com/mattn/go-sqlite3 v1.14.4 + github.com/nutsdb/nutsdb v0.12.0 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.2.0 github.com/smartystreets/goconvey v1.6.4 - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.7.1 golang.org/x/net v0.0.0-20200707034311-ab3426394381 + golang.org/x/sys v0.5.0 // indirect ) diff --git a/go.sum b/go.sum index 770e6cdce..f712b1556 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,9 @@ github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBK github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 h1:dmVRVC/MmuwC2edm/P6oWIP+9n+p9IgVgK0lq9mBQjU= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU= +github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= +github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM= @@ -29,6 +32,8 @@ github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/mattn/go-sqlite3 v1.14.4 h1:4rQjbDxdu9fSgI/r3KN72G3c2goxknAqHHgPWWs8UlI= github.com/mattn/go-sqlite3 v1.14.4/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= +github.com/nutsdb/nutsdb v0.12.0 h1:6P7EJat2PyVhRu51KMmFu5N851UupfpPBHAqctRm3/4= +github.com/nutsdb/nutsdb v0.12.0/go.mod h1:FSztXVhUSK5YmedmZQ6m37cU/KpVbGaezUEmUBP8DEo= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -41,8 +46,13 @@ github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIK github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/xujiajun/gorouter v1.2.0/go.mod h1:yJrIta+bTNpBM/2UT8hLOaEAFckO+m/qmR3luMIQygM= +github.com/xujiajun/mmap-go v1.0.1 h1:7Se7ss1fLPPRW+ePgqGpCkfGIZzJV6JPq9Wq9iv/WHc= +github.com/xujiajun/mmap-go v1.0.1/go.mod h1:CNN6Sw4SL69Sui00p0zEzcZKbt+5HtEnYUsc6BKKRMg= +github.com/xujiajun/utils v0.0.0-20220904132955-5f7c5b914235 h1:w0si+uee0iAaCJO9q86T6yrhdadgcsoNuh47LrUykzg= +github.com/xujiajun/utils v0.0.0-20220904132955-5f7c5b914235/go.mod h1:MR4+0R6A9NS5IABnIM3384FfOq8QFVnm7WDrBOhIaMU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -55,9 +65,13 @@ golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220405210540-1e041c57c461/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/nuts_store.go b/nuts_store.go new file mode 100644 index 000000000..a04179c72 --- /dev/null +++ b/nuts_store.go @@ -0,0 +1,187 @@ +package quickfix + +import ( + "encoding/binary" + "time" + + "github.com/nutsdb/nutsdb" + "github.com/pkg/errors" +) + +var ( + keyMessages = []byte("messages") + keyOutgoingSeqnum = []byte("outgoing_seqnum") + keyIncomingSeqnum = []byte("incoming_seqnum") +) + +type nutsDbStoreFactory struct { + settings *Settings + db *nutsdb.DB +} + +func NewNutsDbStoreFactory(settings *Settings, db *nutsdb.DB) MessageStoreFactory { + return nutsDbStoreFactory{settings: settings, db: db} +} + +func (f nutsDbStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, err error) { + _, ok := f.settings.SessionSettings()[sessionID] + if !ok { + return nil, errors.Errorf("unknown session: %v", sessionID) + } + store := &nutsDbStore{ + db: f.db, + cache: &memoryStore{}, + } + if err = store.cache.Reset(); err != nil { + err = errors.Wrap(err, "cache reset") + return + } + if err = store.populateCache(); err != nil { + return nil, err + } + return store, nil +} + +type nutsDbStore struct { + cache *memoryStore + + bucket string + db *nutsdb.DB +} + +func (store *nutsDbStore) NextSenderMsgSeqNum() int { + return store.cache.NextSenderMsgSeqNum() +} + +func (store *nutsDbStore) NextTargetMsgSeqNum() int { + return store.cache.NextTargetMsgSeqNum() +} + +func (store *nutsDbStore) IncrNextSenderMsgSeqNum() error { + if err := store.cache.IncrNextSenderMsgSeqNum(); err != nil { + return errors.Wrap(err, "cache incr next") + } + return store.SetNextSenderMsgSeqNum(store.cache.NextSenderMsgSeqNum()) +} + +func (store *nutsDbStore) IncrNextTargetMsgSeqNum() error { + if err := store.cache.IncrNextTargetMsgSeqNum(); err != nil { + return errors.Wrap(err, "cache incr next") + } + return store.SetNextTargetMsgSeqNum(store.cache.NextTargetMsgSeqNum()) +} + +func (store *nutsDbStore) SetNextSenderMsgSeqNum(next int) error { + + err := store.db.Update(func(tx *nutsdb.Tx) error { + nextBuf := make([]byte, 8) + binary.BigEndian.PutUint64(nextBuf, uint64(next)) + return tx.Put(store.bucket, keyOutgoingSeqnum, nextBuf, nutsdb.Persistent) + }) + + if err != nil { + return err + } + return store.cache.SetNextSenderMsgSeqNum(next) +} +func (store *nutsDbStore) SetNextTargetMsgSeqNum(next int) error { + + err := store.db.Update(func(tx *nutsdb.Tx) error { + nextBuf := make([]byte, 8) + binary.BigEndian.PutUint64(nextBuf, uint64(next)) + return tx.Put(store.bucket, keyIncomingSeqnum, nextBuf, nutsdb.Persistent) + }) + if err != nil { + return err + } + return store.cache.SetNextTargetMsgSeqNum(next) +} + +func (store *nutsDbStore) CreationTime() time.Time { + return store.cache.CreationTime() +} + +func (store *nutsDbStore) Reset() error { + return store.db.Update(func(tx *nutsdb.Tx) error { + // err := tx.Delete(store.bucket, keyMessages) + // if err != nil { + // return err + // } + err := tx.DeleteBucket(nutsdb.DataStructureList, store.bucket) + if err = store.cache.Reset(); err != nil { + return err + } + nextBuf := make([]byte, 8) + binary.BigEndian.PutUint64(nextBuf, uint64(store.cache.NextSenderMsgSeqNum())) + err = tx.Put(store.bucket, keyOutgoingSeqnum, nextBuf, nutsdb.Persistent) + if err != nil { + return err + } + binary.BigEndian.PutUint64(nextBuf, uint64(store.cache.NextTargetMsgSeqNum())) + return tx.Put(store.bucket, keyIncomingSeqnum, nextBuf, nutsdb.Persistent) + }) +} + +func (store *nutsDbStore) Refresh() error { + if err := store.cache.Reset(); err != nil { + return err + } + return store.populateCache() + +} +func (store *nutsDbStore) populateCache() error { + return store.db.Update(func(tx *nutsdb.Tx) error { + var incomingSeqNum, outgoingSeqNum int + + if e, err := tx.Get(store.bucket, keyOutgoingSeqnum); err == nil { + outgoingSeqNum = int(binary.BigEndian.Uint64(e.Value)) + if err := store.cache.SetNextSenderMsgSeqNum(outgoingSeqNum); err != nil { + return errors.Wrap(err, "cache set next sender") + } + } else { + nextBuf := make([]byte, 8) + binary.BigEndian.PutUint64(nextBuf, uint64(store.cache.NextSenderMsgSeqNum())) + if err := tx.Put(store.bucket, keyOutgoingSeqnum, nextBuf, nutsdb.Persistent); err != nil { + return err + } + + } + + if e, err := tx.Get(store.bucket, keyIncomingSeqnum); err == nil { + incomingSeqNum = int(binary.BigEndian.Uint64(e.Value)) + if err := store.cache.SetNextTargetMsgSeqNum(incomingSeqNum); err != nil { + return errors.Wrap(err, "cache set next target") + } + } else { + nextBuf := make([]byte, 8) + binary.BigEndian.PutUint64(nextBuf, uint64(store.cache.NextTargetMsgSeqNum())) + if err := tx.Put(store.bucket, keyIncomingSeqnum, nextBuf, nutsdb.Persistent); err != nil { + return err + } + } + + return nil + }) +} + +func (store *nutsDbStore) SaveMessage(seqNum int, msg []byte) error { + return store.db.Update(func(tx *nutsdb.Tx) error { + return tx.RPush(store.bucket, keyMessages, msg) + }) +} + +func (store *nutsDbStore) GetMessages(beginSeqNum, endSeqNum int) ([][]byte, error) { + var msgs [][]byte + store.db.View(func(tx *nutsdb.Tx) error { + msgs, _ = tx.LRange(store.bucket, keyMessages, beginSeqNum, endSeqNum) + return nil + }) + return msgs, nil +} + +func (store *nutsDbStore) Close() error { + if store.db != nil { + return store.db.Close() + } + return nil +} diff --git a/nuts_store_test.go b/nuts_store_test.go new file mode 100644 index 000000000..c6af3be64 --- /dev/null +++ b/nuts_store_test.go @@ -0,0 +1,81 @@ +package quickfix + +import ( + "fmt" + "os" + "path" + "strings" + "testing" + + "github.com/nutsdb/nutsdb" + "github.com/stretchr/testify/require" +) + +func TestSetup(t *testing.T) { + // create settings + sessionID := SessionID{BeginString: "FIX.4.4", SenderCompID: "SENDER", TargetCompID: "TARGET"} + settings, err := ParseSettings(strings.NewReader(fmt.Sprintf(` +[DEFAULT] +TimeStampPrecision=MICROS + +[SESSION] +BeginString=%s +SenderCompID=%s +TargetCompID=%s`, sessionID.BeginString, sessionID.SenderCompID, sessionID.TargetCompID))) + require.Nil(t, err) + + file := path.Join(os.TempDir(), fmt.Sprintf("%d", os.Getpid())) + file = path.Join(file, "/tmp/nutsdb") + + db, err := nutsdb.Open( + nutsdb.DefaultOptions, + nutsdb.WithSyncEnable(false), + nutsdb.WithRWMode(nutsdb.MMap), + nutsdb.WithDir(file), + nutsdb.WithEntryIdxMode(nutsdb.HintKeyValAndRAMIdxMode), + ) + require.Nil(t, err) + + defer os.RemoveAll(file) + + messageStoreFactory := NewNutsDbStoreFactory(settings, db) + store, err := messageStoreFactory.Create(sessionID) + require.Nil(t, err) + require.NotNil(t, store) + + for i := 0; i < 10; i++ { + err = store.SaveMessage(i, []byte(fmt.Sprintf("hello_%v", i))) + require.Nil(t, err) + err = store.IncrNextSenderMsgSeqNum() + require.Nil(t, err) + } + + bs, err := store.GetMessages(0, 1) + require.Nil(t, err) + require.Equal(t, len(bs), 2) + + bs, err = store.GetMessages(1, 10) + require.Nil(t, err) + require.Equal(t, len(bs), 9) + + err = store.Reset() + require.Nil(t, err) + + bs, err = store.GetMessages(0, 1) + require.Nil(t, err) + require.Equal(t, len(bs), 0) + + for i := 0; i < 100; i++ { + err = store.SaveMessage(i, []byte(fmt.Sprintf("hello_%v", i))) + require.Nil(t, err) + err = store.IncrNextSenderMsgSeqNum() + require.Nil(t, err) + } + + bs, err = store.GetMessages(0, 100) + require.Nil(t, err) + require.Equal(t, len(bs), 100) + + err = store.Close() + require.Nil(t, err) +} From 18c592a9db14c0f71f8cb66262465c541a760995 Mon Sep 17 00:00:00 2001 From: jacky Date: Tue, 28 Feb 2023 20:26:23 +0800 Subject: [PATCH 104/139] [CORE-0000] support db store --- nuts_store.go | 12 +++++++++--- nuts_store_test.go | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/nuts_store.go b/nuts_store.go index a04179c72..15985faed 100644 --- a/nuts_store.go +++ b/nuts_store.go @@ -24,13 +24,19 @@ func NewNutsDbStoreFactory(settings *Settings, db *nutsdb.DB) MessageStoreFactor } func (f nutsDbStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, err error) { - _, ok := f.settings.SessionSettings()[sessionID] + sessionSettings, ok := f.settings.SessionSettings()[sessionID] if !ok { return nil, errors.Errorf("unknown session: %v", sessionID) } + bucket, err := sessionSettings.Setting("Bucket") + if err != nil { + return nil, err + } + store := &nutsDbStore{ - db: f.db, - cache: &memoryStore{}, + db: f.db, + cache: &memoryStore{}, + bucket: bucket, } if err = store.cache.Reset(); err != nil { err = errors.Wrap(err, "cache reset") diff --git a/nuts_store_test.go b/nuts_store_test.go index c6af3be64..7cb22b3d7 100644 --- a/nuts_store_test.go +++ b/nuts_store_test.go @@ -19,6 +19,7 @@ func TestSetup(t *testing.T) { TimeStampPrecision=MICROS [SESSION] +Bucket=lb_hk BeginString=%s SenderCompID=%s TargetCompID=%s`, sessionID.BeginString, sessionID.SenderCompID, sessionID.TargetCompID))) From 1199d61bd7801cad91f2adf7611ad7d4269140c8 Mon Sep 17 00:00:00 2001 From: jacky Date: Tue, 28 Feb 2023 20:29:35 +0800 Subject: [PATCH 105/139] [CORE-0000] support db store --- nuts_store.go | 2 +- nuts_store_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nuts_store.go b/nuts_store.go index 15985faed..aecf6e9aa 100644 --- a/nuts_store.go +++ b/nuts_store.go @@ -28,7 +28,7 @@ func (f nutsDbStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, if !ok { return nil, errors.Errorf("unknown session: %v", sessionID) } - bucket, err := sessionSettings.Setting("Bucket") + bucket, err := sessionSettings.Setting("Tenant") if err != nil { return nil, err } diff --git a/nuts_store_test.go b/nuts_store_test.go index 7cb22b3d7..834b07219 100644 --- a/nuts_store_test.go +++ b/nuts_store_test.go @@ -19,7 +19,7 @@ func TestSetup(t *testing.T) { TimeStampPrecision=MICROS [SESSION] -Bucket=lb_hk +Tenant=lb_hk BeginString=%s SenderCompID=%s TargetCompID=%s`, sessionID.BeginString, sessionID.SenderCompID, sessionID.TargetCompID))) From 9286c7078969bf4303adc788d171342355a7996a Mon Sep 17 00:00:00 2001 From: jacky Date: Wed, 1 Mar 2023 14:46:46 +0800 Subject: [PATCH 106/139] [CORE-0000] support nutsdb --- nuts_store.go | 19 +++++-------------- nuts_store_test.go | 23 +++++++++++------------ 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/nuts_store.go b/nuts_store.go index aecf6e9aa..8d568c39d 100644 --- a/nuts_store.go +++ b/nuts_store.go @@ -15,28 +15,19 @@ var ( ) type nutsDbStoreFactory struct { - settings *Settings - db *nutsdb.DB + db *nutsdb.DB } -func NewNutsDbStoreFactory(settings *Settings, db *nutsdb.DB) MessageStoreFactory { - return nutsDbStoreFactory{settings: settings, db: db} +func NewNutsDbStoreFactory(db *nutsdb.DB) MessageStoreFactory { + return nutsDbStoreFactory{db: db} } func (f nutsDbStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, err error) { - sessionSettings, ok := f.settings.SessionSettings()[sessionID] - if !ok { - return nil, errors.Errorf("unknown session: %v", sessionID) - } - bucket, err := sessionSettings.Setting("Tenant") - if err != nil { - return nil, err - } - + sessionPrefix := sessionIDFilenamePrefix(sessionID) store := &nutsDbStore{ db: f.db, cache: &memoryStore{}, - bucket: bucket, + bucket: sessionPrefix, } if err = store.cache.Reset(); err != nil { err = errors.Wrap(err, "cache reset") diff --git a/nuts_store_test.go b/nuts_store_test.go index 834b07219..0a59292fb 100644 --- a/nuts_store_test.go +++ b/nuts_store_test.go @@ -4,7 +4,6 @@ import ( "fmt" "os" "path" - "strings" "testing" "github.com/nutsdb/nutsdb" @@ -14,16 +13,16 @@ import ( func TestSetup(t *testing.T) { // create settings sessionID := SessionID{BeginString: "FIX.4.4", SenderCompID: "SENDER", TargetCompID: "TARGET"} - settings, err := ParseSettings(strings.NewReader(fmt.Sprintf(` -[DEFAULT] -TimeStampPrecision=MICROS - -[SESSION] -Tenant=lb_hk -BeginString=%s -SenderCompID=%s -TargetCompID=%s`, sessionID.BeginString, sessionID.SenderCompID, sessionID.TargetCompID))) - require.Nil(t, err) + // settings, err := ParseSettings(strings.NewReader(fmt.Sprintf(` + // [DEFAULT] + // TimeStampPrecision=MICROS + + // [SESSION] + // Tenant=lb_hk + // BeginString=%s + // SenderCompID=%s + // TargetCompID=%s`, sessionID.BeginString, sessionID.SenderCompID, sessionID.TargetCompID))) + // require.Nil(t, err) file := path.Join(os.TempDir(), fmt.Sprintf("%d", os.Getpid())) file = path.Join(file, "/tmp/nutsdb") @@ -39,7 +38,7 @@ TargetCompID=%s`, sessionID.BeginString, sessionID.SenderCompID, sessionID.Targe defer os.RemoveAll(file) - messageStoreFactory := NewNutsDbStoreFactory(settings, db) + messageStoreFactory := NewNutsDbStoreFactory(db) store, err := messageStoreFactory.Create(sessionID) require.Nil(t, err) require.NotNil(t, store) From 1509ed7a6cee4f07b939c28834ad024649c08a29 Mon Sep 17 00:00:00 2001 From: xuchao Date: Sun, 20 Aug 2023 21:25:27 +0800 Subject: [PATCH 107/139] [m-14237093] support DynamicSessions --- gormstroe.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gormstroe.go b/gormstroe.go index 35d056428..2e6c9a59a 100644 --- a/gormstroe.go +++ b/gormstroe.go @@ -6,6 +6,8 @@ import ( "github.com/pkg/errors" "gorm.io/gorm" + + "github.com/quickfixgo/quickfix/config" ) type gormStoreFactory struct { @@ -24,8 +26,14 @@ type gromStore struct { } func (f gormStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, err error) { + var dynamicSessions bool + if f.settings.GlobalSettings().HasSetting(config.DynamicSessions) { + if dynamicSessions, err = f.settings.globalSettings.BoolSetting(config.DynamicSessions); err != nil { + return + } + } _, ok := f.settings.SessionSettings()[sessionID] - if !ok { + if !ok && !dynamicSessions { return nil, fmt.Errorf("unknown session: %v", sessionID) } From 5facde54fef050415452eda635775b8f8e819dee Mon Sep 17 00:00:00 2001 From: xuchao Date: Wed, 10 Jan 2024 23:44:52 +0800 Subject: [PATCH 108/139] ad session connect event --- _test/echo_server.go | 7 ++++++- application.go | 2 ++ event.go | 12 ++++++++++++ initiator.go | 27 ++++++++++++++++++--------- quickfix_test.go | 7 ++++++- session.go | 22 +++++++++++++++------- 6 files changed, 59 insertions(+), 18 deletions(-) create mode 100644 event.go diff --git a/_test/echo_server.go b/_test/echo_server.go index ddd729789..48d684740 100644 --- a/_test/echo_server.go +++ b/_test/echo_server.go @@ -7,9 +7,10 @@ import ( "os" "os/signal" - "github.com/quickfixgo/quickfix" "github.com/quickfixgo/quickfix/gen/field" "github.com/quickfixgo/quickfix/gen/tag" + + "github.com/quickfixgo/quickfix" ) var router *quickfix.MessageRouter = quickfix.NewMessageRouter() @@ -32,6 +33,10 @@ func (e *EchoApplication) OnLogout(sessionID quickfix.SessionID) { func (e EchoApplication) ToAdmin(msgBuilder *quickfix.Message, sessionID quickfix.SessionID) { } +func (e EchoApplication) OnEvent(sessionID quickfix.SessionID, tp quickfix.EventType, ev interface{}) { + +} + func (e EchoApplication) ToApp(msgBuilder *quickfix.Message, sessionID quickfix.SessionID) (err error) { return } diff --git a/application.go b/application.go index 09b3b49a3..cb39257cd 100644 --- a/application.go +++ b/application.go @@ -12,6 +12,8 @@ type Application interface { //Notification of a session logging off or disconnecting. OnLogout(sessionID SessionID) + OnEvent(sessionID SessionID, tp EventType, ev interface{}) + //Notification of admin message being sent to target. ToAdmin(message *Message, sessionID SessionID) diff --git a/event.go b/event.go new file mode 100644 index 000000000..8efb09f83 --- /dev/null +++ b/event.go @@ -0,0 +1,12 @@ +package quickfix + +type EventType int + +const ( + EventTypeLogon EventType = iota +) + +type EventLogon struct { + Addr string + TS int64 +} diff --git a/initiator.go b/initiator.go index 3b6672395..3c1d91928 100644 --- a/initiator.go +++ b/initiator.go @@ -10,7 +10,7 @@ import ( "golang.org/x/net/proxy" ) -//Initiator initiates connections and processes messages for all sessions. +// Initiator initiates connections and processes messages for all sessions. type Initiator struct { app Application settings *Settings @@ -24,7 +24,7 @@ type Initiator struct { sessionFactory } -//Start Initiator. +// Start Initiator. func (i *Initiator) Start() (err error) { i.stopChan = make(chan interface{}) @@ -50,7 +50,7 @@ func (i *Initiator) Start() (err error) { return } -//Stop Initiator. +// Stop Initiator. func (i *Initiator) Stop() { select { case <-i.stopChan: @@ -62,7 +62,7 @@ func (i *Initiator) Stop() { i.wg.Wait() } -//NewInitiator creates and initializes a new Initiator. +// NewInitiator creates and initializes a new Initiator. func NewInitiator(app Application, storeFactory MessageStoreFactory, appSettings *Settings, logFactory LogFactory) (*Initiator, error) { i := &Initiator{ app: app, @@ -92,7 +92,7 @@ func NewInitiator(app Application, storeFactory MessageStoreFactory, appSettings return i, nil } -//waitForInSessionTime returns true if the session is in session, false if the handler should stop +// waitForInSessionTime returns true if the session is in session, false if the handler should stop func (i *Initiator) waitForInSessionTime(session *session) bool { inSessionTime := make(chan interface{}) go func() { @@ -109,7 +109,7 @@ func (i *Initiator) waitForInSessionTime(session *session) bool { return true } -//waitForReconnectInterval returns true if a reconnect should be re-attempted, false if handler should stop +// waitForReconnectInterval returns true if a reconnect should be re-attempted, false if handler should stop func (i *Initiator) waitForReconnectInterval(reconnectInterval time.Duration) bool { select { case <-time.After(reconnectInterval): @@ -134,6 +134,7 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, di }() connectionAttempt := 0 + useLastLogon := true for { if !i.waitForInSessionTime(session) { @@ -143,9 +144,12 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, di var disconnected chan interface{} var msgIn chan fixIn var msgOut chan []byte - address := session.SocketConnectAddress[connectionAttempt%len(session.SocketConnectAddress)] - session.log.OnEventf("Connecting to: %v", address) + if useLastLogon && session.lastLogonData != nil { + address = session.lastLogonData.Addr + } + session.log.OnEventf("Connecting to: %v, useLastLogon: %v", address, useLastLogon) + session.lastConnectData = &EventLogon{Addr: address, TS: time.Now().Unix()} netConn, err := dialer.Dial("tcp", address) if err != nil { @@ -193,7 +197,12 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, di } reconnect: - connectionAttempt++ + if !useLastLogon { + connectionAttempt++ + } else { + useLastLogon = true + } + session.log.OnEventf("Reconnecting in %v", session.ReconnectInterval) if !i.waitForReconnectInterval(session.ReconnectInterval) { return diff --git a/quickfix_test.go b/quickfix_test.go index 2f511b77d..e24688eeb 100644 --- a/quickfix_test.go +++ b/quickfix_test.go @@ -3,10 +3,11 @@ package quickfix import ( "time" - "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + + "github.com/quickfixgo/quickfix/internal" ) type QuickFIXSuite struct { @@ -72,6 +73,10 @@ type MockApp struct { func (e *MockApp) OnCreate(sessionID SessionID) { } +func (e *MockApp) OnEvent(sessionID SessionID, tp EventType, ev interface{}) { + +} + func (e *MockApp) OnLogon(sessionID SessionID) { e.Called() } diff --git a/session.go b/session.go index 7b086d9b8..713ba25c4 100644 --- a/session.go +++ b/session.go @@ -11,7 +11,7 @@ import ( "github.com/quickfixgo/quickfix/internal" ) -//The Session is the primary FIX abstraction for message communication +// The Session is the primary FIX abstraction for message communication type session struct { store MessageStore @@ -45,14 +45,17 @@ type session struct { messagePool timestampPrecision TimestampPrecision + + lastConnectData *EventLogon + lastLogonData *EventLogon } func (s *session) logError(err error) { s.log.OnEvent(err.Error()) } -//TargetDefaultApplicationVersionID returns the default application version ID for messages received by this version. -//Applicable for For FIX.T.1 sessions. +// TargetDefaultApplicationVersionID returns the default application version ID for messages received by this version. +// Applicable for For FIX.T.1 sessions. func (s *session) TargetDefaultApplicationVersionID() string { return s.targetDefaultApplVerID } @@ -205,7 +208,7 @@ func (s *session) resend(msg *Message) bool { return s.application.ToApp(msg, s.sessionID) == nil } -//queueForSend will validate, persist, and queue the message for send +// queueForSend will validate, persist, and queue the message for send func (s *session) queueForSend(msg *Message) error { s.sendMutex.Lock() defer s.sendMutex.Unlock() @@ -225,7 +228,7 @@ func (s *session) queueForSend(msg *Message) error { return nil } -//send will validate, persist, queue the message. If the session is logged on, send all messages in the queue +// send will validate, persist, queue the message. If the session is logged on, send all messages in the queue func (s *session) send(msg *Message) error { return s.sendInReplyTo(msg, nil) } @@ -248,7 +251,7 @@ func (s *session) sendInReplyTo(msg *Message, inReplyTo *Message) error { return nil } -//dropAndReset will drop the send queue and reset the message store +// dropAndReset will drop the send queue and reset the message store func (s *session) dropAndReset() error { s.sendMutex.Lock() defer s.sendMutex.Unlock() @@ -257,7 +260,7 @@ func (s *session) dropAndReset() error { return s.store.Reset() } -//dropAndSend will validate and persist the message, then drops the send queue and sends the message. +// dropAndSend will validate and persist the message, then drops the send queue and sends the message. func (s *session) dropAndSend(msg *Message) error { return s.dropAndSendInReplyTo(msg, nil) } @@ -451,6 +454,11 @@ func (s *session) handleLogon(msg *Message) error { s.peerTimer.Reset(time.Duration(float64(1.2) * float64(s.HeartBtInt))) s.application.OnLogon(s.sessionID) + if s.lastConnectData != nil { + s.application.OnEvent(s.sessionID, EventTypeLogon, s.lastConnectData) + s.lastLogonData = s.lastConnectData + } + if err := s.checkTargetTooHigh(msg); err != nil { return err } From 05bd9904cf5331a62c4c19bba06d8ef043baf7ee Mon Sep 17 00:00:00 2001 From: xuchao Date: Thu, 11 Jan 2024 22:39:11 +0800 Subject: [PATCH 109/139] fix --- initiator.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/initiator.go b/initiator.go index 3c1d91928..14af240bf 100644 --- a/initiator.go +++ b/initiator.go @@ -199,9 +199,8 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, di reconnect: if !useLastLogon { connectionAttempt++ - } else { - useLastLogon = true } + useLastLogon = !useLastLogon session.log.OnEventf("Reconnecting in %v", session.ReconnectInterval) if !i.waitForReconnectInterval(session.ReconnectInterval) { From ba5ed12ddc653c083020b2375417ae44b647d2ea Mon Sep 17 00:00:00 2001 From: xuchao Date: Thu, 11 Jan 2024 23:35:49 +0800 Subject: [PATCH 110/139] fix --- initiator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/initiator.go b/initiator.go index 14af240bf..f588a6006 100644 --- a/initiator.go +++ b/initiator.go @@ -200,7 +200,9 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, di if !useLastLogon { connectionAttempt++ } - useLastLogon = !useLastLogon + if session.lastLogonData != nil { + useLastLogon = !useLastLogon + } session.log.OnEventf("Reconnecting in %v", session.ReconnectInterval) if !i.waitForReconnectInterval(session.ReconnectInterval) { From d1776459333e32ba116d583e632c97a759edc268 Mon Sep 17 00:00:00 2001 From: xuchao Date: Thu, 11 Jan 2024 23:45:29 +0800 Subject: [PATCH 111/139] fix --- initiator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initiator.go b/initiator.go index f588a6006..9b8272e0e 100644 --- a/initiator.go +++ b/initiator.go @@ -134,7 +134,7 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, di }() connectionAttempt := 0 - useLastLogon := true + useLastLogon := session.lastLogonData != nil for { if !i.waitForInSessionTime(session) { From ed20fdff500fd533574f486a3c23cc701a5802dc Mon Sep 17 00:00:00 2001 From: xuchao Date: Fri, 12 Jan 2024 00:01:46 +0800 Subject: [PATCH 112/139] ad log --- initiator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initiator.go b/initiator.go index 9b8272e0e..3d2a7edd4 100644 --- a/initiator.go +++ b/initiator.go @@ -148,7 +148,7 @@ func (i *Initiator) handleConnection(session *session, tlsConfig *tls.Config, di if useLastLogon && session.lastLogonData != nil { address = session.lastLogonData.Addr } - session.log.OnEventf("Connecting to: %v, useLastLogon: %v", address, useLastLogon) + session.log.OnEventf("Session: %+v Connecting to: %v, useLastLogon: %v", session.sessionID, address, useLastLogon) session.lastConnectData = &EventLogon{Addr: address, TS: time.Now().Unix()} netConn, err := dialer.Dial("tcp", address) From 3aa476c5df4cc35c0b5424ac06c05aad41125d72 Mon Sep 17 00:00:00 2001 From: Adam Krieg Date: Tue, 2 Nov 2021 16:50:10 -0400 Subject: [PATCH 113/139] Add support for QuickfixJ option FileStoreSync which controls whether we wait until the write hits the filesystem for each write --- config/configuration.go | 1 + filestore.go | 39 ++++++++++++++++++++++++++++----------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/config/configuration.go b/config/configuration.go index 451c54892..edc55ed67 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -49,6 +49,7 @@ const ( HeartBtInt string = "HeartBtInt" FileLogPath string = "FileLogPath" FileStorePath string = "FileStorePath" + FileStoreSync string = "FileStoreSync" SQLStoreDriver string = "SQLStoreDriver" SQLStoreDataSourceName string = "SQLStoreDataSourceName" SQLStoreConnMaxLifetime string = "SQLStoreConnMaxLifetime" diff --git a/filestore.go b/filestore.go index 182c26a88..caab9f587 100644 --- a/filestore.go +++ b/filestore.go @@ -36,6 +36,7 @@ type fileStore struct { sessionFile *os.File senderSeqNumsFile *os.File targetSeqNumsFile *os.File + fileSync bool } // NewFileStoreFactory returns a file-based implementation of MessageStoreFactory @@ -53,10 +54,19 @@ func (f fileStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, er if err != nil { return nil, err } - return newFileStore(sessionID, dirname) + var fsync bool + if sessionSettings.HasSetting(config.FileStoreSync) { + fsync, err = sessionSettings.BoolSetting(config.FileStoreSync) + if err != nil { + return nil, err + } + } else { + fsync = true //existing behavior is to fsync writes + } + return newFileStore(sessionID, dirname, fsync) } -func newFileStore(sessionID SessionID, dirname string) (*fileStore, error) { +func newFileStore(sessionID SessionID, dirname string, fileSync bool) (*fileStore, error) { if err := os.MkdirAll(dirname, os.ModePerm); err != nil { return nil, err } @@ -72,6 +82,7 @@ func newFileStore(sessionID SessionID, dirname string) (*fileStore, error) { sessionFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "session")), senderSeqNumsFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "senderseqnums")), targetSeqNumsFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "targetseqnums")), + fileSync: fileSync, } if err := store.Refresh(); err != nil { @@ -208,8 +219,10 @@ func (store *fileStore) setSession() error { if _, err := store.sessionFile.Write(data); err != nil { return fmt.Errorf("unable to write to file: %s: %s", store.sessionFname, err.Error()) } - if err := store.sessionFile.Sync(); err != nil { - return fmt.Errorf("unable to flush file: %s: %s", store.sessionFname, err.Error()) + if store.fileSync { + if err := store.sessionFile.Sync(); err != nil { + return fmt.Errorf("unable to flush file: %s: %s", store.sessionFname, err.Error()) + } } return nil } @@ -221,8 +234,10 @@ func (store *fileStore) setSeqNum(f *os.File, seqNum int) error { if _, err := fmt.Fprintf(f, "%019d", seqNum); err != nil { return fmt.Errorf("unable to write to file: %s: %s", f.Name(), err.Error()) } - if err := f.Sync(); err != nil { - return fmt.Errorf("unable to flush file: %s: %s", f.Name(), err.Error()) + if store.fileSync { + if err := f.Sync(); err != nil { + return fmt.Errorf("unable to flush file: %s: %s", f.Name(), err.Error()) + } } return nil } @@ -291,11 +306,13 @@ func (store *fileStore) SaveMessage(seqNum int, msg []byte) error { if _, err := store.bodyFile.Write(msg); err != nil { return fmt.Errorf("unable to write to file: %s: %s", store.bodyFname, err.Error()) } - if err := store.bodyFile.Sync(); err != nil { - return fmt.Errorf("unable to flush file: %s: %s", store.bodyFname, err.Error()) - } - if err := store.headerFile.Sync(); err != nil { - return fmt.Errorf("unable to flush file: %s: %s", store.headerFname, err.Error()) + if store.fileSync { + if err := store.bodyFile.Sync(); err != nil { + return fmt.Errorf("unable to flush file: %s: %s", store.bodyFname, err.Error()) + } + if err := store.headerFile.Sync(); err != nil { + return fmt.Errorf("unable to flush file: %s: %s", store.headerFname, err.Error()) + } } return nil } From 9df5240c52a94bd902dbbedcc0821f8a8b39543b Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Thu, 29 Aug 2024 11:32:59 +0800 Subject: [PATCH 114/139] refactor: rename sessionIDFilenamePrefix to SessionIDFilenamePrefix Renamed the function `sessionIDFilenamePrefix` to `SessionIDFilenamePrefix` for consistency with Go naming conventions. Updated all references and tests accordingly. Also adjusted some comments for better formatting. No changes in functionality. --- file_log.go | 6 +++--- filestore.go | 4 ++-- fileutil.go | 2 +- fileutil_test.go | 4 ++-- nuts_store.go | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/file_log.go b/file_log.go index 02f27b001..202bf4012 100644 --- a/file_log.go +++ b/file_log.go @@ -35,8 +35,8 @@ type fileLogFactory struct { sessionLogPaths map[SessionID]string } -//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. +// 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 NewFileLogFactory(settings *Settings) (LogFactory, error) { logFactory := fileLogFactory{} @@ -97,6 +97,6 @@ func (f fileLogFactory) CreateSessionLog(sessionID SessionID) (Log, error) { return nil, fmt.Errorf("logger not defined for %v", sessionID) } - prefix := sessionIDFilenamePrefix(sessionID) + prefix := SessionIDFilenamePrefix(sessionID) return newFileLog(prefix, logPath) } diff --git a/filestore.go b/filestore.go index caab9f587..1f937e7c6 100644 --- a/filestore.go +++ b/filestore.go @@ -9,8 +9,8 @@ import ( "strconv" "time" - "github.com/quickfixgo/quickfix/config" "github.com/pkg/errors" + "github.com/quickfixgo/quickfix/config" ) type msgDef struct { @@ -71,7 +71,7 @@ func newFileStore(sessionID SessionID, dirname string, fileSync bool) (*fileStor return nil, err } - sessionPrefix := sessionIDFilenamePrefix(sessionID) + sessionPrefix := SessionIDFilenamePrefix(sessionID) store := &fileStore{ sessionID: sessionID, diff --git a/fileutil.go b/fileutil.go index 5334f271c..d470278e5 100644 --- a/fileutil.go +++ b/fileutil.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" ) -func sessionIDFilenamePrefix(s SessionID) string { +func SessionIDFilenamePrefix(s SessionID) string { sender := []string{s.SenderCompID} if s.SenderSubID != "" { sender = append(sender, s.SenderSubID) diff --git a/fileutil_test.go b/fileutil_test.go index f634651df..a85ace6f7 100644 --- a/fileutil_test.go +++ b/fileutil_test.go @@ -25,7 +25,7 @@ func TestSessionIDFilename_MinimallyQualifiedSessionID(t *testing.T) { sessionID := SessionID{BeginString: "FIX.4.4", SenderCompID: "SENDER", TargetCompID: "TARGET"} // Then the filename should be - require.Equal(t, "FIX.4.4-SENDER-TARGET", sessionIDFilenamePrefix(sessionID)) + require.Equal(t, "FIX.4.4-SENDER-TARGET", SessionIDFilenamePrefix(sessionID)) } func TestSessionIDFilename_FullyQualifiedSessionID(t *testing.T) { @@ -42,7 +42,7 @@ func TestSessionIDFilename_FullyQualifiedSessionID(t *testing.T) { } // Then the filename should be - require.Equal(t, "FIX.4.4-A_B_C-D_E_F-G", sessionIDFilenamePrefix(sessionID)) + require.Equal(t, "FIX.4.4-A_B_C-D_E_F-G", SessionIDFilenamePrefix(sessionID)) } func TestOpenOrCreateFile(t *testing.T) { diff --git a/nuts_store.go b/nuts_store.go index 8d568c39d..597eaa0cf 100644 --- a/nuts_store.go +++ b/nuts_store.go @@ -23,7 +23,7 @@ func NewNutsDbStoreFactory(db *nutsdb.DB) MessageStoreFactory { } func (f nutsDbStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, err error) { - sessionPrefix := sessionIDFilenamePrefix(sessionID) + sessionPrefix := SessionIDFilenamePrefix(sessionID) store := &nutsDbStore{ db: f.db, cache: &memoryStore{}, From 6fc48b598f00e5af564cc9c04b99d77dda87e770 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Mon, 2 Sep 2024 16:42:14 +0800 Subject: [PATCH 115/139] refactor(filestore): replace deprecated ioutil with os and io packages Replaced the deprecated ioutil.ReadFile and os.SEEK_END with os.ReadFile and io.SeekEnd respectively. This update ensures code compliance with current Go standards and improves future maintainability by using non-deprecated functions. --- filestore.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/filestore.go b/filestore.go index 182c26a88..b22f6bc5e 100644 --- a/filestore.go +++ b/filestore.go @@ -3,14 +3,13 @@ package quickfix import ( "fmt" "io" - "io/ioutil" "os" "path" "strconv" "time" - "github.com/quickfixgo/quickfix/config" "github.com/pkg/errors" + "github.com/quickfixgo/quickfix/config" ) type msgDef struct { @@ -169,7 +168,7 @@ func (store *fileStore) populateCache() (creationTimePopulated bool, err error) } } - if timeBytes, err := ioutil.ReadFile(store.sessionFname); err == nil { + if timeBytes, err := os.ReadFile(store.sessionFname); err == nil { var ctime time.Time if err := ctime.UnmarshalText(timeBytes); err == nil { store.cache.creationTime = ctime @@ -177,7 +176,7 @@ func (store *fileStore) populateCache() (creationTimePopulated bool, err error) } } - if senderSeqNumBytes, err := ioutil.ReadFile(store.senderSeqNumsFname); err == nil { + if senderSeqNumBytes, err := os.ReadFile(store.senderSeqNumsFname); err == nil { if senderSeqNum, err := strconv.Atoi(string(senderSeqNumBytes)); err == nil { if err = store.cache.SetNextSenderMsgSeqNum(senderSeqNum); err != nil { return creationTimePopulated, errors.Wrap(err, "cache set next sender") @@ -185,7 +184,7 @@ func (store *fileStore) populateCache() (creationTimePopulated bool, err error) } } - if targetSeqNumBytes, err := ioutil.ReadFile(store.targetSeqNumsFname); err == nil { + if targetSeqNumBytes, err := os.ReadFile(store.targetSeqNumsFname); err == nil { if targetSeqNum, err := strconv.Atoi(string(targetSeqNumBytes)); err == nil { if err = store.cache.SetNextTargetMsgSeqNum(targetSeqNum); err != nil { return creationTimePopulated, errors.Wrap(err, "cache set next target") @@ -275,11 +274,11 @@ func (store *fileStore) CreationTime() time.Time { } func (store *fileStore) SaveMessage(seqNum int, msg []byte) error { - offset, err := store.bodyFile.Seek(0, os.SEEK_END) + offset, err := store.bodyFile.Seek(0, io.SeekEnd) if err != nil { return fmt.Errorf("unable to seek to end of file: %s: %s", store.bodyFname, err.Error()) } - if _, err := store.headerFile.Seek(0, os.SEEK_END); err != nil { + if _, err := store.headerFile.Seek(0, io.SeekEnd); err != nil { return fmt.Errorf("unable to seek to end of file: %s: %s", store.headerFname, err.Error()) } if _, err := fmt.Fprintf(store.headerFile, "%d,%d,%d\n", seqNum, offset, len(msg)); err != nil { From d43b98bef7efd0825dc3c67f4c5d794ccf623c4b Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Mon, 2 Sep 2024 17:48:49 +0800 Subject: [PATCH 116/139] feat(filestore): add backup MessageStore support Introduced a new fileStoreOption to enable optional backup MessageStore functionality in the file store. Implemented `storeBackup` for asynchronous message persistence operations, including sequence number management and message saving. Updated relevant methods to use the backup store when available. This enhances fault tolerance by providing a secondary storage mechanism. --- filestore.go | 96 ++++++++++++++++++++++++++++++++++++++---- store_backup.go | 109 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 196 insertions(+), 9 deletions(-) create mode 100644 store_backup.go diff --git a/filestore.go b/filestore.go index b22f6bc5e..ae9ea5d82 100644 --- a/filestore.go +++ b/filestore.go @@ -12,6 +12,14 @@ import ( "github.com/quickfixgo/quickfix/config" ) +type fileStoreOption func(*fileStoreFactory) + +func WithBackupStore(backup MessageStore) fileStoreOption { + return func(fsf *fileStoreFactory) { + fsf.backup = backup + } +} + type msgDef struct { offset int64 size int @@ -19,6 +27,7 @@ type msgDef struct { type fileStoreFactory struct { settings *Settings + backup MessageStore } type fileStore struct { @@ -35,11 +44,20 @@ type fileStore struct { sessionFile *os.File senderSeqNumsFile *os.File targetSeqNumsFile *os.File + backup *storeBackup } // NewFileStoreFactory returns a file-based implementation of MessageStoreFactory -func NewFileStoreFactory(settings *Settings) MessageStoreFactory { - return fileStoreFactory{settings: settings} +func NewFileStoreFactory(settings *Settings, opt ...fileStoreOption) MessageStoreFactory { + sfs := &fileStoreFactory{ + settings: settings, + } + + for _, f := range opt { + f(sfs) + } + + return sfs } // Create creates a new FileStore implementation of the MessageStore interface @@ -52,10 +70,10 @@ func (f fileStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, er if err != nil { return nil, err } - return newFileStore(sessionID, dirname) + return newFileStore(sessionID, dirname, f.backup) } -func newFileStore(sessionID SessionID, dirname string) (*fileStore, error) { +func newFileStore(sessionID SessionID, dirname string, backup MessageStore) (*fileStore, error) { if err := os.MkdirAll(dirname, os.ModePerm); err != nil { return nil, err } @@ -71,8 +89,11 @@ func newFileStore(sessionID SessionID, dirname string) (*fileStore, error) { sessionFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "session")), senderSeqNumsFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "senderseqnums")), targetSeqNumsFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "targetseqnums")), + backup: newStoreBackup(backup), } + store.backup.start() + if err := store.Refresh(); err != nil { return nil, err } @@ -104,7 +125,14 @@ func (store *fileStore) Reset() error { if err := removeFile(store.targetSeqNumsFname); err != nil { return err } - return store.Refresh() + if store.backup != nil { + store.backup.Reset() + } + if err := store.Refresh(); err != nil { + return err + } + + return nil } // Refresh closes the store files and then reloads from them @@ -152,6 +180,11 @@ func (store *fileStore) Refresh() (err error) { if err := store.SetNextTargetMsgSeqNum(store.NextTargetMsgSeqNum()); err != nil { return errors.Wrap(err, "set next target") } + + if store.backup != nil { + store.backup.Refresh() + } + return nil } @@ -241,7 +274,15 @@ func (store *fileStore) SetNextSenderMsgSeqNum(next int) error { if err := store.cache.SetNextSenderMsgSeqNum(next); err != nil { return errors.Wrap(err, "cache") } - return store.setSeqNum(store.senderSeqNumsFile, next) + if err := store.setSeqNum(store.senderSeqNumsFile, next); err != nil { + return err + } + + if store.backup != nil { + store.backup.SetNextSenderMsgSeqNum(next) + } + + return nil } // SetNextTargetMsgSeqNum sets the next MsgSeqNum that should be received @@ -249,7 +290,15 @@ func (store *fileStore) SetNextTargetMsgSeqNum(next int) error { if err := store.cache.SetNextTargetMsgSeqNum(next); err != nil { return errors.Wrap(err, "cache") } - return store.setSeqNum(store.targetSeqNumsFile, next) + if err := store.setSeqNum(store.targetSeqNumsFile, next); err != nil { + return err + } + + if store.backup != nil { + store.backup.SetNextTargetMsgSeqNum(next) + } + + return nil } // IncrNextSenderMsgSeqNum increments the next MsgSeqNum that will be sent @@ -257,7 +306,17 @@ func (store *fileStore) IncrNextSenderMsgSeqNum() error { if err := store.cache.IncrNextSenderMsgSeqNum(); err != nil { return errors.Wrap(err, "cache") } - return store.setSeqNum(store.senderSeqNumsFile, store.cache.NextSenderMsgSeqNum()) + + seqNum := store.cache.NextSenderMsgSeqNum() + if err := store.setSeqNum(store.senderSeqNumsFile, seqNum); err != nil { + return err + } + + if store.backup != nil { + store.backup.SetNextSenderMsgSeqNum(seqNum) + } + + return nil } // IncrNextTargetMsgSeqNum increments the next MsgSeqNum that should be received @@ -265,7 +324,17 @@ func (store *fileStore) IncrNextTargetMsgSeqNum() error { if err := store.cache.IncrNextTargetMsgSeqNum(); err != nil { return errors.Wrap(err, "cache") } - return store.setSeqNum(store.targetSeqNumsFile, store.cache.NextTargetMsgSeqNum()) + + seqNum := store.cache.NextTargetMsgSeqNum() + if err := store.setSeqNum(store.targetSeqNumsFile, seqNum); err != nil { + return err + } + + if store.backup != nil { + store.backup.SetNextTargetMsgSeqNum(seqNum) + } + + return nil } // CreationTime returns the creation time of the store @@ -296,6 +365,11 @@ func (store *fileStore) SaveMessage(seqNum int, msg []byte) error { if err := store.headerFile.Sync(); err != nil { return fmt.Errorf("unable to flush file: %s: %s", store.headerFname, err.Error()) } + + if store.backup != nil { + store.backup.SaveMessage(seqNum, msg) + } + return nil } @@ -351,5 +425,9 @@ func (store *fileStore) Close() error { store.senderSeqNumsFile = nil store.targetSeqNumsFile = nil + if store.backup != nil { + store.backup.Close() + } + return nil } diff --git a/store_backup.go b/store_backup.go new file mode 100644 index 000000000..c9f92140d --- /dev/null +++ b/store_backup.go @@ -0,0 +1,109 @@ +package quickfix + +import ( + "time" +) + +const ( + operationSetNextSenderMsgSeqNum int = iota + 1 + operationSetNextTargetMsgSeqNum + operationSaveMessage + operationReset + operationRefresh +) + +type persisteMessage struct { + operation int + seqNum int + msg []byte +} + +type storeBackup struct { + stop chan struct{} + messages chan *persisteMessage + store MessageStore +} + +func newStoreBackup(store MessageStore) *storeBackup { + return &storeBackup{stop: make(chan struct{}), messages: make(chan *persisteMessage, 500), store: store} +} + +func (s *storeBackup) start() { + go func() { + for message := range s.messages { + switch message.operation { + case operationSetNextSenderMsgSeqNum: + if err := s.store.SetNextSenderMsgSeqNum(message.seqNum); err != nil { + } + case operationSetNextTargetMsgSeqNum: + if err := s.store.SetNextTargetMsgSeqNum(message.seqNum); err != nil { + } + case operationSaveMessage: + if err := s.store.SaveMessage(message.seqNum, message.msg); err != nil { + } + case operationReset: + if err := s.store.Reset(); err != nil { + } + case operationRefresh: + if err := s.store.Refresh(); err != nil { + } + default: + // log + } + } + + close(s.stop) + }() +} + +func (s *storeBackup) SetNextSenderMsgSeqNum(next int) { + select { + case s.messages <- &persisteMessage{operation: operationSetNextSenderMsgSeqNum, seqNum: next}: + default: + // log + } +} + +func (s *storeBackup) SetNextTargetMsgSeqNum(next int) { + select { + case s.messages <- &persisteMessage{operation: operationSetNextTargetMsgSeqNum, seqNum: next}: + default: + // log + } +} + +func (s *storeBackup) SaveMessage(seqNum int, msg []byte) { + select { + case s.messages <- &persisteMessage{operation: operationSaveMessage, seqNum: seqNum, msg: msg}: + default: + // log + } +} + +func (s *storeBackup) Reset() { + select { + case s.messages <- &persisteMessage{operation: operationReset}: + default: + // log + } +} + +func (s *storeBackup) Refresh() { + select { + case s.messages <- &persisteMessage{operation: operationRefresh}: + default: + // log + } +} + +func (s *storeBackup) Close() { + close(s.messages) + + ticker := time.NewTicker(time.Second * 20) + + select { + case <-s.stop: + case <-ticker.C: + // log + } +} From 901711a4c9b21b1e23fd6fbc84ccfb1a8a9c15e0 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Tue, 3 Sep 2024 14:19:21 +0800 Subject: [PATCH 117/139] refactor(filestore): update backup store to use factory pattern Replaced direct usage of MessageStore with MessageStoreFactory to create backup stores dynamically. This change ensures that each session has its own instance of the backup store, facilitating better resource management and isolation. - Changed WithBackupStore to accept MessageStoreFactory instead of MessageStore. - Adjusted fileStoreFactory and newFileStore parameters and implementation accordingly. --- filestore.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/filestore.go b/filestore.go index ae9ea5d82..055f53282 100644 --- a/filestore.go +++ b/filestore.go @@ -14,7 +14,7 @@ import ( type fileStoreOption func(*fileStoreFactory) -func WithBackupStore(backup MessageStore) fileStoreOption { +func WithBackupStore(backup MessageStoreFactory) fileStoreOption { return func(fsf *fileStoreFactory) { fsf.backup = backup } @@ -27,7 +27,7 @@ type msgDef struct { type fileStoreFactory struct { settings *Settings - backup MessageStore + backup MessageStoreFactory } type fileStore struct { @@ -70,10 +70,16 @@ func (f fileStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, er if err != nil { return nil, err } - return newFileStore(sessionID, dirname, f.backup) + + backupStore, err := f.backup.Create(sessionID) + if err != nil { + // log + } + + return newFileStore(sessionID, dirname, backupStore) } -func newFileStore(sessionID SessionID, dirname string, backup MessageStore) (*fileStore, error) { +func newFileStore(sessionID SessionID, dirname string, backupStore MessageStore) (*fileStore, error) { if err := os.MkdirAll(dirname, os.ModePerm); err != nil { return nil, err } @@ -89,7 +95,7 @@ func newFileStore(sessionID SessionID, dirname string, backup MessageStore) (*fi sessionFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "session")), senderSeqNumsFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "senderseqnums")), targetSeqNumsFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "targetseqnums")), - backup: newStoreBackup(backup), + backup: newStoreBackup(backupStore), } store.backup.start() From bb6dab81cf08260a0c4ea1040f13e928f6b2df3e Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Wed, 4 Sep 2024 11:06:20 +0800 Subject: [PATCH 118/139] refactor(store): rename `storeBackup` to `backupStore` and add logging Renamed the `storeBackup` struct and related methods to `backupStore` for better clarity and consistency. Added logging statements to handle dropped operations gracefully when encountering high traffic. Updated go.mod to include the logging library. --- store_backup.go => backup_store.go | 36 +- filestore.go | 7 +- go.mod | 1 + go.sum | 716 +++++++++++++++++++++++++++++ 4 files changed, 740 insertions(+), 20 deletions(-) rename store_backup.go => backup_store.go (61%) diff --git a/store_backup.go b/backup_store.go similarity index 61% rename from store_backup.go rename to backup_store.go index c9f92140d..da3824a44 100644 --- a/store_backup.go +++ b/backup_store.go @@ -2,6 +2,8 @@ package quickfix import ( "time" + + "git.5th.im/lb-public/gear/log" ) const ( @@ -18,17 +20,17 @@ type persisteMessage struct { msg []byte } -type storeBackup struct { +type backupStore struct { stop chan struct{} messages chan *persisteMessage store MessageStore } -func newStoreBackup(store MessageStore) *storeBackup { - return &storeBackup{stop: make(chan struct{}), messages: make(chan *persisteMessage, 500), store: store} +func newBackupStore(store MessageStore) *backupStore { + return &backupStore{stop: make(chan struct{}), messages: make(chan *persisteMessage, 500), store: store} } -func (s *storeBackup) start() { +func (s *backupStore) start() { go func() { for message := range s.messages { switch message.operation { @@ -48,7 +50,7 @@ func (s *storeBackup) start() { if err := s.store.Refresh(); err != nil { } default: - // log + log.Errorf("backup store: unsupported operation(%v)\n", message.operation) } } @@ -56,50 +58,50 @@ func (s *storeBackup) start() { }() } -func (s *storeBackup) SetNextSenderMsgSeqNum(next int) { +func (s *backupStore) SetNextSenderMsgSeqNum(next int) { select { case s.messages <- &persisteMessage{operation: operationSetNextSenderMsgSeqNum, seqNum: next}: default: - // log + log.Warn("encountering a large amount of traffic, drop the SetNextSenderMsgSeqNum operation") } } -func (s *storeBackup) SetNextTargetMsgSeqNum(next int) { +func (s *backupStore) SetNextTargetMsgSeqNum(next int) { select { case s.messages <- &persisteMessage{operation: operationSetNextTargetMsgSeqNum, seqNum: next}: default: - // log + log.Warn("encountering a large amount of traffic, drop the SetNextTargetMsgSeqNum operation") } } -func (s *storeBackup) SaveMessage(seqNum int, msg []byte) { +func (s *backupStore) SaveMessage(seqNum int, msg []byte) { select { case s.messages <- &persisteMessage{operation: operationSaveMessage, seqNum: seqNum, msg: msg}: default: - // log + log.Warn("encountering a large amount of traffic, drop the SaveMessage operation") } } -func (s *storeBackup) Reset() { +func (s *backupStore) Reset() { select { case s.messages <- &persisteMessage{operation: operationReset}: default: - // log + log.Warn("encountering a large amount of traffic, drop the Reset operation") } } -func (s *storeBackup) Refresh() { +func (s *backupStore) Refresh() { select { case s.messages <- &persisteMessage{operation: operationRefresh}: default: - // log + log.Warn("encountering a large amount of traffic, drop the Refresh operation") } } -func (s *storeBackup) Close() { +func (s *backupStore) Close() { close(s.messages) - ticker := time.NewTicker(time.Second * 20) + ticker := time.NewTicker(time.Second * 10) select { case <-s.stop: diff --git a/filestore.go b/filestore.go index 055f53282..e5dbff729 100644 --- a/filestore.go +++ b/filestore.go @@ -8,6 +8,7 @@ import ( "strconv" "time" + "git.5th.im/lb-public/gear/log" "github.com/pkg/errors" "github.com/quickfixgo/quickfix/config" ) @@ -44,7 +45,7 @@ type fileStore struct { sessionFile *os.File senderSeqNumsFile *os.File targetSeqNumsFile *os.File - backup *storeBackup + backup *backupStore } // NewFileStoreFactory returns a file-based implementation of MessageStoreFactory @@ -73,7 +74,7 @@ func (f fileStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, er backupStore, err := f.backup.Create(sessionID) if err != nil { - // log + log.Errorf("file store: failed to init backup store, err: %v", err) } return newFileStore(sessionID, dirname, backupStore) @@ -95,7 +96,7 @@ func newFileStore(sessionID SessionID, dirname string, backupStore MessageStore) sessionFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "session")), senderSeqNumsFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "senderseqnums")), targetSeqNumsFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "targetseqnums")), - backup: newStoreBackup(backupStore), + backup: newBackupStore(backupStore), } store.backup.start() diff --git a/go.mod b/go.mod index b8aa1a82f..b5b2d6938 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/quickfixgo/quickfix go 1.13 require ( + git.5th.im/lb-public/gear/log v1.8.0 // indirect github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/glebarez/sqlite v1.4.1 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 diff --git a/go.sum b/go.sum index d0382e947..eeb9ae3a4 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,109 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.40.0/go.mod h1:Tk58MuI9rbLMKlAjeO/bDnteAx7tX2gJIXw4T5Jwlro= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +git.5th.im/lb-public/gear/cache v0.1.1/go.mod h1:Y95lQ5W6xMjNvWQaDczxC1OSc9m/EVz4k1Tf3wV5AKQ= +git.5th.im/lb-public/gear/log v1.0.0/go.mod h1:HLY/7Ga9/IPX+ZwOBVLF4GT+W/nHh7fJWGHLfv+ILl0= +git.5th.im/lb-public/gear/log v1.1.0/go.mod h1:HLY/7Ga9/IPX+ZwOBVLF4GT+W/nHh7fJWGHLfv+ILl0= +git.5th.im/lb-public/gear/log v1.3.2/go.mod h1:YITGdkVfSr7ubiyzBM61AEf1m6wNxNyyJoxzVQTstYM= +git.5th.im/lb-public/gear/log v1.8.0 h1:reWCCrZ5gSBxyAA9j3sDqgrmIq9O7kwDflqMXVNG9XY= +git.5th.im/lb-public/gear/log v1.8.0/go.mod h1:cYw6jEc1d4A01j++04I7kAYDlBtZY7dLUHIGbIhtUwQ= +git.5th.im/lb-public/gear/runtime v0.1.0/go.mod h1:hHxmu9Gg6VCVsAEO9T7Xe5RPay2DIlJyi/13aaII9iM= +git.5th.im/lb-public/gear/runtime v0.2.2 h1:W+jHNLuToOpGJ4v3U8eLd3WdQdUEcIXng9iheF7tXtE= +git.5th.im/lb-public/gear/runtime v0.2.2/go.mod h1:arJaeqGf/BVYfkFYQQNKFaxpkpQI2dJzhkT250mbY7A= +git.5th.im/lb-public/gear/util v0.4.13 h1:5fzlVVHf+SE25JTOSifIffHLr33UpTSltB2Mwu41aNo= +git.5th.im/lb-public/gear/util v0.4.13/go.mod h1:Laon3egMeqRjPGE7kkoIKq7ykhqc0jrQ4ZuKQ73NzrQ= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 h1:dmVRVC/MmuwC2edm/P6oWIP+9n+p9IgVgK0lq9mBQjU= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= +github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/bwmarrin/discordgo v0.19.0/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/containerd/continuity v0.0.0-20181203112020-004b46473808/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -15,24 +111,164 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/docker/docker v0.7.3-0.20190309235953-33c3200e0d16/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/forestgiant/sliceutil v0.0.0-20160425183142-94783f95db6c/go.mod h1:pFdJbAhRf7rh6YYMUdIQGyzne6zYL1tCUW8QV2B3UfY= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsouza/go-dockerclient v1.4.1/go.mod h1:PUNHxbowDqRXfRgZqMz1OeGtbWC6VKyZvJ99hDjB0qs= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/glebarez/go-sqlite v1.15.1 h1:1gRIcUp1EFZ9wn7qBVFte332R6elCC6nJl4+YWu7SNI= github.com/glebarez/go-sqlite v1.15.1/go.mod h1:rAfxRB8nJkvpDoj3sCegn4Sm/w4xX3o2lx7GiJ5vs0k= github.com/glebarez/sqlite v1.4.1 h1:IrFURFnrjiPhRW8D8N7YvUssBNzfbrTb4xN6Mk7W7rM= github.com/glebarez/sqlite v1.4.1/go.mod h1:OI0VEF6vz0qLnOr3ooLCuVdsxwNrPlo9Bscqjg9x2bM= +github.com/gliderlabs/ssh v0.1.3/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-log/log v0.1.0/go.mod h1:4mBwpdRMFLiuXZDCwU2lKQFsoSCo72j3HqBK9d81N2M= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= +github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= +github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= +github.com/gorilla/handlers v1.4.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/grokify/html-strip-tags-go v0.0.1/go.mod h1:2Su6romC5/1VXOQMaWL2yb618ARB8iVo6/DR99A6d78= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.1.4/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.8.3/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd/go.mod h1:3LVOLeyx9XVvwPgrt2be44XgSqndprz1G18rSk8KD84= +github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= @@ -82,64 +318,189 @@ github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.4 h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1/go.mod h1:DFXrEwSRX0p/aSvxE21319menCBFeQO0jXpRj7LEZUA= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/longbridgeapp/assert v0.1.0/go.mod h1:ew3umReliXtk1bBG4weVURxdvR0tsN+rCEfjnA4YfxI= +github.com/lucas-clemente/quic-go v0.11.2/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdfXxlg1otPbEB2nOw= +github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= +github.com/marten-seemann/qtls v0.2.4/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-sqlite3 v1.14.10 h1:MLn+5bFRlWMGoSRmJour3CL1w/qL96mvipqpwQW/Sfk= github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/micro/cli v0.2.0/go.mod h1:jRT9gmfVKWSS6pkKcXQ8YhUyj6bzwxK8Fp5b0Y7qNnk= +github.com/micro/go-micro v1.7.0 h1:SM8Mx8YjLx/lFHDZaEXaJYTBof/gABFtk9sc5u0gtIA= +github.com/micro/go-micro v1.7.0/go.mod h1:7aiddEWYlyxvm14L6+/LpUbyFPehYDUiQjOy+GOkwbg= +github.com/micro/mdns v0.1.0/go.mod h1:KJ0dW7KmicXU2BV++qkLlmHYcVv7/hHnbtguSWt9Aoc= +github.com/microcosm-cc/bluemonday v1.0.14/go.mod h1:beubO5lmWoy1tU8niaMyXNriNgROO37H3U/tsrcZsy0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.3/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= +github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= +github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nlopes/slack v0.5.0/go.mod h1:jVI4BBK3lSktibKahxBF74txcK2vyvkza1z/+rRnVAM= github.com/nutsdb/nutsdb v0.12.0 h1:6P7EJat2PyVhRu51KMmFu5N851UupfpPBHAqctRm3/4= github.com/nutsdb/nutsdb v0.12.0/go.mod h1:FSztXVhUSK5YmedmZQ6m37cU/KpVbGaezUEmUBP8DEo= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/oschwald/geoip2-golang v1.6.1/go.mod h1:xdvYt5xQzB8ORWFqPnqMwZpCpgNagttWdoZLlJQzg7s= +github.com/oschwald/maxminddb-golang v1.8.0/go.mod h1:RXZtst0N6+FY/3qCNmZMBApR19cdQj43/NM9VkrNAis= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -149,32 +510,77 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog= +github.com/thoas/go-funk v0.9.2 h1:oKlNYv0AY5nyf9g+/GhMgS/UO2ces0QRdPKwkhY3VCk= +github.com/thoas/go-funk v0.9.2/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/uber/jaeger-client-go v2.29.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= +github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v5 v5.3.4/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xujiajun/gorouter v1.2.0/go.mod h1:yJrIta+bTNpBM/2UT8hLOaEAFckO+m/qmR3luMIQygM= github.com/xujiajun/mmap-go v1.0.1 h1:7Se7ss1fLPPRW+ePgqGpCkfGIZzJV6JPq9Wq9iv/WHc= github.com/xujiajun/mmap-go v1.0.1/go.mod h1:CNN6Sw4SL69Sui00p0zEzcZKbt+5HtEnYUsc6BKKRMg= github.com/xujiajun/utils v0.0.0-20220904132955-5f7c5b914235 h1:w0si+uee0iAaCJO9q86T6yrhdadgcsoNuh47LrUykzg= github.com/xujiajun/utils v0.0.0-20220904132955-5f7c5b914235/go.mod h1:MR4+0R6A9NS5IABnIM3384FfOq8QFVnm7WDrBOhIaMU= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= +go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= +go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E= +go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -184,41 +590,175 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190618124811-92942e4437e2/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190607214518-6fa95d984e88/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190621062556-bf70e4678053/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191224085550-c709ea063b76/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220405210540-1e041c57c461/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -229,25 +769,77 @@ golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXR golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190530171427-2b03ca6e44eb/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190620191750-1fa568393b23/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -255,22 +847,142 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20220307174427-659dce7fcb03/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/go-playground/validator.v9 v9.29.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= +gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= +gopkg.in/src-d/go-git.v4 v4.12.0/go.mod h1:zjlNnzc1Wjn43v3Mtii7RVxiReNP0fIu9npcXKzuNp4= +gopkg.in/telegram-bot-api.v4 v4.6.4/go.mod h1:5DpGO5dbumb40px+dXcwCpcjmeHNYLpk0bp3XRNvWDM= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/postgres v1.3.1 h1:Pyv+gg1Gq1IgsLYytj/S2k7ebII3CzEdpqQkPOdH24g= gorm.io/driver/postgres v1.3.1/go.mod h1:WwvWOuR9unCLpGWCL6Y3JOeBWvbKi6JLhayiVclSZZU= gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.2/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.3 h1:jYh3nm7uLZkrMVfA8WVNjDZryKfr7W+HTlInVgKFJAg= gorm.io/gorm v1.23.3/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190614002413-cb51c254f01b/go.mod h1:JlmFZigtG9vBVR3QGIQ9g/Usz4BzH+Xm6Z8iHQWRYUw= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.33.6/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= modernc.org/cc/v3 v3.33.9/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= @@ -402,3 +1114,7 @@ modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw modernc.org/tcl v1.11.2/go.mod h1:BRzgpajcGdS2qTxniOx9c/dcxjlbA7p12eJNmiriQYo= modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.3.2/go.mod h1:PEU2oK2OEA1CfzDTd+8E908qEXhC9s0MfyKp5LZsd+k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 339bcaa5bacabaaab6a3280e9a97d2075cf077d7 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Wed, 4 Sep 2024 11:21:37 +0800 Subject: [PATCH 119/139] fix(backup_store): prevent nil MessageStore initialization Ensure `newBackupStore` does not initialize when `MessageStore` is nil. Removed redundant `start()` calls and simplified checks for `nil` in backup store methods. This aims to enhance stability by preventing operations on invalid stores and streamlining function logic. --- backup_store.go | 55 +++++++++++++++++++++++++++---------------------- filestore.go | 36 +++++++------------------------- 2 files changed, 38 insertions(+), 53 deletions(-) diff --git a/backup_store.go b/backup_store.go index da3824a44..6e1ea7a30 100644 --- a/backup_store.go +++ b/backup_store.go @@ -1,7 +1,7 @@ package quickfix import ( - "time" + "reflect" "git.5th.im/lb-public/gear/log" ) @@ -21,13 +21,24 @@ type persisteMessage struct { } type backupStore struct { - stop chan struct{} messages chan *persisteMessage store MessageStore } func newBackupStore(store MessageStore) *backupStore { - return &backupStore{stop: make(chan struct{}), messages: make(chan *persisteMessage, 500), store: store} + if store == nil { + return nil + } + + if reflect.ValueOf(store).IsNil() { + return nil + } + + backup := &backupStore{messages: make(chan *persisteMessage, 500), store: store} + + backup.start() + + return backup } func (s *backupStore) start() { @@ -53,12 +64,14 @@ func (s *backupStore) start() { log.Errorf("backup store: unsupported operation(%v)\n", message.operation) } } - - close(s.stop) }() } func (s *backupStore) SetNextSenderMsgSeqNum(next int) { + if s == nil { + return + } + select { case s.messages <- &persisteMessage{operation: operationSetNextSenderMsgSeqNum, seqNum: next}: default: @@ -67,6 +80,10 @@ func (s *backupStore) SetNextSenderMsgSeqNum(next int) { } func (s *backupStore) SetNextTargetMsgSeqNum(next int) { + if s == nil { + return + } + select { case s.messages <- &persisteMessage{operation: operationSetNextTargetMsgSeqNum, seqNum: next}: default: @@ -75,6 +92,10 @@ func (s *backupStore) SetNextTargetMsgSeqNum(next int) { } func (s *backupStore) SaveMessage(seqNum int, msg []byte) { + if s == nil { + return + } + select { case s.messages <- &persisteMessage{operation: operationSaveMessage, seqNum: seqNum, msg: msg}: default: @@ -83,29 +104,13 @@ func (s *backupStore) SaveMessage(seqNum int, msg []byte) { } func (s *backupStore) Reset() { - select { - case s.messages <- &persisteMessage{operation: operationReset}: - default: - log.Warn("encountering a large amount of traffic, drop the Reset operation") + if s == nil { + return } -} -func (s *backupStore) Refresh() { select { - case s.messages <- &persisteMessage{operation: operationRefresh}: + case s.messages <- &persisteMessage{operation: operationReset}: default: - log.Warn("encountering a large amount of traffic, drop the Refresh operation") - } -} - -func (s *backupStore) Close() { - close(s.messages) - - ticker := time.NewTicker(time.Second * 10) - - select { - case <-s.stop: - case <-ticker.C: - // log + log.Warn("encountering a large amount of traffic, drop the Reset operation") } } diff --git a/filestore.go b/filestore.go index e5dbff729..799925a62 100644 --- a/filestore.go +++ b/filestore.go @@ -99,8 +99,6 @@ func newFileStore(sessionID SessionID, dirname string, backupStore MessageStore) backup: newBackupStore(backupStore), } - store.backup.start() - if err := store.Refresh(); err != nil { return nil, err } @@ -132,9 +130,9 @@ func (store *fileStore) Reset() error { if err := removeFile(store.targetSeqNumsFname); err != nil { return err } - if store.backup != nil { - store.backup.Reset() - } + + store.backup.Reset() + if err := store.Refresh(); err != nil { return err } @@ -188,10 +186,6 @@ func (store *fileStore) Refresh() (err error) { return errors.Wrap(err, "set next target") } - if store.backup != nil { - store.backup.Refresh() - } - return nil } @@ -285,9 +279,7 @@ func (store *fileStore) SetNextSenderMsgSeqNum(next int) error { return err } - if store.backup != nil { - store.backup.SetNextSenderMsgSeqNum(next) - } + store.backup.SetNextSenderMsgSeqNum(next) return nil } @@ -301,9 +293,7 @@ func (store *fileStore) SetNextTargetMsgSeqNum(next int) error { return err } - if store.backup != nil { - store.backup.SetNextTargetMsgSeqNum(next) - } + store.backup.SetNextTargetMsgSeqNum(next) return nil } @@ -319,9 +309,7 @@ func (store *fileStore) IncrNextSenderMsgSeqNum() error { return err } - if store.backup != nil { - store.backup.SetNextSenderMsgSeqNum(seqNum) - } + store.backup.SetNextSenderMsgSeqNum(seqNum) return nil } @@ -337,9 +325,7 @@ func (store *fileStore) IncrNextTargetMsgSeqNum() error { return err } - if store.backup != nil { - store.backup.SetNextTargetMsgSeqNum(seqNum) - } + store.backup.SetNextTargetMsgSeqNum(seqNum) return nil } @@ -373,9 +359,7 @@ func (store *fileStore) SaveMessage(seqNum int, msg []byte) error { return fmt.Errorf("unable to flush file: %s: %s", store.headerFname, err.Error()) } - if store.backup != nil { - store.backup.SaveMessage(seqNum, msg) - } + store.backup.SaveMessage(seqNum, msg) return nil } @@ -432,9 +416,5 @@ func (store *fileStore) Close() error { store.senderSeqNumsFile = nil store.targetSeqNumsFile = nil - if store.backup != nil { - store.backup.Close() - } - return nil } From 92f31158f45bf14979f61f09753a0c8f39aa427a Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Wed, 4 Sep 2024 11:27:04 +0800 Subject: [PATCH 120/139] refactor(backup): remove unused operationRefresh constant and case Removed the redundant `operationRefresh` constant and its corresponding case in the `backupStore` to improve code maintainability. The `operationRefresh` was not being utilized, making its presence unnecessary. --- backup_store.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/backup_store.go b/backup_store.go index 6e1ea7a30..6fffd2ee1 100644 --- a/backup_store.go +++ b/backup_store.go @@ -11,7 +11,6 @@ const ( operationSetNextTargetMsgSeqNum operationSaveMessage operationReset - operationRefresh ) type persisteMessage struct { @@ -57,9 +56,6 @@ func (s *backupStore) start() { case operationReset: if err := s.store.Reset(); err != nil { } - case operationRefresh: - if err := s.store.Refresh(); err != nil { - } default: log.Errorf("backup store: unsupported operation(%v)\n", message.operation) } From 4e7428783c1a98d84b9980f5513ee5beaec1fe45 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Wed, 4 Sep 2024 14:21:40 +0800 Subject: [PATCH 121/139] refactor(backup): rename and restructure backup store for clarity This commit renames `persisteMessage` to `persistentMessage` and `backup` to `backupStore` to improve code readability. It also introduces a new factory, `backupStoreFactory`, to streamline the creation of `backupStore` instances and integrates this factory into the `fileStore` structure. These changes enhance code maintainability and ensure better naming consistency across the codebase. --- backup_store.go | 42 +++++++++++++++++++++++++----------------- filestore.go | 41 +++++++++++++++-------------------------- 2 files changed, 40 insertions(+), 43 deletions(-) diff --git a/backup_store.go b/backup_store.go index 6fffd2ee1..32624f0aa 100644 --- a/backup_store.go +++ b/backup_store.go @@ -1,8 +1,6 @@ package quickfix import ( - "reflect" - "git.5th.im/lb-public/gear/log" ) @@ -13,27 +11,37 @@ const ( operationReset ) -type persisteMessage struct { +type persistentMessage struct { operation int seqNum int msg []byte } +type backupStoreFactory struct { + messagesQueue chan *persistentMessage + backupFactory MessageStoreFactory +} + type backupStore struct { - messages chan *persisteMessage - store MessageStore + messagesQueue chan *persistentMessage + store MessageStore } -func newBackupStore(store MessageStore) *backupStore { - if store == nil { - return nil - } +func NewBackupStoreFactory(messagesQueue chan *persistentMessage, backupFactory MessageStoreFactory) *backupStoreFactory { + return &backupStoreFactory{messagesQueue: messagesQueue, backupFactory: backupFactory} +} - if reflect.ValueOf(store).IsNil() { - return nil +func (f backupStoreFactory) Create(sessionID SessionID) (msgStore *backupStore, err error) { + backupStore, err := f.backupFactory.Create(sessionID) + if err != nil { + return nil, err } - backup := &backupStore{messages: make(chan *persisteMessage, 500), store: store} + return newBackupStore(backupStore, f.messagesQueue), nil +} + +func newBackupStore(store MessageStore, messagesQueue chan *persistentMessage) *backupStore { + backup := &backupStore{messagesQueue: messagesQueue, store: store} backup.start() @@ -42,7 +50,7 @@ func newBackupStore(store MessageStore) *backupStore { func (s *backupStore) start() { go func() { - for message := range s.messages { + for message := range s.messagesQueue { switch message.operation { case operationSetNextSenderMsgSeqNum: if err := s.store.SetNextSenderMsgSeqNum(message.seqNum); err != nil { @@ -69,7 +77,7 @@ func (s *backupStore) SetNextSenderMsgSeqNum(next int) { } select { - case s.messages <- &persisteMessage{operation: operationSetNextSenderMsgSeqNum, seqNum: next}: + case s.messagesQueue <- &persistentMessage{operation: operationSetNextSenderMsgSeqNum, seqNum: next}: default: log.Warn("encountering a large amount of traffic, drop the SetNextSenderMsgSeqNum operation") } @@ -81,7 +89,7 @@ func (s *backupStore) SetNextTargetMsgSeqNum(next int) { } select { - case s.messages <- &persisteMessage{operation: operationSetNextTargetMsgSeqNum, seqNum: next}: + case s.messagesQueue <- &persistentMessage{operation: operationSetNextTargetMsgSeqNum, seqNum: next}: default: log.Warn("encountering a large amount of traffic, drop the SetNextTargetMsgSeqNum operation") } @@ -93,7 +101,7 @@ func (s *backupStore) SaveMessage(seqNum int, msg []byte) { } select { - case s.messages <- &persisteMessage{operation: operationSaveMessage, seqNum: seqNum, msg: msg}: + case s.messagesQueue <- &persistentMessage{operation: operationSaveMessage, seqNum: seqNum, msg: msg}: default: log.Warn("encountering a large amount of traffic, drop the SaveMessage operation") } @@ -105,7 +113,7 @@ func (s *backupStore) Reset() { } select { - case s.messages <- &persisteMessage{operation: operationReset}: + case s.messagesQueue <- &persistentMessage{operation: operationReset}: default: log.Warn("encountering a large amount of traffic, drop the Reset operation") } diff --git a/filestore.go b/filestore.go index 799925a62..eb0dd008b 100644 --- a/filestore.go +++ b/filestore.go @@ -13,22 +13,14 @@ import ( "github.com/quickfixgo/quickfix/config" ) -type fileStoreOption func(*fileStoreFactory) - -func WithBackupStore(backup MessageStoreFactory) fileStoreOption { - return func(fsf *fileStoreFactory) { - fsf.backup = backup - } -} - type msgDef struct { offset int64 size int } type fileStoreFactory struct { - settings *Settings - backup MessageStoreFactory + settings *Settings + backupFactory *backupStoreFactory } type fileStore struct { @@ -45,17 +37,14 @@ type fileStore struct { sessionFile *os.File senderSeqNumsFile *os.File targetSeqNumsFile *os.File - backup *backupStore + backupStore *backupStore } // NewFileStoreFactory returns a file-based implementation of MessageStoreFactory -func NewFileStoreFactory(settings *Settings, opt ...fileStoreOption) MessageStoreFactory { +func NewFileStoreFactory(settings *Settings, backupFactory *backupStoreFactory) MessageStoreFactory { sfs := &fileStoreFactory{ - settings: settings, - } - - for _, f := range opt { - f(sfs) + settings: settings, + backupFactory: backupFactory, } return sfs @@ -72,7 +61,7 @@ func (f fileStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, er return nil, err } - backupStore, err := f.backup.Create(sessionID) + backupStore, err := f.backupFactory.Create(sessionID) if err != nil { log.Errorf("file store: failed to init backup store, err: %v", err) } @@ -80,7 +69,7 @@ func (f fileStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, er return newFileStore(sessionID, dirname, backupStore) } -func newFileStore(sessionID SessionID, dirname string, backupStore MessageStore) (*fileStore, error) { +func newFileStore(sessionID SessionID, dirname string, backupStore *backupStore) (*fileStore, error) { if err := os.MkdirAll(dirname, os.ModePerm); err != nil { return nil, err } @@ -96,7 +85,7 @@ func newFileStore(sessionID SessionID, dirname string, backupStore MessageStore) sessionFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "session")), senderSeqNumsFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "senderseqnums")), targetSeqNumsFname: path.Join(dirname, fmt.Sprintf("%s.%s", sessionPrefix, "targetseqnums")), - backup: newBackupStore(backupStore), + backupStore: backupStore, } if err := store.Refresh(); err != nil { @@ -131,7 +120,7 @@ func (store *fileStore) Reset() error { return err } - store.backup.Reset() + store.backupStore.Reset() if err := store.Refresh(); err != nil { return err @@ -279,7 +268,7 @@ func (store *fileStore) SetNextSenderMsgSeqNum(next int) error { return err } - store.backup.SetNextSenderMsgSeqNum(next) + store.backupStore.SetNextSenderMsgSeqNum(next) return nil } @@ -293,7 +282,7 @@ func (store *fileStore) SetNextTargetMsgSeqNum(next int) error { return err } - store.backup.SetNextTargetMsgSeqNum(next) + store.backupStore.SetNextTargetMsgSeqNum(next) return nil } @@ -309,7 +298,7 @@ func (store *fileStore) IncrNextSenderMsgSeqNum() error { return err } - store.backup.SetNextSenderMsgSeqNum(seqNum) + store.backupStore.SetNextSenderMsgSeqNum(seqNum) return nil } @@ -325,7 +314,7 @@ func (store *fileStore) IncrNextTargetMsgSeqNum() error { return err } - store.backup.SetNextTargetMsgSeqNum(seqNum) + store.backupStore.SetNextTargetMsgSeqNum(seqNum) return nil } @@ -359,7 +348,7 @@ func (store *fileStore) SaveMessage(seqNum int, msg []byte) error { return fmt.Errorf("unable to flush file: %s: %s", store.headerFname, err.Error()) } - store.backup.SaveMessage(seqNum, msg) + store.backupStore.SaveMessage(seqNum, msg) return nil } From 3f6187140e5b0cea396525990225a4be1d7c5872 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Wed, 4 Sep 2024 14:27:18 +0800 Subject: [PATCH 122/139] refactor(backup-store): export constants and struct types for external use This change modifies the backup_store.go file by making certain constants and struct types public. The constants and struct fields have been renamed with capitalized first letters to ensure they are exported and accessible from other packages. This improves code reusability and maintainability across different parts of the application. --- backup_store.go | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/backup_store.go b/backup_store.go index 32624f0aa..c2c78c329 100644 --- a/backup_store.go +++ b/backup_store.go @@ -5,29 +5,29 @@ import ( ) const ( - operationSetNextSenderMsgSeqNum int = iota + 1 - operationSetNextTargetMsgSeqNum - operationSaveMessage - operationReset + OperationSetNextSenderMsgSeqNum int = iota + 1 + OperationSetNextTargetMsgSeqNum + OperationSaveMessage + OperationReset ) -type persistentMessage struct { - operation int - seqNum int - msg []byte +type PersistentMessage struct { + Operation int + SeqNum int + Msg []byte } type backupStoreFactory struct { - messagesQueue chan *persistentMessage + messagesQueue chan *PersistentMessage backupFactory MessageStoreFactory } type backupStore struct { - messagesQueue chan *persistentMessage + messagesQueue chan *PersistentMessage store MessageStore } -func NewBackupStoreFactory(messagesQueue chan *persistentMessage, backupFactory MessageStoreFactory) *backupStoreFactory { +func NewBackupStoreFactory(messagesQueue chan *PersistentMessage, backupFactory MessageStoreFactory) *backupStoreFactory { return &backupStoreFactory{messagesQueue: messagesQueue, backupFactory: backupFactory} } @@ -40,7 +40,7 @@ func (f backupStoreFactory) Create(sessionID SessionID) (msgStore *backupStore, return newBackupStore(backupStore, f.messagesQueue), nil } -func newBackupStore(store MessageStore, messagesQueue chan *persistentMessage) *backupStore { +func newBackupStore(store MessageStore, messagesQueue chan *PersistentMessage) *backupStore { backup := &backupStore{messagesQueue: messagesQueue, store: store} backup.start() @@ -51,21 +51,21 @@ func newBackupStore(store MessageStore, messagesQueue chan *persistentMessage) * func (s *backupStore) start() { go func() { for message := range s.messagesQueue { - switch message.operation { - case operationSetNextSenderMsgSeqNum: - if err := s.store.SetNextSenderMsgSeqNum(message.seqNum); err != nil { + switch message.Operation { + case OperationSetNextSenderMsgSeqNum: + if err := s.store.SetNextSenderMsgSeqNum(message.SeqNum); err != nil { } - case operationSetNextTargetMsgSeqNum: - if err := s.store.SetNextTargetMsgSeqNum(message.seqNum); err != nil { + case OperationSetNextTargetMsgSeqNum: + if err := s.store.SetNextTargetMsgSeqNum(message.SeqNum); err != nil { } - case operationSaveMessage: - if err := s.store.SaveMessage(message.seqNum, message.msg); err != nil { + case OperationSaveMessage: + if err := s.store.SaveMessage(message.SeqNum, message.Msg); err != nil { } - case operationReset: + case OperationReset: if err := s.store.Reset(); err != nil { } default: - log.Errorf("backup store: unsupported operation(%v)\n", message.operation) + log.Errorf("backup store: unsupported operation(%v)\n", message.Operation) } } }() @@ -77,7 +77,7 @@ func (s *backupStore) SetNextSenderMsgSeqNum(next int) { } select { - case s.messagesQueue <- &persistentMessage{operation: operationSetNextSenderMsgSeqNum, seqNum: next}: + case s.messagesQueue <- &PersistentMessage{Operation: OperationSetNextSenderMsgSeqNum, SeqNum: next}: default: log.Warn("encountering a large amount of traffic, drop the SetNextSenderMsgSeqNum operation") } @@ -89,7 +89,7 @@ func (s *backupStore) SetNextTargetMsgSeqNum(next int) { } select { - case s.messagesQueue <- &persistentMessage{operation: operationSetNextTargetMsgSeqNum, seqNum: next}: + case s.messagesQueue <- &PersistentMessage{Operation: OperationSetNextTargetMsgSeqNum, SeqNum: next}: default: log.Warn("encountering a large amount of traffic, drop the SetNextTargetMsgSeqNum operation") } @@ -101,7 +101,7 @@ func (s *backupStore) SaveMessage(seqNum int, msg []byte) { } select { - case s.messagesQueue <- &persistentMessage{operation: operationSaveMessage, seqNum: seqNum, msg: msg}: + case s.messagesQueue <- &PersistentMessage{Operation: OperationSaveMessage, SeqNum: seqNum, Msg: msg}: default: log.Warn("encountering a large amount of traffic, drop the SaveMessage operation") } @@ -113,7 +113,7 @@ func (s *backupStore) Reset() { } select { - case s.messagesQueue <- &persistentMessage{operation: operationReset}: + case s.messagesQueue <- &PersistentMessage{Operation: OperationReset}: default: log.Warn("encountering a large amount of traffic, drop the Reset operation") } From b1e3c6f7597acd79e1f2275a18a5a7e534dd1b42 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Wed, 4 Sep 2024 14:52:18 +0800 Subject: [PATCH 123/139] refactor(backup): rename PersistentMessage to BackupMessage Renamed the PersistentMessage struct to BackupMessage for better clarity and consistency with the naming of the backupStore context. This change affects type declarations, variable names, and function parameters that previously referenced PersistentMessage. No functional behavior has been modified. --- backup_store.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/backup_store.go b/backup_store.go index c2c78c329..2dfdcc126 100644 --- a/backup_store.go +++ b/backup_store.go @@ -11,23 +11,23 @@ const ( OperationReset ) -type PersistentMessage struct { +type BackupMessage struct { Operation int SeqNum int Msg []byte } type backupStoreFactory struct { - messagesQueue chan *PersistentMessage + messagesQueue chan *BackupMessage backupFactory MessageStoreFactory } type backupStore struct { - messagesQueue chan *PersistentMessage + messagesQueue chan *BackupMessage store MessageStore } -func NewBackupStoreFactory(messagesQueue chan *PersistentMessage, backupFactory MessageStoreFactory) *backupStoreFactory { +func NewBackupStoreFactory(messagesQueue chan *BackupMessage, backupFactory MessageStoreFactory) *backupStoreFactory { return &backupStoreFactory{messagesQueue: messagesQueue, backupFactory: backupFactory} } @@ -40,7 +40,7 @@ func (f backupStoreFactory) Create(sessionID SessionID) (msgStore *backupStore, return newBackupStore(backupStore, f.messagesQueue), nil } -func newBackupStore(store MessageStore, messagesQueue chan *PersistentMessage) *backupStore { +func newBackupStore(store MessageStore, messagesQueue chan *BackupMessage) *backupStore { backup := &backupStore{messagesQueue: messagesQueue, store: store} backup.start() @@ -77,7 +77,7 @@ func (s *backupStore) SetNextSenderMsgSeqNum(next int) { } select { - case s.messagesQueue <- &PersistentMessage{Operation: OperationSetNextSenderMsgSeqNum, SeqNum: next}: + case s.messagesQueue <- &BackupMessage{Operation: OperationSetNextSenderMsgSeqNum, SeqNum: next}: default: log.Warn("encountering a large amount of traffic, drop the SetNextSenderMsgSeqNum operation") } @@ -89,7 +89,7 @@ func (s *backupStore) SetNextTargetMsgSeqNum(next int) { } select { - case s.messagesQueue <- &PersistentMessage{Operation: OperationSetNextTargetMsgSeqNum, SeqNum: next}: + case s.messagesQueue <- &BackupMessage{Operation: OperationSetNextTargetMsgSeqNum, SeqNum: next}: default: log.Warn("encountering a large amount of traffic, drop the SetNextTargetMsgSeqNum operation") } @@ -101,7 +101,7 @@ func (s *backupStore) SaveMessage(seqNum int, msg []byte) { } select { - case s.messagesQueue <- &PersistentMessage{Operation: OperationSaveMessage, SeqNum: seqNum, Msg: msg}: + case s.messagesQueue <- &BackupMessage{Operation: OperationSaveMessage, SeqNum: seqNum, Msg: msg}: default: log.Warn("encountering a large amount of traffic, drop the SaveMessage operation") } @@ -113,7 +113,7 @@ func (s *backupStore) Reset() { } select { - case s.messagesQueue <- &PersistentMessage{Operation: OperationReset}: + case s.messagesQueue <- &BackupMessage{Operation: OperationReset}: default: log.Warn("encountering a large amount of traffic, drop the Reset operation") } From 2c41d60d72b49140bb79640f36b0472d29bba6f2 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Wed, 4 Sep 2024 14:55:02 +0800 Subject: [PATCH 124/139] feat(filestore): add backup store functionality and update dependencies Added backup store support to `FileStore` by introducing a `backupStoreFactory` in the test setup. Updated various dependencies in `go.mod` and `go.sum` files to ensure compatibility and enhance functionality. --- filestore_test.go | 3 ++- go.mod | 2 +- go.sum | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/filestore_test.go b/filestore_test.go index 56fc8ec68..74f6d7bbd 100644 --- a/filestore_test.go +++ b/filestore_test.go @@ -35,7 +35,8 @@ TargetCompID=%s`, fileStorePath, sessionID.BeginString, sessionID.SenderCompID, require.Nil(suite.T(), err) // create store - suite.msgStore, err = NewFileStoreFactory(settings).Create(sessionID) + backupStore := &backupStoreFactory{messagesQueue: make(chan *BackupMessage, 100), backupFactory: NewMemoryStoreFactory()} + suite.msgStore, err = NewFileStoreFactory(settings, backupStore).Create(sessionID) require.Nil(suite.T(), err) } diff --git a/go.mod b/go.mod index b5b2d6938..be5faf344 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/quickfixgo/quickfix go 1.13 require ( - git.5th.im/lb-public/gear/log v1.8.0 // indirect + git.5th.im/lb-public/gear/log v1.8.0 github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/glebarez/sqlite v1.4.1 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 diff --git a/go.sum b/go.sum index eeb9ae3a4..ff0a826c5 100644 --- a/go.sum +++ b/go.sum @@ -48,6 +48,7 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= @@ -72,6 +73,7 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -204,6 +206,7 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -362,6 +365,7 @@ github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/longbridgeapp/assert v0.1.0 h1:KkQlHUJSpuUFkUDjwBJgghFl31+wwSDHTq/WRrvLjko= github.com/longbridgeapp/assert v0.1.0/go.mod h1:ew3umReliXtk1bBG4weVURxdvR0tsN+rCEfjnA4YfxI= github.com/lucas-clemente/quic-go v0.11.2/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdfXxlg1otPbEB2nOw= github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= @@ -422,18 +426,22 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/oschwald/geoip2-golang v1.6.1/go.mod h1:xdvYt5xQzB8ORWFqPnqMwZpCpgNagttWdoZLlJQzg7s= github.com/oschwald/maxminddb-golang v1.8.0/go.mod h1:RXZtst0N6+FY/3qCNmZMBApR19cdQj43/NM9VkrNAis= @@ -519,7 +527,9 @@ github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6 github.com/thoas/go-funk v0.9.2 h1:oKlNYv0AY5nyf9g+/GhMgS/UO2ces0QRdPKwkhY3VCk= github.com/thoas/go-funk v0.9.2/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/uber/jaeger-client-go v2.29.1+incompatible h1:R9ec3zO3sGpzs0abd43Y+fBZRJ9uiH6lXyR/+u6brW4= github.com/uber/jaeger-client-go v2.29.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack/v5 v5.3.4/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= @@ -555,6 +565,7 @@ go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= @@ -602,6 +613,7 @@ golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -616,6 +628,7 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190607214518-6fa95d984e88/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -628,6 +641,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -840,6 +854,7 @@ golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -848,7 +863,9 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -963,6 +980,7 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 576e9c9e0e798704a85213229fcc09fb6a015ee2 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Thu, 3 Oct 2024 19:30:29 +0800 Subject: [PATCH 125/139] fix(backup): handle nil receiver in start method Added a check to ensure the method does not proceed if the receiver is nil, preventing potential runtime panics. --- backup_store.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backup_store.go b/backup_store.go index 2dfdcc126..2218bdf22 100644 --- a/backup_store.go +++ b/backup_store.go @@ -49,6 +49,10 @@ func newBackupStore(store MessageStore, messagesQueue chan *BackupMessage) *back } func (s *backupStore) start() { + if s == nil { + return + } + go func() { for message := range s.messagesQueue { switch message.Operation { From 21ce2f029e5f86eb8841c78c6372e1ca19383d39 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Sat, 5 Oct 2024 14:06:04 +0800 Subject: [PATCH 126/139] refactor(logging): replace custom logging package with fmt Replaced the custom logging package "git.5th.im/lb-public/gear/log" with the standard library's "fmt" for a more straightforward logging approach. Updated all related log function calls to use fmt.Printf and fmt.Println accordingly. Additionally, removed the dependency from go.mod and cleaned up go.sum. --- backup_store.go | 12 +- filestore.go | 3 +- go.mod | 1 - go.sum | 734 ------------------------------------------------ 4 files changed, 7 insertions(+), 743 deletions(-) diff --git a/backup_store.go b/backup_store.go index 2218bdf22..f035d3544 100644 --- a/backup_store.go +++ b/backup_store.go @@ -1,7 +1,7 @@ package quickfix import ( - "git.5th.im/lb-public/gear/log" + "fmt" ) const ( @@ -69,7 +69,7 @@ func (s *backupStore) start() { if err := s.store.Reset(); err != nil { } default: - log.Errorf("backup store: unsupported operation(%v)\n", message.Operation) + fmt.Printf("backup store: unsupported operation(%v)\n", message.Operation) } } }() @@ -83,7 +83,7 @@ func (s *backupStore) SetNextSenderMsgSeqNum(next int) { select { case s.messagesQueue <- &BackupMessage{Operation: OperationSetNextSenderMsgSeqNum, SeqNum: next}: default: - log.Warn("encountering a large amount of traffic, drop the SetNextSenderMsgSeqNum operation") + fmt.Println("encountering a large amount of traffic, drop the SetNextSenderMsgSeqNum operation") } } @@ -95,7 +95,7 @@ func (s *backupStore) SetNextTargetMsgSeqNum(next int) { select { case s.messagesQueue <- &BackupMessage{Operation: OperationSetNextTargetMsgSeqNum, SeqNum: next}: default: - log.Warn("encountering a large amount of traffic, drop the SetNextTargetMsgSeqNum operation") + fmt.Println("encountering a large amount of traffic, drop the SetNextTargetMsgSeqNum operation") } } @@ -107,7 +107,7 @@ func (s *backupStore) SaveMessage(seqNum int, msg []byte) { select { case s.messagesQueue <- &BackupMessage{Operation: OperationSaveMessage, SeqNum: seqNum, Msg: msg}: default: - log.Warn("encountering a large amount of traffic, drop the SaveMessage operation") + fmt.Println("encountering a large amount of traffic, drop the SaveMessage operation") } } @@ -119,6 +119,6 @@ func (s *backupStore) Reset() { select { case s.messagesQueue <- &BackupMessage{Operation: OperationReset}: default: - log.Warn("encountering a large amount of traffic, drop the Reset operation") + fmt.Println("encountering a large amount of traffic, drop the Reset operation") } } diff --git a/filestore.go b/filestore.go index eb0dd008b..6673dd0b0 100644 --- a/filestore.go +++ b/filestore.go @@ -8,7 +8,6 @@ import ( "strconv" "time" - "git.5th.im/lb-public/gear/log" "github.com/pkg/errors" "github.com/quickfixgo/quickfix/config" ) @@ -63,7 +62,7 @@ func (f fileStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, er backupStore, err := f.backupFactory.Create(sessionID) if err != nil { - log.Errorf("file store: failed to init backup store, err: %v", err) + fmt.Printf("file store: failed to init backup store, err: %v\n", err) } return newFileStore(sessionID, dirname, backupStore) diff --git a/go.mod b/go.mod index be5faf344..b8aa1a82f 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/quickfixgo/quickfix go 1.13 require ( - git.5th.im/lb-public/gear/log v1.8.0 github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 github.com/glebarez/sqlite v1.4.1 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 diff --git a/go.sum b/go.sum index ff0a826c5..d0382e947 100644 --- a/go.sum +++ b/go.sum @@ -1,111 +1,13 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.40.0/go.mod h1:Tk58MuI9rbLMKlAjeO/bDnteAx7tX2gJIXw4T5Jwlro= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -git.5th.im/lb-public/gear/cache v0.1.1/go.mod h1:Y95lQ5W6xMjNvWQaDczxC1OSc9m/EVz4k1Tf3wV5AKQ= -git.5th.im/lb-public/gear/log v1.0.0/go.mod h1:HLY/7Ga9/IPX+ZwOBVLF4GT+W/nHh7fJWGHLfv+ILl0= -git.5th.im/lb-public/gear/log v1.1.0/go.mod h1:HLY/7Ga9/IPX+ZwOBVLF4GT+W/nHh7fJWGHLfv+ILl0= -git.5th.im/lb-public/gear/log v1.3.2/go.mod h1:YITGdkVfSr7ubiyzBM61AEf1m6wNxNyyJoxzVQTstYM= -git.5th.im/lb-public/gear/log v1.8.0 h1:reWCCrZ5gSBxyAA9j3sDqgrmIq9O7kwDflqMXVNG9XY= -git.5th.im/lb-public/gear/log v1.8.0/go.mod h1:cYw6jEc1d4A01j++04I7kAYDlBtZY7dLUHIGbIhtUwQ= -git.5th.im/lb-public/gear/runtime v0.1.0/go.mod h1:hHxmu9Gg6VCVsAEO9T7Xe5RPay2DIlJyi/13aaII9iM= -git.5th.im/lb-public/gear/runtime v0.2.2 h1:W+jHNLuToOpGJ4v3U8eLd3WdQdUEcIXng9iheF7tXtE= -git.5th.im/lb-public/gear/runtime v0.2.2/go.mod h1:arJaeqGf/BVYfkFYQQNKFaxpkpQI2dJzhkT250mbY7A= -git.5th.im/lb-public/gear/util v0.4.13 h1:5fzlVVHf+SE25JTOSifIffHLr33UpTSltB2Mwu41aNo= -git.5th.im/lb-public/gear/util v0.4.13/go.mod h1:Laon3egMeqRjPGE7kkoIKq7ykhqc0jrQ4ZuKQ73NzrQ= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= -github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507 h1:dmVRVC/MmuwC2edm/P6oWIP+9n+p9IgVgK0lq9mBQjU= github.com/armon/go-proxyproto v0.0.0-20200108142055-f0b8253b1507/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= -github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bwmarrin/discordgo v0.19.0/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/containerd/continuity v0.0.0-20181203112020-004b46473808/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -113,165 +15,24 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/docker v0.7.3-0.20190309235953-33c3200e0d16/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/forestgiant/sliceutil v0.0.0-20160425183142-94783f95db6c/go.mod h1:pFdJbAhRf7rh6YYMUdIQGyzne6zYL1tCUW8QV2B3UfY= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsouza/go-dockerclient v1.4.1/go.mod h1:PUNHxbowDqRXfRgZqMz1OeGtbWC6VKyZvJ99hDjB0qs= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/glebarez/go-sqlite v1.15.1 h1:1gRIcUp1EFZ9wn7qBVFte332R6elCC6nJl4+YWu7SNI= github.com/glebarez/go-sqlite v1.15.1/go.mod h1:rAfxRB8nJkvpDoj3sCegn4Sm/w4xX3o2lx7GiJ5vs0k= github.com/glebarez/sqlite v1.4.1 h1:IrFURFnrjiPhRW8D8N7YvUssBNzfbrTb4xN6Mk7W7rM= github.com/glebarez/sqlite v1.4.1/go.mod h1:OI0VEF6vz0qLnOr3ooLCuVdsxwNrPlo9Bscqjg9x2bM= -github.com/gliderlabs/ssh v0.1.3/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-log/log v0.1.0/go.mod h1:4mBwpdRMFLiuXZDCwU2lKQFsoSCo72j3HqBK9d81N2M= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= -github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= -github.com/gorilla/handlers v1.4.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grokify/html-strip-tags-go v0.0.1/go.mod h1:2Su6romC5/1VXOQMaWL2yb618ARB8iVo6/DR99A6d78= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.1.4/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.8.3/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd/go.mod h1:3LVOLeyx9XVvwPgrt2be44XgSqndprz1G18rSk8KD84= -github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= @@ -321,194 +82,64 @@ github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.4 h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1/go.mod h1:DFXrEwSRX0p/aSvxE21319menCBFeQO0jXpRj7LEZUA= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/longbridgeapp/assert v0.1.0 h1:KkQlHUJSpuUFkUDjwBJgghFl31+wwSDHTq/WRrvLjko= -github.com/longbridgeapp/assert v0.1.0/go.mod h1:ew3umReliXtk1bBG4weVURxdvR0tsN+rCEfjnA4YfxI= -github.com/lucas-clemente/quic-go v0.11.2/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdfXxlg1otPbEB2nOw= -github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= -github.com/marten-seemann/qtls v0.2.4/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-sqlite3 v1.14.10 h1:MLn+5bFRlWMGoSRmJour3CL1w/qL96mvipqpwQW/Sfk= github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/micro/cli v0.2.0/go.mod h1:jRT9gmfVKWSS6pkKcXQ8YhUyj6bzwxK8Fp5b0Y7qNnk= -github.com/micro/go-micro v1.7.0 h1:SM8Mx8YjLx/lFHDZaEXaJYTBof/gABFtk9sc5u0gtIA= -github.com/micro/go-micro v1.7.0/go.mod h1:7aiddEWYlyxvm14L6+/LpUbyFPehYDUiQjOy+GOkwbg= -github.com/micro/mdns v0.1.0/go.mod h1:KJ0dW7KmicXU2BV++qkLlmHYcVv7/hHnbtguSWt9Aoc= -github.com/microcosm-cc/bluemonday v1.0.14/go.mod h1:beubO5lmWoy1tU8niaMyXNriNgROO37H3U/tsrcZsy0= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.3/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= -github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nlopes/slack v0.5.0/go.mod h1:jVI4BBK3lSktibKahxBF74txcK2vyvkza1z/+rRnVAM= github.com/nutsdb/nutsdb v0.12.0 h1:6P7EJat2PyVhRu51KMmFu5N851UupfpPBHAqctRm3/4= github.com/nutsdb/nutsdb v0.12.0/go.mod h1:FSztXVhUSK5YmedmZQ6m37cU/KpVbGaezUEmUBP8DEo= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= -github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/oschwald/geoip2-golang v1.6.1/go.mod h1:xdvYt5xQzB8ORWFqPnqMwZpCpgNagttWdoZLlJQzg7s= -github.com/oschwald/maxminddb-golang v1.8.0/go.mod h1:RXZtst0N6+FY/3qCNmZMBApR19cdQj43/NM9VkrNAis= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -518,80 +149,32 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog= -github.com/thoas/go-funk v0.9.2 h1:oKlNYv0AY5nyf9g+/GhMgS/UO2ces0QRdPKwkhY3VCk= -github.com/thoas/go-funk v0.9.2/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/uber/jaeger-client-go v2.29.1+incompatible h1:R9ec3zO3sGpzs0abd43Y+fBZRJ9uiH6lXyR/+u6brW4= -github.com/uber/jaeger-client-go v2.29.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= -github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v5 v5.3.4/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xujiajun/gorouter v1.2.0/go.mod h1:yJrIta+bTNpBM/2UT8hLOaEAFckO+m/qmR3luMIQygM= github.com/xujiajun/mmap-go v1.0.1 h1:7Se7ss1fLPPRW+ePgqGpCkfGIZzJV6JPq9Wq9iv/WHc= github.com/xujiajun/mmap-go v1.0.1/go.mod h1:CNN6Sw4SL69Sui00p0zEzcZKbt+5HtEnYUsc6BKKRMg= github.com/xujiajun/utils v0.0.0-20220904132955-5f7c5b914235 h1:w0si+uee0iAaCJO9q86T6yrhdadgcsoNuh47LrUykzg= github.com/xujiajun/utils v0.0.0-20220904132955-5f7c5b914235/go.mod h1:MR4+0R6A9NS5IABnIM3384FfOq8QFVnm7WDrBOhIaMU= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= -go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= -go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E= -go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -601,178 +184,41 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190618124811-92942e4437e2/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190607214518-6fa95d984e88/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190621062556-bf70e4678053/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191224085550-c709ea063b76/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220405210540-1e041c57c461/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -783,78 +229,25 @@ golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXR golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190530171427-2b03ca6e44eb/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190620191750-1fa568393b23/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -862,145 +255,22 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20220307174427-659dce7fcb03/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/validator.v9 v9.29.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= -gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= -gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= -gopkg.in/src-d/go-git.v4 v4.12.0/go.mod h1:zjlNnzc1Wjn43v3Mtii7RVxiReNP0fIu9npcXKzuNp4= -gopkg.in/telegram-bot-api.v4 v4.6.4/go.mod h1:5DpGO5dbumb40px+dXcwCpcjmeHNYLpk0bp3XRNvWDM= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/postgres v1.3.1 h1:Pyv+gg1Gq1IgsLYytj/S2k7ebII3CzEdpqQkPOdH24g= gorm.io/driver/postgres v1.3.1/go.mod h1:WwvWOuR9unCLpGWCL6Y3JOeBWvbKi6JLhayiVclSZZU= gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= -gorm.io/gorm v1.23.2/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.3 h1:jYh3nm7uLZkrMVfA8WVNjDZryKfr7W+HTlInVgKFJAg= gorm.io/gorm v1.23.3/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190614002413-cb51c254f01b/go.mod h1:JlmFZigtG9vBVR3QGIQ9g/Usz4BzH+Xm6Z8iHQWRYUw= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.33.6/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= modernc.org/cc/v3 v3.33.9/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= @@ -1132,7 +402,3 @@ modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw modernc.org/tcl v1.11.2/go.mod h1:BRzgpajcGdS2qTxniOx9c/dcxjlbA7p12eJNmiriQYo= modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.3.2/go.mod h1:PEU2oK2OEA1CfzDTd+8E908qEXhC9s0MfyKp5LZsd+k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From dc2f62b953d3529dcbbfa9be7e6acfacab3bbc58 Mon Sep 17 00:00:00 2001 From: Mike Gatny Date: Mon, 15 Apr 2024 16:55:14 -0400 Subject: [PATCH 127/139] pick Preserve original body when resending --- in_session.go | 5 +++-- message.go | 15 +++++++++++++++ message_test.go | 40 ++++++++++++++++++++++++++++++++++++++-- session.go | 8 ++++++++ 4 files changed, 64 insertions(+), 4 deletions(-) diff --git a/in_session.go b/in_session.go index d4dfc701d..c2d4f79d9 100644 --- a/in_session.go +++ b/in_session.go @@ -238,8 +238,9 @@ func (state inSession) resendMessages(session *session, beginSeqNo, endSeqNo int } session.log.OnEventf("Resending Message: %v", sentMessageSeqNum) - msgBytes = msg.build() - session.sendBytes(msgBytes) + + msgBytes = msg.buildWithBodyBytes(msg.bodyBytes) // workaround for maintaining repeating group field order + session.EnqueueBytesAndSend(msgBytes) seqNum = sentMessageSeqNum + 1 nextSeqNum = seqNum diff --git a/message.go b/message.go index f800cbebf..078f23d0b 100644 --- a/message.go +++ b/message.go @@ -373,6 +373,21 @@ func (m *Message) build() []byte { return b.Bytes() } +// Constructs a []byte from a Message instance, using the given bodyBytes. +// This is a workaround for the fact that we currently rely on the generated Message types to properly serialize/deserialize RepeatingGroups. +// In other words, we cannot go from bytes to a Message then back to bytes, which is exactly what we need to do in the case of a Resend. +// This func lets us pull the Message from the Store, parse it, update the Header, and then build it back into bytes using the original Body. +// Note: The only standard non-Body group is NoHops. If that is used in the Header, this workaround may fail. +func (m *Message) buildWithBodyBytes(bodyBytes []byte) []byte { + m.cook() + + var b bytes.Buffer + m.Header.write(&b) + b.Write(bodyBytes) + m.Trailer.write(&b) + return b.Bytes() +} + func (m *Message) cook() { bodyLength := m.Header.length() + m.Body.length() + m.Trailer.length() m.Header.SetInt(tagBodyLength, bodyLength) diff --git a/message_test.go b/message_test.go index 3766c9221..59840d909 100644 --- a/message_test.go +++ b/message_test.go @@ -107,18 +107,54 @@ func (s *MessageSuite) TestReBuild() { s.msg.Header.SetField(tagOrigSendingTime, FIXString("20140515-19:49:56.659")) s.msg.Header.SetField(tagSendingTime, FIXString("20140615-19:49:56")) + s.msg.Header.SetField(tagPossDupFlag, FIXBoolean(true)) rebuildBytes := s.msg.build() - expectedBytes := []byte("8=FIX.4.29=12635=D34=249=TW52=20140615-19:49:5656=ISLD122=20140515-19:49:56.65911=10021=140=154=155=TSLA60=00010101-00:00:00.00010=128") + expectedBytes := []byte("8=FIX.4.29=13135=D34=243=Y49=TW52=20140615-19:49:5656=ISLD122=20140515-19:49:56.65911=10021=140=154=155=TSLA60=00010101-00:00:00.00010=122") - s.True(bytes.Equal(expectedBytes, rebuildBytes), "Unexpected bytes,\n +%s\n-%s", rebuildBytes, expectedBytes) + s.True(bytes.Equal(expectedBytes, rebuildBytes), "Unexpected bytes,\n +%s\n -%s", rebuildBytes, expectedBytes) expectedBodyBytes := []byte("11=10021=140=154=155=TSLA60=00010101-00:00:00.000") s.True(bytes.Equal(s.msg.bodyBytes, expectedBodyBytes), "Incorrect body bytes, got %s", string(s.msg.bodyBytes)) } +func (s *MessageSuite) TestReBuildWithRepeatingGroupForResend() { + // Given the following message with a repeating group + origHeader := "8=FIXT.1.19=16135=834=349=ISLD52=20240415-03:43:17.92356=TW" + origBody := "6=1.0011=114=1.0017=131=1.0032=1.0037=138=1.0039=254=155=1150=2151=0.00453=1448=xyzzy447=D452=1" + origTrailer := "10=014" + rawMsg := bytes.NewBufferString(origHeader + origBody + origTrailer) + + // When I reparse the message from the store during a resend request + s.Nil(ParseMessage(s.msg, rawMsg)) + + // And I update the headers for resend + s.msg.Header.SetField(tagOrigSendingTime, FIXString("20240415-03:43:17.923")) + s.msg.Header.SetField(tagSendingTime, FIXString("20240415-14:41:23.456")) + s.msg.Header.SetField(tagPossDupFlag, FIXBoolean(true)) + + // When I rebuild the message + rebuildBytes := s.msg.build() + + // Then the repeating groups will not be in the correct order in the rebuilt message (note tags 447, 448, 452, 453) + expectedBytes := []byte("8=FIXT.1.19=19235=834=343=Y49=ISLD52=20240415-14:41:23.45656=TW122=20240415-03:43:17.9236=1.0011=114=1.0017=131=1.0032=1.0037=138=1.0039=254=155=1150=2151=0.00453=1448=xyzzy447=D452=110=018") + s.False(bytes.Equal(expectedBytes, rebuildBytes), "Unexpected bytes,\n expected: %s\n but was: %s", expectedBytes, rebuildBytes) + expectedOutOfOrderBytes := []byte("8=FIXT.1.19=19235=834=343=Y49=ISLD52=20240415-14:41:23.45656=TW122=20240415-03:43:17.9236=1.0011=114=1.0017=131=1.0032=1.0037=138=1.0039=254=155=1150=2151=0.00447=D448=xyzzy452=1453=110=018") + s.True(bytes.Equal(expectedOutOfOrderBytes, rebuildBytes), "Unexpected bytes,\n expected: %s\n but was: %s", expectedOutOfOrderBytes, rebuildBytes) + + // But the bodyBytes will still be correct + origBodyBytes := []byte(origBody) + s.True(bytes.Equal(origBodyBytes, s.msg.bodyBytes), "Incorrect body bytes, \n expected: %s\n but was: %s", origBodyBytes, s.msg.bodyBytes) + + // So when I combine the updated header + the original bodyBytes + the as-is trailer + resendBytes := s.msg.buildWithBodyBytes(s.msg.bodyBytes) + + // Then the reparsed, rebuilt message will retain the correct ordering of repeating group tags during resend + s.True(bytes.Equal(expectedBytes, resendBytes), "Unexpected bytes,\n expected: %s\n but was: %s", expectedBytes, resendBytes) +} + func (s *MessageSuite) TestReverseRoute() { s.Nil(ParseMessage(s.msg, bytes.NewBufferString("8=FIX.4.29=17135=D34=249=TW50=KK52=20060102-15:04:0556=ISLD57=AP144=BB115=JCD116=CS128=MG129=CB142=JV143=RY145=BH11=ID21=338=10040=w54=155=INTC60=20060102-15:04:0510=123"))) diff --git a/session.go b/session.go index 713ba25c4..39d97fb93 100644 --- a/session.go +++ b/session.go @@ -348,6 +348,14 @@ func (s *session) dropQueued() { s.toSend = s.toSend[:0] } +func (s *session) EnqueueBytesAndSend(msg []byte) { + s.sendMutex.Lock() + defer s.sendMutex.Unlock() + + s.toSend = append(s.toSend, msg) + s.sendQueued() +} + func (s *session) sendBytes(msg []byte) { s.log.OnOutgoing(msg) s.messageOut <- msg From 521b6472cfd5e836faec0d9b75c5ce989761ca29 Mon Sep 17 00:00:00 2001 From: Sami Date: Fri, 11 Jun 2021 14:09:32 +0200 Subject: [PATCH 128/139] rename --- in_session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/in_session.go b/in_session.go index c2d4f79d9..8a50bc50a 100644 --- a/in_session.go +++ b/in_session.go @@ -383,7 +383,7 @@ func (state *inSession) generateSequenceReset(session *session, beginSeqNo int, msgBytes := sequenceReset.build() - session.sendBytes(msgBytes) + session.EnqueueBytesAndSend(msgBytes) session.log.OnEventf("Sent SequenceReset TO: %v", endSeqNo) return From 72ebd1a0ec1d282e72a2605f603b80ce8aa0a47b Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Wed, 6 Nov 2024 17:54:37 +0800 Subject: [PATCH 129/139] add test cases to verify state features --- session_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/session_test.go b/session_test.go index 293b94805..906521b4f 100644 --- a/session_test.go +++ b/session_test.go @@ -2,6 +2,7 @@ package quickfix import ( "bytes" + "reflect" "testing" "time" @@ -956,3 +957,33 @@ func (suite *SessionSendTestSuite) TestDropAndSendDropsQueueWithReset() { suite.LastToAdminMessageSent() suite.NoMessageSent() } + +func TestSessionState(t *testing.T) { + type wants struct { + connected bool + loggedOn bool + } + + tests := []struct { + name string + state sessionState + want wants + }{ + {name: "latentState", state: latentState{}, want: wants{connected: false, loggedOn: false}}, + {name: "logonState", state: logonState{}, want: wants{connected: true, loggedOn: false}}, + {name: "inSession", state: inSession{}, want: wants{connected: true, loggedOn: true}}, + {name: "logoutState", state: logoutState{}, want: wants{connected: true, loggedOn: false}}, + {name: "resendState", state: resendState{}, want: wants{connected: true, loggedOn: true}}, + {name: "pendingTimeout", state: pendingTimeout{inSession{}}, want: wants{connected: true, loggedOn: true}}, + {name: "notSessionTime", state: notSessionTime{}, want: wants{connected: false, loggedOn: false}}, + } + + for _, test := range tests { + if !reflect.DeepEqual(test.state.IsConnected(), test.want.connected) { + t.Errorf("%s.IsConnected() got = %v", test.name, test.state.IsConnected()) + } + if !reflect.DeepEqual(test.state.IsLoggedOn(), test.want.loggedOn) { + t.Errorf("%s.IsLoggedOn() got = %v", test.name, test.state.IsLoggedOn()) + } + } +} From 069e07834cf5d1a8f21c2e60cf88890646abc747 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Wed, 6 Nov 2024 18:38:43 +0800 Subject: [PATCH 130/139] expose IsConnectedAndLoggedOn to verify session state --- initiator.go | 9 +++++++++ session_state.go | 20 ++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/initiator.go b/initiator.go index 3d2a7edd4..a34244494 100644 --- a/initiator.go +++ b/initiator.go @@ -62,6 +62,15 @@ func (i *Initiator) Stop() { i.wg.Wait() } +func (i *Initiator) IsConnectedAndLoggedOn(sessionID SessionID) bool { + session, ok := i.sessions[sessionID] + if !ok { + return false + } + + return session.IsConnected() && session.IsLoggedOn() +} + // NewInitiator creates and initializes a new Initiator. func NewInitiator(app Application, storeFactory MessageStoreFactory, appSettings *Settings, logFactory LogFactory) (*Initiator, error) { i := &Initiator{ diff --git a/session_state.go b/session_state.go index c8b1f42a4..ee538bb6f 100644 --- a/session_state.go +++ b/session_state.go @@ -193,8 +193,8 @@ func handleStateError(s *session, err error) sessionState { return latentState{} } -//sessionState is the current state of the session state machine. The session state determines how the session responds to -//incoming messages, timeouts, and requests to send application messages. +// sessionState is the current state of the session state machine. The session state determines how the session responds to +// incoming messages, timeouts, and requests to send application messages. type sessionState interface { //FixMsgIn is called by the session on incoming messages from the counter party. The return type is the next session state //following message processing @@ -203,12 +203,6 @@ type sessionState interface { //Timeout is called by the session on a timeout event. Timeout(*session, internal.Event) (nextState sessionState) - //IsLoggedOn returns true if state is logged on an in session, false otherwise - IsLoggedOn() bool - - //IsConnected returns true if the state is connected - IsConnected() bool - //IsSessionTime returns true if the state is in session time IsSessionTime() bool @@ -220,6 +214,16 @@ type sessionState interface { //debugging convenience fmt.Stringer + + SessionStateReader +} + +type SessionStateReader interface { + //IsLoggedOn returns true if state is logged on an in session, false otherwise + IsLoggedOn() bool + + //IsConnected returns true if the state is connected + IsConnected() bool } type inSessionTime struct{} From c18cb9b108bd3dc781f3b17bf143bfd30a0f72d6 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Wed, 6 Nov 2024 18:39:43 +0800 Subject: [PATCH 131/139] revert --- session_state.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/session_state.go b/session_state.go index ee538bb6f..03843ecd3 100644 --- a/session_state.go +++ b/session_state.go @@ -203,6 +203,12 @@ type sessionState interface { //Timeout is called by the session on a timeout event. Timeout(*session, internal.Event) (nextState sessionState) + //IsLoggedOn returns true if state is logged on an in session, false otherwise + IsLoggedOn() bool + + //IsConnected returns true if the state is connected + IsConnected() bool + //IsSessionTime returns true if the state is in session time IsSessionTime() bool @@ -214,16 +220,6 @@ type sessionState interface { //debugging convenience fmt.Stringer - - SessionStateReader -} - -type SessionStateReader interface { - //IsLoggedOn returns true if state is logged on an in session, false otherwise - IsLoggedOn() bool - - //IsConnected returns true if the state is connected - IsConnected() bool } type inSessionTime struct{} From 053ae7d4a765ab541dc0708c05d68e19fae3b6d0 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Wed, 6 Nov 2024 18:51:18 +0800 Subject: [PATCH 132/139] use enum instead --- in_session.go | 2 +- latent_state.go | 2 +- logon_state.go | 2 +- logout_state.go | 2 +- not_session_time.go | 2 +- resend_state.go | 2 +- session_state.go | 10 ++++++++++ 7 files changed, 16 insertions(+), 6 deletions(-) diff --git a/in_session.go b/in_session.go index 8a50bc50a..b33becb5a 100644 --- a/in_session.go +++ b/in_session.go @@ -9,7 +9,7 @@ import ( type inSession struct{ loggedOn } -func (state inSession) String() string { return "In Session" } +func (state inSession) String() string { return SessionStateInSession } func (state inSession) FixMsgIn(session *session, msg *Message) sessionState { msgType, err := msg.Header.GetBytes(tagMsgType) diff --git a/latent_state.go b/latent_state.go index e6e5bece4..8d35cebf6 100644 --- a/latent_state.go +++ b/latent_state.go @@ -4,7 +4,7 @@ import "github.com/quickfixgo/quickfix/internal" type latentState struct{ inSessionTime } -func (state latentState) String() string { return "Latent State" } +func (state latentState) String() string { return SessionStateLatentState } func (state latentState) IsLoggedOn() bool { return false } func (state latentState) IsConnected() bool { return false } diff --git a/logon_state.go b/logon_state.go index 9e9b20683..ae92fbcf9 100644 --- a/logon_state.go +++ b/logon_state.go @@ -8,7 +8,7 @@ import ( type logonState struct{ connectedNotLoggedOn } -func (s logonState) String() string { return "Logon State" } +func (s logonState) String() string { return SessionStateLogonState } func (s logonState) FixMsgIn(session *session, msg *Message) (nextState sessionState) { msgType, err := msg.Header.GetBytes(tagMsgType) diff --git a/logout_state.go b/logout_state.go index 071512ce1..0383ff702 100644 --- a/logout_state.go +++ b/logout_state.go @@ -4,7 +4,7 @@ import "github.com/quickfixgo/quickfix/internal" type logoutState struct{ connectedNotLoggedOn } -func (state logoutState) String() string { return "Logout State" } +func (state logoutState) String() string { return SessionStateLogoutState } func (state logoutState) FixMsgIn(session *session, msg *Message) (nextState sessionState) { nextState = inSession{}.FixMsgIn(session, msg) diff --git a/not_session_time.go b/not_session_time.go index 2e3b04c3d..5648a6eb2 100644 --- a/not_session_time.go +++ b/not_session_time.go @@ -4,7 +4,7 @@ import "github.com/quickfixgo/quickfix/internal" type notSessionTime struct{ latentState } -func (notSessionTime) String() string { return "Not session time" } +func (notSessionTime) String() string { return SessionStateNotSessionTime } func (notSessionTime) IsSessionTime() bool { return false } func (state notSessionTime) FixMsgIn(session *session, msg *Message) (nextState sessionState) { diff --git a/resend_state.go b/resend_state.go index a89d3f697..c0b64df3f 100644 --- a/resend_state.go +++ b/resend_state.go @@ -9,7 +9,7 @@ type resendState struct { resendRangeEnd int } -func (s resendState) String() string { return "Resend" } +func (s resendState) String() string { return SessionStateResend } func (s resendState) Timeout(session *session, event internal.Event) (nextState sessionState) { nextState = inSession{}.Timeout(session, event) diff --git a/session_state.go b/session_state.go index 03843ecd3..089380fc6 100644 --- a/session_state.go +++ b/session_state.go @@ -193,6 +193,16 @@ func handleStateError(s *session, err error) sessionState { return latentState{} } +const ( + SessionStateUnknown = "Unknown" + SessionStateLatentState = "Latent State" + SessionStateInSession = "In Session" + SessionStateLogonState = "Logon State" + SessionStateLogoutState = "Logout State" + SessionStateNotSessionTime = "Not session time" + SessionStateResend = "Resend" +) + // sessionState is the current state of the session state machine. The session state determines how the session responds to // incoming messages, timeouts, and requests to send application messages. type sessionState interface { From ddb9661c7f437b8cf329a1e832f7f6a92fb832d4 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Wed, 6 Nov 2024 18:52:15 +0800 Subject: [PATCH 133/139] expose SessionState --- initiator.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/initiator.go b/initiator.go index a34244494..8d047a00c 100644 --- a/initiator.go +++ b/initiator.go @@ -71,6 +71,15 @@ func (i *Initiator) IsConnectedAndLoggedOn(sessionID SessionID) bool { return session.IsConnected() && session.IsLoggedOn() } +func (i *Initiator) SessionState(sessionID SessionID) string { + session, ok := i.sessions[sessionID] + if !ok { + return SessionStateUnknown + } + + return session.State.String() +} + // NewInitiator creates and initializes a new Initiator. func NewInitiator(app Application, storeFactory MessageStoreFactory, appSettings *Settings, logFactory LogFactory) (*Initiator, error) { i := &Initiator{ From 9ec2251f4b0488f8e563d6515ca0f7d8ed4c41d7 Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Thu, 7 Nov 2024 19:26:32 +0800 Subject: [PATCH 134/139] init stateMachine when new a session --- session_factory.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/session_factory.go b/session_factory.go index ed31f3ba1..a4b89e48a 100644 --- a/session_factory.go +++ b/session_factory.go @@ -45,7 +45,7 @@ type sessionFactory struct { BuildInitiators bool } -//Creates Session, associates with internal session registry +// Creates Session, associates with internal session registry func (f sessionFactory) createSession( sessionID SessionID, storeFactory MessageStoreFactory, settings *SessionSettings, logFactory LogFactory, application Application, @@ -307,6 +307,8 @@ func (f sessionFactory) newSession( s.messageEvent = make(chan bool, 1) s.admin = make(chan interface{}) s.application = application + s.stateMachine = stateMachine{State: latentState{}} + return } From 8b8c69fdbdc595dd308006bcc6560a52f6888af2 Mon Sep 17 00:00:00 2001 From: Hyde Zhang Date: Tue, 24 Aug 2021 20:31:01 +0100 Subject: [PATCH 135/139] Make use of SocketCAFile config --- tls.go | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/tls.go b/tls.go index 951ac7e87..39cbbfd8a 100644 --- a/tls.go +++ b/tls.go @@ -35,33 +35,36 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) } if !settings.HasSetting(config.SocketPrivateKeyFile) && !settings.HasSetting(config.SocketCertificateFile) { - if allowSkipClientCerts { - tlsConfig = defaultTLSConfig() - tlsConfig.ServerName = serverName - tlsConfig.InsecureSkipVerify = insecureSkipVerify - setMinVersionExplicit(settings, tlsConfig) + if !allowSkipClientCerts { + return } - return - } - - privateKeyFile, err := settings.Setting(config.SocketPrivateKeyFile) - if err != nil { - return - } - - certificateFile, err := settings.Setting(config.SocketCertificateFile) - if err != nil { - return } tlsConfig = defaultTLSConfig() - tlsConfig.Certificates = make([]tls.Certificate, 1) tlsConfig.ServerName = serverName tlsConfig.InsecureSkipVerify = insecureSkipVerify setMinVersionExplicit(settings, tlsConfig) - if tlsConfig.Certificates[0], err = tls.LoadX509KeyPair(certificateFile, privateKeyFile); err != nil { - return + if settings.HasSetting(config.SocketPrivateKeyFile) && settings.HasSetting(config.SocketCertificateFile) { + + var privateKeyFile string + var certificateFile string + + privateKeyFile, err = settings.Setting(config.SocketPrivateKeyFile) + if err != nil { + return + } + + certificateFile, err = settings.Setting(config.SocketCertificateFile) + if err != nil { + return + } + + tlsConfig.Certificates = make([]tls.Certificate, 1) + + if tlsConfig.Certificates[0], err = tls.LoadX509KeyPair(certificateFile, privateKeyFile); err != nil { + return + } } if !settings.HasSetting(config.SocketCAFile) { @@ -86,7 +89,10 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) tlsConfig.RootCAs = certPool tlsConfig.ClientCAs = certPool - tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert + + if !allowSkipClientCerts { + tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert + } return } From 315e9cdf9637d77d11c534fe85b24f2f9c28bda2 Mon Sep 17 00:00:00 2001 From: Hyde Zhang Date: Wed, 8 Sep 2021 11:16:16 +0100 Subject: [PATCH 136/139] Update tls.go load with CA only behaviour - Return error if client key cert file pair incomplete - Add simple test for TLS load with only CA --- tls.go | 2 +- tls_test.go | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/tls.go b/tls.go index 39cbbfd8a..758898885 100644 --- a/tls.go +++ b/tls.go @@ -45,7 +45,7 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) tlsConfig.InsecureSkipVerify = insecureSkipVerify setMinVersionExplicit(settings, tlsConfig) - if settings.HasSetting(config.SocketPrivateKeyFile) && settings.HasSetting(config.SocketCertificateFile) { + if settings.HasSetting(config.SocketPrivateKeyFile) || settings.HasSetting(config.SocketCertificateFile) { var privateKeyFile string var certificateFile string diff --git a/tls_test.go b/tls_test.go index fe6745a19..60629cb6d 100644 --- a/tls_test.go +++ b/tls_test.go @@ -87,6 +87,26 @@ func (s *TLSTestSuite) TestLoadTLSWithCA() { s.Equal(tls.RequireAndVerifyClientCert, tlsConfig.ClientAuth) } +func (s *TLSTestSuite) TestLoadTLSWithOnlyCA() { + s.settings.GlobalSettings().Set(config.SocketUseSSL, "Y") + s.settings.GlobalSettings().Set(config.SocketCAFile, s.CAFile) + + tlsConfig, err := loadTLSConfig(s.settings.GlobalSettings()) + s.Nil(err) + s.NotNil(tlsConfig) + + s.NotNil(tlsConfig.RootCAs) + s.NotNil(tlsConfig.ClientCAs) +} + +func (s *TLSTestSuite) TestLoadTLSWithoutSSLWithOnlyCA() { + s.settings.GlobalSettings().Set(config.SocketCAFile, s.CAFile) + + tlsConfig, err := loadTLSConfig(s.settings.GlobalSettings()) + s.Nil(err) + s.Nil(tlsConfig) +} + func (s *TLSTestSuite) TestServerNameUseSSL() { s.settings.GlobalSettings().Set(config.SocketUseSSL, "Y") s.settings.GlobalSettings().Set(config.SocketServerName, "DummyServerNameUseSSL") From d81e422ffb554e673d075ca6c70f2719693aae30 Mon Sep 17 00:00:00 2001 From: Hyde Zhang Date: Wed, 8 Sep 2021 11:54:18 +0100 Subject: [PATCH 137/139] Require client certs verification when SocketUseSSL N --- tls.go | 8 ++++---- tls_test.go | 12 +++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tls.go b/tls.go index 758898885..e8a541c0b 100644 --- a/tls.go +++ b/tls.go @@ -67,6 +67,10 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) } } + if !allowSkipClientCerts { + tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert + } + if !settings.HasSetting(config.SocketCAFile) { return } @@ -90,10 +94,6 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) tlsConfig.RootCAs = certPool tlsConfig.ClientCAs = certPool - if !allowSkipClientCerts { - tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert - } - return } diff --git a/tls_test.go b/tls_test.go index 60629cb6d..f1f17dfbb 100644 --- a/tls_test.go +++ b/tls_test.go @@ -60,7 +60,7 @@ func (s *TLSTestSuite) TestLoadTLSNoCA() { s.Len(tlsConfig.Certificates, 1) s.Nil(tlsConfig.RootCAs) s.Nil(tlsConfig.ClientCAs) - s.Equal(tls.NoClientCert, tlsConfig.ClientAuth) + s.Equal(tls.RequireAndVerifyClientCert, tlsConfig.ClientAuth) } func (s *TLSTestSuite) TestLoadTLSWithBadCA() { @@ -107,6 +107,16 @@ func (s *TLSTestSuite) TestLoadTLSWithoutSSLWithOnlyCA() { s.Nil(tlsConfig) } +func (s *TLSTestSuite) TestLoadTLSAllowSkipClientCerts() { + s.settings.GlobalSettings().Set(config.SocketUseSSL, "Y") + + tlsConfig, err := loadTLSConfig(s.settings.GlobalSettings()) + s.Nil(err) + s.NotNil(tlsConfig) + + s.Equal(tls.NoClientCert, tlsConfig.ClientAuth) +} + func (s *TLSTestSuite) TestServerNameUseSSL() { s.settings.GlobalSettings().Set(config.SocketUseSSL, "Y") s.settings.GlobalSettings().Set(config.SocketServerName, "DummyServerNameUseSSL") From 1ea7b78f664a94ef8bdeee5435ffb80ba5fbea8f Mon Sep 17 00:00:00 2001 From: Leeeft <877059692@qq.com> Date: Tue, 3 Jun 2025 14:17:16 +0800 Subject: [PATCH 138/139] =?UTF-8?q?=E5=B0=86ioutil.ReadFile=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=B8=BAos.ReadFile=E4=BB=A5=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=AF=BB=E5=8F=96=E6=96=B9=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=BF=AE=E6=AD=A3=E6=B3=A8=E9=87=8A=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tls.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tls.go b/tls.go index e8a541c0b..758915657 100644 --- a/tls.go +++ b/tls.go @@ -4,7 +4,7 @@ import ( "crypto/tls" "crypto/x509" "fmt" - "io/ioutil" + "os" "github.com/quickfixgo/quickfix/config" ) @@ -80,7 +80,7 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) return } - pem, err := ioutil.ReadFile(caFile) + pem, err := os.ReadFile(caFile) if err != nil { return } @@ -97,7 +97,7 @@ func loadTLSConfig(settings *SessionSettings) (tlsConfig *tls.Config, err error) return } -//defaultTLSConfig brought to you by https://github.com/gtank/cryptopasta/ +// defaultTLSConfig brought to you by https://github.com/gtank/cryptopasta/ func defaultTLSConfig() *tls.Config { return &tls.Config{ // Avoids most of the memorably-named TLS attacks From 8420af0282da91d2b8f14358efe82547fb4bf3bb Mon Sep 17 00:00:00 2001 From: jacky Date: Wed, 20 Aug 2025 19:42:58 +0800 Subject: [PATCH 139/139] LongBridge --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcc635229..e1d5c20d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -172,3 +172,5 @@ BUG FIXES ## 0.1.0 (February 21, 2016) * Initial release + +## LongBridge Feature \ No newline at end of file