Commit baf7f429 authored by tsuchinaga's avatar tsuchinaga
Browse files

信用注文一覧と信用ポジション一覧に対応

parent 5fe3c462
Pipeline #365983294 passed with stage
in 1 minute and 32 seconds
......@@ -3,8 +3,11 @@ module gitlab.com/tsuchinaga/kabus-grpc-server
go 1.16
require (
github.com/google/uuid v1.3.0 // indirect
gitlab.com/tsuchinaga/go-kabusapi v1.4.0
gitlab.com/tsuchinaga/kabus-virtual-security v0.0.6
google.golang.org/grpc v1.36.0
google.golang.org/protobuf v1.26.0
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 // indirect
google.golang.org/grpc v1.40.0
google.golang.org/protobuf v1.27.1
)
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=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
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/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
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.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/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.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=
......@@ -19,8 +29,10 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W
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.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4=
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/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=
......@@ -29,58 +41,93 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
github.com/google/uuid v1.2.0/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/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
gitlab.com/tsuchinaga/go-kabusapi v1.4.0 h1:6ofLOAIb2EGTVlIoOq0zroCGG3NFT80C1x0NSXplFzU=
gitlab.com/tsuchinaga/go-kabusapi v1.4.0/go.mod h1:yrhgbJRW5L/SaQorC/9Eo8o6KpCimnUf6DcVOukDzJk=
gitlab.com/tsuchinaga/kabus-virtual-security v0.0.6 h1:x9MzYswNzYLKHwJRjt6rqv39xhgsRWmgrpc1WuciOJo=
gitlab.com/tsuchinaga/kabus-virtual-security v0.0.6/go.mod h1:VEGdjtnIFeHZlPMyDj/9JbacELv1ScpnzxqR2mPpYEk=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
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=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
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-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
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-20190108225652-1e06a53dbb7e/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-20200813134508-3edf25e44fcc h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
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-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/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 h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/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-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
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.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/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-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-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
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 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
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/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 h1:3V2dxSZpz4zozWWUq36vUxXEKnSYitEH2LdsAx+RUmg=
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
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.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.36.0 h1:o1bcQ6imQMIOpdrO3SWf2z5RV72WbDwdXuK0MDlc8As=
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.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q=
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
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=
......@@ -91,9 +138,11 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
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 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
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=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
......@@ -55,13 +55,16 @@ func fromOrderResult(res *vs.OrderResult) *kabuspb.OrderResponse {
}
func fromStockOrders(res []*vs.StockOrder) *kabuspb.Orders {
orders := make([]*kabuspb.Order, len(res))
orders := make([]*kabuspb.Order, 0)
if res == nil {
return &kabuspb.Orders{Orders: orders}
}
for i, o := range res {
orders[i] = &kabuspb.Order{
for _, o := range res {
if o == nil {
continue
}
orders = append(orders, &kabuspb.Order{
Id: o.Code,
State: fromOrderStatusToState(o.OrderStatus),
OrderState: fromOrderStatusToOrderState(o.OrderStatus),
......@@ -82,7 +85,7 @@ func fromStockOrders(res []*vs.StockOrder) *kabuspb.Orders {
ExpireDay: timestamppb.New(o.ExpiredAt),
MarginTradeType: kabuspb.MarginTradeType_MARGIN_TRADE_TYPE_UNSPECIFIED,
Details: fromContracts(o.Contracts),
}
})
}
return &kabuspb.Orders{
......@@ -91,13 +94,16 @@ func fromStockOrders(res []*vs.StockOrder) *kabuspb.Orders {
}
func fromStockPositions(res []*vs.StockPosition) *kabuspb.Positions {
positions := make([]*kabuspb.Position, len(res))
positions := make([]*kabuspb.Position, 0)
if res == nil {
return &kabuspb.Positions{Positions: positions}
}
for i, p := range res {
positions[i] = &kabuspb.Position{
for _, p := range res {
if p == nil {
continue
}
positions = append(positions, &kabuspb.Position{
ExecutionId: p.Code,
AccountType: kabuspb.AccountType_ACCOUNT_TYPE_UNSPECIFIED,
SymbolCode: p.SymbolCode,
......@@ -119,7 +125,7 @@ func fromStockPositions(res []*vs.StockPosition) *kabuspb.Positions {
Valuation: 0, // TODO 必要なら
ProfitLoss: 0, // TODO 必要なら
ProfitLossRate: 0, // TODO 必要なら
}
})
}
return &kabuspb.Positions{Positions: positions}
......@@ -381,3 +387,91 @@ func toExitPositionList(closePositions []*kabuspb.ClosePosition) []vs.ExitPositi
return res
}
func fromMarginOrders(res []*vs.MarginOrder) *kabuspb.Orders {
orders := make([]*kabuspb.Order, 0)
if res == nil {
return &kabuspb.Orders{Orders: orders}
}
for _, o := range res {
if o == nil {
continue
}
orders = append(orders, &kabuspb.Order{
Id: o.Code,
State: fromOrderStatusToState(o.OrderStatus),
OrderState: fromOrderStatusToOrderState(o.OrderStatus),
OrderType: fromStockExecutionCondition(o.ExecutionCondition),
ReceiveTime: timestamppb.New(o.OrderedAt),
SymbolCode: o.SymbolCode,
SymbolName: "", // TODO 必要なら
Exchange: kabuspb.OrderExchange_ORDER_EXCHANGE_UNSPECIFIED, // TODO 必要なら
ExchangeName: "", // TODO 必要なら
TimeInForce: kabuspb.TimeInForce_TIME_IN_FORCE_UNSPECIFIED,
Price: o.LimitPrice,
OrderQuantity: o.OrderQuantity,
CumulativeQuantity: o.ContractedQuantity,
Side: fromSide(o.Side),
TradeType: fromTradeType(o.TradeType),
AccountType: kabuspb.AccountType_ACCOUNT_TYPE_UNSPECIFIED,
DeliveryType: kabuspb.DeliveryType_DELIVERY_TYPE_UNSPECIFIED,
ExpireDay: timestamppb.New(o.ExpiredAt),
MarginTradeType: kabuspb.MarginTradeType_MARGIN_TRADE_TYPE_UNSPECIFIED,
Details: fromContracts(o.Contracts),
})
}
return &kabuspb.Orders{
Orders: orders,
}
}
func fromTradeType(tradeType vs.TradeType) kabuspb.TradeType {
switch tradeType {
case vs.TradeTypeEntry:
return kabuspb.TradeType_TRADE_TYPE_ENTRY
case vs.TradeTypeExit:
return kabuspb.TradeType_TRADE_TYPE_EXIT
}
return kabuspb.TradeType_TRADE_TYPE_UNSPECIFIED
}
func fromMarginPositions(res []*vs.MarginPosition) *kabuspb.Positions {
positions := make([]*kabuspb.Position, 0)
if res == nil {
return &kabuspb.Positions{Positions: positions}
}
for _, p := range res {
if p == nil {
continue
}
positions = append(positions, &kabuspb.Position{
ExecutionId: p.Code,
AccountType: kabuspb.AccountType_ACCOUNT_TYPE_UNSPECIFIED,
SymbolCode: p.SymbolCode,
SymbolName: "", // TODO 必要なら
Exchange: kabuspb.Exchange_EXCHANGE_UNSPECIFIED, // TODO 必要なら
ExchangeName: "", // TODO 必要なら
SecurityType: kabuspb.SecurityType_SECURITY_TYPE_UNSPECIFIED,
ExecutionDay: timestamppb.New(p.ContractedAt),
Price: p.Price,
LeavesQuantity: p.OwnedQuantity,
HoldQuantity: p.HoldQuantity,
Side: fromSide(p.Side),
Expenses: 0,
Commission: 0,
CommissionTax: 0,
ExpireDay: nil,
MarginTradeType: kabuspb.MarginTradeType_MARGIN_TRADE_TYPE_UNSPECIFIED,
CurrentPrice: 0, // TODO 必要なら
Valuation: 0, // TODO 必要なら
ProfitLoss: 0, // TODO 必要なら
ProfitLossRate: 0, // TODO 必要なら
})
}
return &kabuspb.Positions{Positions: positions}
}
......@@ -487,6 +487,7 @@ func Test_fromStockOrders(t *testing.T) {
}{
{name: "nilなら空配列を返す", arg: nil, want: &kabuspb.Orders{Orders: []*kabuspb.Order{}}},
{name: "空配列でも空配列を返す", arg: []*vs.StockOrder{}, want: &kabuspb.Orders{Orders: []*kabuspb.Order{}}},
{name: "要素がnilならスキップする", arg: []*vs.StockOrder{nil, nil, nil}, want: &kabuspb.Orders{Orders: []*kabuspb.Order{}}},
{name: "各要素を対応付けて返す",
arg: []*vs.StockOrder{
{
......@@ -554,6 +555,7 @@ func Test_fromStockPositions(t *testing.T) {
}{
{name: "nilなら空配列を返す", arg: nil, want: &kabuspb.Positions{Positions: []*kabuspb.Position{}}},
{name: "空配列でも空配列を返す", arg: []*vs.StockPosition{}, want: &kabuspb.Positions{Positions: []*kabuspb.Position{}}},
{name: "各要素がnilならスキップする", arg: []*vs.StockPosition{nil, nil, nil}, want: &kabuspb.Positions{Positions: []*kabuspb.Position{}}},
{name: "各要素を対応付けて返す",
arg: []*vs.StockPosition{
{
......@@ -886,3 +888,160 @@ func Test_toMarginOrderRequest(t *testing.T) {
})
}
}
func Test_fromMarginOrders(t *testing.T) {
t.Parallel()
tests := []struct {
name string
arg []*vs.MarginOrder
want *kabuspb.Orders
}{
{name: "nilなら空配列を返す", arg: nil, want: &kabuspb.Orders{Orders: []*kabuspb.Order{}}},
{name: "空配列でも空配列を返す", arg: []*vs.MarginOrder{}, want: &kabuspb.Orders{Orders: []*kabuspb.Order{}}},
{name: "要素がnilならスキップする", arg: []*vs.MarginOrder{nil, nil, nil}, want: &kabuspb.Orders{Orders: []*kabuspb.Order{}}},
{name: "各要素を対応付けて返す",
arg: []*vs.MarginOrder{
{
Code: "mor-1234",
OrderStatus: vs.OrderStatusDone,
TradeType: vs.TradeTypeEntry,
Side: vs.SideBuy,
ExecutionCondition: vs.StockExecutionConditionMO,
SymbolCode: "1234",
OrderQuantity: 100,
ContractedQuantity: 100,
CanceledQuantity: 0,
LimitPrice: 0,
ExpiredAt: time.Date(2021, 7, 16, 0, 0, 0, 0, time.Local),
StopCondition: nil,
OrderedAt: time.Date(2021, 7, 16, 9, 0, 0, 0, time.Local),
CanceledAt: time.Time{},
Contracts: []*vs.Contract{},
Message: "",
},
},
want: &kabuspb.Orders{Orders: []*kabuspb.Order{
{
Id: "mor-1234",
State: kabuspb.State_STATE_DONE,
OrderState: kabuspb.OrderState_ORDER_STATE_DONE,
OrderType: kabuspb.OrderType_ORDER_TYPE_ZARABA,
ReceiveTime: timestamppb.New(time.Date(2021, 7, 16, 9, 0, 0, 0, time.Local)),
SymbolCode: "1234",
SymbolName: "",
Exchange: 0,
ExchangeName: "",
TimeInForce: kabuspb.TimeInForce_TIME_IN_FORCE_UNSPECIFIED,
Price: 0,
OrderQuantity: 100,
CumulativeQuantity: 100,
Side: kabuspb.Side_SIDE_BUY,
TradeType: kabuspb.TradeType_TRADE_TYPE_ENTRY,
AccountType: kabuspb.AccountType_ACCOUNT_TYPE_UNSPECIFIED,
DeliveryType: kabuspb.DeliveryType_DELIVERY_TYPE_UNSPECIFIED,
ExpireDay: timestamppb.New(time.Date(2021, 7, 16, 0, 0, 0, 0, time.Local)),
MarginTradeType: kabuspb.MarginTradeType_MARGIN_TRADE_TYPE_UNSPECIFIED,
Details: []*kabuspb.OrderDetail{},
},
}}},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
got := fromMarginOrders(test.arg)
if !reflect.DeepEqual(test.want, got) {
t.Errorf("%s error\nwant: %+v\ngot: %+v\n", t.Name(), test.want, got)
}
})
}
}
func Test_fromTradeType(t *testing.T) {
t.Parallel()
tests := []struct {
name string
arg vs.TradeType
want kabuspb.TradeType
}{
{name: "未指定 を変換できる", arg: vs.TradeTypeUnspecified, want: kabuspb.TradeType_TRADE_TYPE_UNSPECIFIED},
{name: "買い を変換できる", arg: vs.TradeTypeEntry, want: kabuspb.TradeType_TRADE_TYPE_ENTRY},
{name: "売り を変換できる", arg: vs.TradeTypeExit, want: kabuspb.TradeType_TRADE_TYPE_EXIT},
{name: "未定義 を変換できる", arg: vs.TradeType("foo"), want: kabuspb.TradeType_TRADE_TYPE_UNSPECIFIED},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
got := fromTradeType(test.arg)
if !reflect.DeepEqual(test.want, got) {
t.Errorf("%s error\nwant: %+v\ngot: %+v\n", t.Name(), test.want, got)
}
})
}
}
func Test_fromMarginPositions(t *testing.T) {
t.Parallel()
tests := []struct {
name string
arg []*vs.MarginPosition
want *kabuspb.Positions
}{
{name: "nilなら空配列を返す", arg: nil, want: &kabuspb.Positions{Positions: []*kabuspb.Position{}}},
{name: "空配列でも空配列を返す", arg: []*vs.MarginPosition{}, want: &kabuspb.Positions{Positions: []*kabuspb.Position{}}},
{name: "各要素がnilならスキップする", arg: []*vs.MarginPosition{nil, nil, nil}, want: &kabuspb.Positions{Positions: []*kabuspb.Position{}}},
{name: "各要素を対応付けて返す",
arg: []*vs.MarginPosition{
{
Code: "spo-1234",
OrderCode: "sor-234",
SymbolCode: "1234",
Side: vs.SideBuy,
ContractedQuantity: 300,
OwnedQuantity: 300,
HoldQuantity: 100,
Price: 1000,
ContractedAt: time.Date(2021, 7, 16, 14, 0, 0, 0, time.Local),
},
},
want: &kabuspb.Positions{Positions: []*kabuspb.Position{
{
ExecutionId: "spo-1234",
AccountType: kabuspb.AccountType_ACCOUNT_TYPE_UNSPECIFIED,
SymbolCode: "1234",
SymbolName: "",
Exchange: 0,
ExchangeName: "",
SecurityType: kabuspb.SecurityType_SECURITY_TYPE_UNSPECIFIED,
ExecutionDay: timestamppb.New(time.Date(2021, 7, 16, 14, 0, 0, 0, time.Local)),
Price: 1000,
LeavesQuantity: 300,
HoldQuantity: 100,
Side: kabuspb.Side_SIDE_BUY,
Expenses: 0,
Commission: 0,
CommissionTax: 0,
ExpireDay: nil,
MarginTradeType: 0,
CurrentPrice: 0,
Valuation: 0,
ProfitLoss: 0,
ProfitLossRate: 0,
},
}}},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
got := fromMarginPositions(test.arg)
if !reflect.DeepEqual(test.want, got) {
t.Errorf("%s error\nwant: %+v\ngot: %+v\n", t.Name(), test.want, got)
}
})
}
}
......@@ -33,20 +33,60 @@ func (s *security) SendOrderMargin(_ context.Context, _ string, req *kabuspb.Sen
return fromOrderResult(res), nil
}
func (s *security) Orders(_ context.Context, _ string, _ *kabuspb.GetOrdersRequest) (*kabuspb.Orders, error) {
res, err := s.virtual.StockOrders()
if err != nil {
return nil, err
func (s *security) Orders(_ context.Context, _ string, req *kabuspb.GetOrdersRequest) (*kabuspb.Orders, error) {
res := make([]*kabuspb.Order, 0)
if req.Product == kabuspb.Product_PRODUCT_ALL || req.Product == kabuspb.Product_PRODUCT_STOCK {
stockOrders, err := s.virtual.StockOrders()
if err != nil {
return nil, err
}
orders := fromStockOrders(stockOrders)
for _, o := range orders.Orders {
res = append(res, o)
}
}
return fromStockOrders(res), nil
if req.Product == kabuspb.Product_PRODUCT_ALL || req.Product == kabuspb.Product_PRODUCT_MARGIN {
marginOrders, err := s.virtual.MarginOrders()
if err != nil {
return nil, err
}
orders := fromMarginOrders(marginOrders)
for _, o := range orders.Orders {
res = append(res, o)
}
}
return &kabuspb.Orders{Orders: res}, nil
}
func (s *security) Positions(_ context.Context, _ string, _ *kabuspb.GetPositionsRequest) (*kabuspb.Positions, error) {
res, err := s.virtual.StockPositions()
if err != nil {
return nil, err
func (s *security) Positions(_ context.Context, _ string, req *kabuspb.GetPositionsRequest) (*kabuspb.Positions, error) {
res := make([]*kabuspb.Position, 0)
if req.Product == kabuspb.Product_PRODUCT_ALL || req.Product == kabuspb.Product_PRODUCT_STOCK {
stockPositions, err := s.virtual.StockPositions()
if err != nil {
return nil, err
}
positions := fromStockPositions(stockPositions)
for _, p := range positions.Positions {
res = append(res, p)
}
}
return fromStockPositions(res), nil
if req.Product == kabuspb.Product_PRODUCT_ALL || req.Product == kabuspb.Product_PRODUCT_MARGIN {
marginPositions, err := s.virtual.MarginPositions()
if err != nil {
return nil, err
}
positions := fromMarginPositions(marginPositions)
for _, p := range positions.Positions {
res = append(res, p)
}
}
return &kabuspb.Positions{Positions: res}, nil
}
func (s *security) SendPrice(_ context.Context, req *kabuspb.Board) error {
......
......@@ -16,27 +16,54 @@ import (
type testVirtualSecurity struct {
vs.VirtualSecurity
stockOrder1 *vs.OrderResult
stockOrder2 error
stockOrders1 []*vs.StockOrder
stockOrders2 error
stockPositions1 []*vs.StockPosition
stockPositions2 error
registerPrice1 error
stockOrder1 *vs.OrderResult
stockOrder2 error