Skip to content

Commit

Permalink
Add security board and code to OpenPositionAction (#12)
Browse files Browse the repository at this point in the history
* Add security board and code to OpenPositionAction

* Fix lint
  • Loading branch information
evsamsonov authored Jan 14, 2024
1 parent 7795fa2 commit eb2a4bd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.53.3
version: v1.55.2
25 changes: 21 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
lint:
.PHONY: help lint test doc
.DEFAULT_GOAL := help

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

pre-push: lint test ## Run golang lint and test

lint: ## Run golang lint using docker
go mod download
docker run --rm \
-v ${GOPATH}/pkg/mod:/go/pkg/mod \
-v ${PWD}:/app \
-w /app \
golangci/golangci-lint:v1.53.3 \
golangci/golangci-lint:v1.55.2 \
golangci-lint run -v --modules-download-mode=readonly

test:
GOARCH=amd64 go test ./...
test: ## Run tests
GOARCH=amd64 go test ./...

doc: ## Run doc server using docker
@echo "Doc server runs on http://127.0.0.1:6060"
docker run --rm \
-p 127.0.0.1:6060:6060 \
-v ${PWD}:/go/src/github.com/evsamsonov/trengin \
-w /go/src/github.com/evsamsonov/trengin \
golang:latest \
bash -c "go install golang.org/x/tools/cmd/godoc@latest && /go/bin/godoc -http=:6060"
2 changes: 2 additions & 0 deletions trengin.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ func (p *Position) RangeExtra(f func(key interface{}, val interface{})) {

// OpenPositionAction is an action to open a position
type OpenPositionAction struct {
SecurityBoard string // Trading mode identifier. Example, TQBR
SecurityCode string // Example, SBER
FIGI string // Financial Instrument Global Identifier
Type PositionType
Quantity int64
Expand Down

0 comments on commit eb2a4bd

Please sign in to comment.