Skip to content

Commit

Permalink
Additional fix dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tolyo committed Dec 18, 2023
1 parent ddc5fbd commit dbb7437
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 10 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ setup:
go install golang.org/x/tools/cmd/goimports@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
go install github.com/pressly/goose/v3/cmd/goose@latest
go install github.com/cosmtrek/air@latest
npm i
go get ./...
(cd api && npm i)

build: ## Installs and compiles dependencies
go build -v ./...

run: ## Start dev mode
make db-up
air main.go
go run main.go

test:
go test ./... -v -cover -p 1
Expand Down
3 changes: 3 additions & 0 deletions api/api.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
INPUT_YAML:="./api/openapi.yaml"
OUTPUT_YAML:="../pkg/static/api.yaml"

install-api:
npm i

bundle-api:
npx @redocly/cli bundle \
$(INPUT_YAML) \
Expand Down
14 changes: 11 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,28 @@ toolchain go1.21.4

require (
github.com/google/uuid v1.3.1
github.com/jmoiron/sqlx v1.3.5
github.com/lib/pq v1.10.9
github.com/pressly/goose/v3 v3.15.0
github.com/quickfixgo/enum v0.1.0
github.com/quickfixgo/field v0.1.0
github.com/quickfixgo/fix40 v0.1.0
github.com/quickfixgo/fix41 v0.1.0
github.com/quickfixgo/fix42 v0.1.0
github.com/quickfixgo/fix43 v0.1.0
github.com/quickfixgo/fix44 v0.1.0
github.com/quickfixgo/fix50 v0.1.0
github.com/quickfixgo/quickfix v0.9.0
github.com/quickfixgo/tag v0.1.0
github.com/shopspring/decimal v1.3.1
github.com/sirupsen/logrus v1.9.3
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
)

require github.com/jmoiron/sqlx v1.3.5

require (
github.com/armon/go-proxyproto v0.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/quickfixgo/quickfix v0.9.0 // indirect
golang.org/x/net v0.19.0 // indirect
)

Expand Down
14 changes: 14 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,22 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/pressly/goose/v3 v3.15.0 h1:6tY5aDqFknY6VZkorFGgZtWygodZQxfmmEF4rqyJW9k=
github.com/pressly/goose/v3 v3.15.0/go.mod h1:LlIo3zGccjb/YUgG+Svdb9Er14vefRdlDI7URCDrwYo=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/quickfixgo/enum v0.1.0 h1:TnCPOqxAWA5/IWp7lsvj97x7oyuHYgj3STBJlBzZGjM=
github.com/quickfixgo/enum v0.1.0/go.mod h1:65gdG2/8vr6uOYcjZBObVHMuTEYc5rr/+aKVWTrFIrQ=
github.com/quickfixgo/field v0.1.0 h1:JVO6fVD6Nkyy8e/ROYQtV/nQhMX/BStD5Lq7XIgYz2g=
github.com/quickfixgo/field v0.1.0/go.mod h1:Zu0qYmpj+gljlB2HgpUt9EcTIThs2lIQb8C57qbJr8o=
github.com/quickfixgo/fix40 v0.1.0 h1:IgxG7RvVnS+bLt5Kt8XFsjE4URcsjS8oPHeA5916hKY=
github.com/quickfixgo/fix40 v0.1.0/go.mod h1:/19Md3bYkm1FbWwcmAmrovVsKUZAd/zLG45WK8WWckg=
github.com/quickfixgo/fix41 v0.1.0/go.mod h1:G3bAiITRccck6UuGHu8FhLywlWWzMI0JhHG7VZxUgAY=
github.com/quickfixgo/fix42 v0.1.0 h1:uFDM1ZylhTCLnDptwvrU6SkKRkDrqShYHHBATz/c1q0=
github.com/quickfixgo/fix42 v0.1.0/go.mod h1:jiZZiS92naJmyhbMd3l8qPUV7ufnwkxUqFqgYBtJOp4=
github.com/quickfixgo/fix43 v0.1.0/go.mod h1:FF2SXSfCd3v+ZNNX/cYwh3CJo3LfCmHAlXldjXY16To=
github.com/quickfixgo/fix44 v0.1.0/go.mod h1:d6Ia02Eq/JYgKCn/2V9FHxguAl1Alp/yu/xVpry82dA=
github.com/quickfixgo/fix50 v0.1.0/go.mod h1:ZxQTqXY1IJnpN0v2CgYTFn3/ffbKsX/fWI31O3pBk9M=
github.com/quickfixgo/quickfix v0.9.0 h1:WshR3GUSxR69ZrSQfppKs2zZ12dTYtU3JUgQg+PAOdA=
github.com/quickfixgo/quickfix v0.9.0/go.mod h1:t5Z881dOZ2Dz5vM6KIbMCx3YpAiFPFf/iCLCSn91Qqo=
github.com/quickfixgo/tag v0.1.0 h1:R2A1Zf7CBE903+mOQlmTlfTmNZQz/yh7HunMbgcsqsA=
github.com/quickfixgo/tag v0.1.0/go.mod h1:l/drB1eO3PwN9JQTDC9Vt2EqOcaXk3kGJ+eeCQljvAI=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
Expand Down
25 changes: 25 additions & 0 deletions pkg/conf/ordermatch.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[DEFAULT]
SocketAcceptPort=5001
SenderCompID=ISLD
TargetCompID=TW
ResetOnLogon=Y
FileLogPath=tmp

[SESSION]
BeginString=FIX.4.0

[SESSION]
BeginString=FIX.4.1

[SESSION]
BeginString=FIX.4.2

[SESSION]
BeginString=FIX.4.3

[SESSION]
BeginString=FIX.4.4

[SESSION]
BeginString=FIXT.1.1
DefaultApplVerID=7
35 changes: 31 additions & 4 deletions pkg/fix/fix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,28 @@ package fix
import (
"fmt"

"github.com/quickfixgo/fix40/neworderlist"
"github.com/quickfixgo/fix42/marketdatarequest"
"github.com/quickfixgo/fix42/newordersingle"
"github.com/quickfixgo/fix42/ordercancelrequest"

"github.com/quickfixgo/quickfix"
log "github.com/sirupsen/logrus"
)

// FixServer implements the main quickfix interface
type FixServer struct{}
type FixServer struct {
*quickfix.MessageRouter
}

func New() *FixServer {
server := &FixServer{}
server.AddRoute(marketdatarequest.Route(server.NewMarketDataReq))
server.AddRoute(newordersingle.Route(server.NewOrder))
server.AddRoute(ordercancelrequest.Route(server.CancelOrder))
server.AddRoute(neworderlist.Route(server.NewOrderList))
return server
}

func (s *FixServer) OnCreate(sessionID quickfix.SessionID) {
log.Println("Session created:", sessionID)
Expand Down Expand Up @@ -41,7 +57,18 @@ func (s *FixServer) FromApp(message quickfix.Message, sessionID quickfix.Session
return quickfix.InvalidMessageType()
}

func New() *FixServer {
server := &FixServer{}
return server
func (s *FixServer) NewOrder(msg newordersingle.NewOrderSingle, id quickfix.SessionID) quickfix.MessageRejectError {
return nil
}

func (s *FixServer) CancelOrder(msg ordercancelrequest.OrderCancelRequest, id quickfix.SessionID) quickfix.MessageRejectError {
return nil
}

func (s *FixServer) NewOrderList(msg neworderlist.NewOrderList, id quickfix.SessionID) quickfix.MessageRejectError {
return nil
}

func (s *FixServer) NewMarketDataReq(msg marketdatarequest.MarketDataRequest, id quickfix.SessionID) quickfix.MessageRejectError {
return nil
}

0 comments on commit dbb7437

Please sign in to comment.