-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
2,927 additions
and
404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
buf: | ||
buf generate --path=./proto/spec | ||
rm -Rf ./backend/proto | ||
buf generate --path=./proto/ | ||
cd ./backend/proto && go mod init github.com/ueckoken/plarail2023/backend/proto | ||
cd ./backend/proto && go mod tidy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"net/http" | ||
|
||
"github.com/bufbuild/connect-go" | ||
trainv1 "github.com/ueckoken/plarail2023/backend/proto/train/v1" | ||
"github.com/ueckoken/plarail2023/backend/proto/train/v1/trainv1connect" | ||
"golang.org/x/net/http2" | ||
"golang.org/x/net/http2/h2c" | ||
) | ||
|
||
type TrainServer struct{} | ||
|
||
func (s *TrainServer) NotifyTrainArrival( | ||
ctx context.Context, | ||
req *connect.Request[trainv1.NotifyTrainArrivalRequest], | ||
) (*connect.Response[trainv1.NotifyTrainArrivalResponse], error) { | ||
res := connect.NewResponse(&trainv1.NotifyTrainArrivalResponse{ | ||
Success: true, | ||
}) | ||
return res, nil | ||
} | ||
|
||
func main() { | ||
server := &TrainServer{} | ||
mux := http.NewServeMux() | ||
path, handler := trainv1connect.NewTrainServiceHandler(server) | ||
mux.Handle(path, handler) | ||
http.ListenAndServe("localhost:8080", | ||
h2c.NewHandler(mux, &http2.Server{}), | ||
) | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,5 @@ func main() { | |
return | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module github.com/ueckoken/plarail2023/backend/proto | ||
|
||
go 1.21.1 | ||
|
||
require ( | ||
github.com/bufbuild/connect-go v1.10.0 | ||
google.golang.org/protobuf v1.31.0 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
github.com/bufbuild/connect-go v1.10.0 h1:QAJ3G9A1OYQW2Jbk3DeoJbkCxuKArrvZgDt47mjdTbg= | ||
github.com/bufbuild/connect-go v1.10.0/go.mod h1:CAIePUgkDR5pAFaylSMtNK45ANQjp9JvpluG20rhpV8= | ||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= | ||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= | ||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= | ||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= | ||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= | ||
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= | ||
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= |
This file was deleted.
Oops, something went wrong.
107 changes: 0 additions & 107 deletions
107
backend/proto/spec/v1/grpcconnect/virtual_state.connect.go
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.