# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# README
Base Server for Go
Features
- grpc
- http
- long-polling
- socket
How to add config
- json type config file add
- struct add
- see config/Sample.go
- test add
- see Sample_test.go
- example of use
- socketServerConfig of socket-server/main.go
How to use server
- cloudevents
- build
go build -o ./bin/cloudevents-server ./cloudevents-server/
- run
./bin/cloudevents-server -config-file ./config/CloudEventsServer.config
- build
- grpc
- build
go build -o ./bin/grpc-server ./grpc-server/
- run
./bin/grpc-server -config_file ./config/GrpcServer.config
- log
./grpc-server.log
- build
- http
- build
go install github.com/swaggo/swag/cmd/[email protected]
$(go env GOPATH)/bin/swag init --dir ./http-server --output ./http-server/swagger_docs
go build -o ./bin/http-server ./http-server/
- run
./bin/http-server -config_file ./config/HttpServer.config
- log
./http-server.log
- build
- long-polling
- build
go build -o ./bin/long-polling-server ./long-polling-server/
- run
./bin/long-polling-server -config_file ./config/LongPollingServer.config
- log
./long-polling-server.log
- build
- socket
- build
go build -o ./bin/socket-server ./socket-server/
- run
./bin/socket-server -config_file ./config/SocketServer.config
- log
./socket-server.log
- build
Test and Coverage
- Test
go clean -testcache && go test -cover ./...
- Coverage
- make coverage file
go clean -testcache && go test -coverprofile=coverage.out -cover $(go list ./... | grep -v "/swagger_docs")
- convert coverage file to html file
go tool cover -html=./coverage.out -o ./coverage.html
- make coverage file