Skip to content

Commit

Permalink
modify links: longbridgeapp to longportapp
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfuze committed Nov 23, 2023
2 parents 13ce664 + 307aa33 commit ca993be
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 58 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@

Longbridge Binary Protocol is using for OpenAPI Socket Connection.

[More details](https://open.longbridgeapp.com/docs/socket/protocol/overview)

[More details](https://open.longportapp.com/docs/socket/protocol/overview)

For `Python` and `C++` user, we provide:
- [Python SDK](https://github.com/longbridgeapp/openapi-sdk/tree/master/python)
- [C++ SDK](https://github.com/longbridgeapp/openapi-sdk/tree/master/cpp)
- [Java SDK](https://github.com/longbridgeapp/openapi-sdk/tree/master/java)
- [C SDK](https://github.com/longbridgeapp/openapi-sdk/tree/master/c)
- [Rust SDK](https://github.com/longbridgeapp/openapi-sdk/tree/master/rust)
- [NodeJS SDK](https://github.com/longbridgeapp/openapi-sdk/tree/master/nodejs)

- [Python SDK](https://github.com/longportapp/openapi-sdk/tree/master/python)
- [C++ SDK](https://github.com/longportapp/openapi-sdk/tree/master/cpp)
- [Java SDK](https://github.com/longportapp/openapi-sdk/tree/master/java)
- [C SDK](https://github.com/longportapp/openapi-sdk/tree/master/c)
- [Rust SDK](https://github.com/longportapp/openapi-sdk/tree/master/rust)
- [NodeJS SDK](https://github.com/longportapp/openapi-sdk/tree/master/nodejs)

This repo want to show how to implement Longbridge Binary Protocol.

If you are `Gopher`, you can use the golang implementation to connect our socket gateway.

## Golang Implementation

Check code [here](https://github.com/longbridgeapp/openapi-protocol/tree/main/go).
Check code [here](https://github.com/longportapp/openapi-protocol/tree/main/go).

code structure:

- go - protocol definations
- go/client - client sample code
- go/v1 - protocol version 1 implement
- go/v2 - protocol version 2 implement

Example is [here](https://github.com/longbridgeapp/openapi-protocol/tree/main/examples/go)

Example is [here](https://github.com/longportapp/openapi-protocol/tree/main/examples/go)
3 changes: 1 addition & 2 deletions examples/go/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Golang example

Before run the example code, your should get the [socket token](https://open.longbridgeapp.com/en/docs/socket-token-api) first.

Before run the example code, your should get the [socket token](https://open.longportapp.com/en/docs/socket-token-api) first.

## run quote example

Expand Down
9 changes: 7 additions & 2 deletions examples/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ module main

go 1.18

require github.com/longbridgeapp/openapi-protobufs/gen/go v0.1.0
require (
github.com/longportapp/openapi-protobufs/gen/go v0.2.1
github.com/longportapp/openapi-protocol/go v0.3.0
)

require (
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
github.com/Allenxuxu/ringbuffer v0.0.11 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
)
18 changes: 16 additions & 2 deletions examples/go/go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
github.com/Allenxuxu/ringbuffer v0.0.11 h1:51J/QakUlldfRBeKFAy81PD0IunxOQehvoBG/EvWT7k=
github.com/Allenxuxu/ringbuffer v0.0.11/go.mod h1:F2Ela+/miJmKYwnXr3X0+spOmSEwL/iFAEzeUJ4SFMI=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
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/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/longbridgeapp/openapi-protobufs/gen/go v0.1.0 h1:XcVuCxnXw0rc5tzo529j5k2djXTBvoxpkEjRQkAgODo=
github.com/longbridgeapp/openapi-protobufs/gen/go v0.1.0/go.mod h1:G2qnmuH14s0RXrACedFqShRFQFVMDGrOlo0rPEjtoDQ=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/longbridgeapp/assert v0.1.0 h1:KkQlHUJSpuUFkUDjwBJgghFl31+wwSDHTq/WRrvLjko=
github.com/longportapp/openapi-protobufs/gen/go v0.2.1 h1:AaubbUBGkawGYR4+XMorOIHr9Drte2CZBwjEKp6C1mU=
github.com/longportapp/openapi-protobufs/gen/go v0.2.1/go.mod h1:/chiEwEW4CnOVgKTaCf8rQUwes00Ku8q1CvRpOueWfo=
github.com/longportapp/openapi-protocol/go v0.3.0 h1:Zv8YEkmkmbdZvbExunR5tHI8/DvjmidNK4vLy5ZHvUY=
github.com/longportapp/openapi-protocol/go v0.3.0/go.mod h1:bO8FSq+4Iyg1UPZ5zoBS8V5xgSVXl0gA+Iw5nhWGpdo=
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/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
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=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
8 changes: 4 additions & 4 deletions examples/go/quote/example_quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"flag"
"log"

quote "github.com/longbridgeapp/openapi-protobufs/gen/go/quote"
protocol "github.com/longbridgeapp/openapi-protocol/go"
"github.com/longbridgeapp/openapi-protocol/go/client"
_ "github.com/longbridgeapp/openapi-protocol/go/v1"
quote "github.com/longportapp/openapi-protobufs/gen/go/quote"
protocol "github.com/longportapp/openapi-protocol/go"
"github.com/longportapp/openapi-protocol/go/client"
_ "github.com/longportapp/openapi-protocol/go/v1"
)

func main() {
Expand Down
8 changes: 4 additions & 4 deletions examples/go/trade/example_trade.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"flag"
"log"

trade "github.com/longbridgeapp/openapi-protobufs/gen/go/trade"
trade "github.com/longportapp/openapi-protobufs/gen/go/trade"

protocol "github.com/longbridgeapp/openapi-protocol/go"
"github.com/longbridgeapp/openapi-protocol/go/client"
_ "github.com/longbridgeapp/openapi-protocol/go/v1"
protocol "github.com/longportapp/openapi-protocol/go"
"github.com/longportapp/openapi-protocol/go/client"
_ "github.com/longportapp/openapi-protocol/go/v1"
)

func main() {
Expand Down
33 changes: 1 addition & 32 deletions go.work.sum
Original file line number Diff line number Diff line change
@@ -1,32 +1 @@
github.com/Allenxuxu/ringbuffer v0.0.11 h1:51J/QakUlldfRBeKFAy81PD0IunxOQehvoBG/EvWT7k=
github.com/Allenxuxu/ringbuffer v0.0.11/go.mod h1:F2Ela+/miJmKYwnXr3X0+spOmSEwL/iFAEzeUJ4SFMI=
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/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
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/longbridgeapp/assert v0.1.0 h1:KkQlHUJSpuUFkUDjwBJgghFl31+wwSDHTq/WRrvLjko=
github.com/longbridgeapp/assert v0.1.0/go.mod h1:ew3umReliXtk1bBG4weVURxdvR0tsN+rCEfjnA4YfxI=
github.com/longportapp/openapi-protobufs/gen/go v0.2.1 h1:AaubbUBGkawGYR4+XMorOIHr9Drte2CZBwjEKp6C1mU=
github.com/longportapp/openapi-protobufs/gen/go v0.2.1/go.mod h1:/chiEwEW4CnOVgKTaCf8rQUwes00Ku8q1CvRpOueWfo=
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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
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/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
github.com/longportapp/openapi-protocol/go v0.3.0/go.mod h1:bO8FSq+4Iyg1UPZ5zoBS8V5xgSVXl0gA+Iw5nhWGpdo=
2 changes: 1 addition & 1 deletion go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Usage

Show in [example/go](https://github.com/longbridgeapp/openapi-protocol/tree/main/examples/go)
Show in [example/go](https://github.com/longportapp/openapi-protocol/tree/main/examples/go)

0 comments on commit ca993be

Please sign in to comment.