From 9ea3676888abe242b0fede6baa21cf4737450b78 Mon Sep 17 00:00:00 2001 From: crusader Date: Thu, 23 Nov 2017 16:34:55 +0900 Subject: [PATCH] ing --- config/auth.go | 5 ----- config/config.go | 16 ++++++++++------ config/grpc.go | 6 ------ config/pool.go | 10 ---------- config/redis.go | 6 ------ config/server.go | 12 ------------ config/servlet.go | 6 ------ config/socket.go | 13 ------------- config/websocket.go | 10 ---------- glide.yaml | 1 + 10 files changed, 11 insertions(+), 74 deletions(-) delete mode 100644 config/auth.go delete mode 100644 config/grpc.go delete mode 100644 config/pool.go delete mode 100644 config/redis.go delete mode 100644 config/server.go delete mode 100644 config/servlet.go delete mode 100644 config/socket.go delete mode 100644 config/websocket.go diff --git a/config/auth.go b/config/auth.go deleted file mode 100644 index 186f4ab..0000000 --- a/config/auth.go +++ /dev/null @@ -1,5 +0,0 @@ -package config - -type Auth struct { - SigningKey string `json:"signingKey" yaml:"signingKey" toml:"signingKey"` -} diff --git a/config/config.go b/config/config.go index 2e52862..76e7957 100644 --- a/config/config.go +++ b/config/config.go @@ -1,12 +1,16 @@ package config +import ( + oosc "git.loafle.net/overflow/overflow_server_config" +) + var Config GatewayConfig type GatewayConfig struct { - Server *Server `json:"server" yaml:"server" toml:"server"` - Auth *Auth `json:"auth" yaml:"auth" toml:"auth"` - Websocket *Websocket `json:"websocket" yaml:"websocket" toml:"websocket"` - GRPC *GRPC `json:"gRPC" yaml:"gRPC" toml:"gRPC"` - Redis *Redis `json:"redis" yaml:"redis" toml:"redis"` - Servlets map[string]*Servlet `json:"servlets" yaml:"servlets" toml:"servlets"` + Server *oosc.Server `json:"server" yaml:"server" toml:"server"` + Auth *oosc.Auth `json:"auth" yaml:"auth" toml:"auth"` + Websocket *oosc.Websocket `json:"websocket" yaml:"websocket" toml:"websocket"` + GRPC *oosc.GRPC `json:"gRPC" yaml:"gRPC" toml:"gRPC"` + Redis *oosc.Redis `json:"redis" yaml:"redis" toml:"redis"` + Servlets map[string]*oosc.Servlet `json:"servlets" yaml:"servlets" toml:"servlets"` } diff --git a/config/grpc.go b/config/grpc.go deleted file mode 100644 index 051d629..0000000 --- a/config/grpc.go +++ /dev/null @@ -1,6 +0,0 @@ -package config - -type GRPC struct { - Server - Pool *Pool `json:"pool" yaml:"pool" toml:"pool"` -} diff --git a/config/pool.go b/config/pool.go deleted file mode 100644 index 8daf7df..0000000 --- a/config/pool.go +++ /dev/null @@ -1,10 +0,0 @@ -package config - -import "time" - -type Pool struct { - MaxCapacity int `json:"maxCapacity" yaml:"maxCapacity" toml:"maxCapacity"` - MaxIdle int `json:"maxIdle" yaml:"maxIdle" toml:"maxIdle"` - IdleTimeout time.Duration `json:"idleTimeout" yaml:"idleTimeout" toml:"idleTimeout"` - Wait bool `json:"wait" yaml:"wait" toml:"wait"` -} diff --git a/config/redis.go b/config/redis.go deleted file mode 100644 index 39d96e0..0000000 --- a/config/redis.go +++ /dev/null @@ -1,6 +0,0 @@ -package config - -type Redis struct { - Server - Pool *Pool `json:"pool" yaml:"pool" toml:"pool"` -} diff --git a/config/server.go b/config/server.go deleted file mode 100644 index 45a0649..0000000 --- a/config/server.go +++ /dev/null @@ -1,12 +0,0 @@ -package config - -import "time" - -type Server struct { - Name string `json:"name" yaml:"name" toml:"name"` - Network string `json:"network" yaml:"network" toml:"network"` - Addr string `json:"addr" yaml:"addr" toml:"addr"` - TLS bool `json:"tls" yaml:"tls" toml:"tls"` - Concurrency int `json:"concurrency" yaml:"concurrency" toml:"concurrency"` - MaxStopWaitTime time.Duration `json:"maxStopWaitTime" yaml:"maxStopWaitTime" toml:"maxStopWaitTime"` -} diff --git a/config/servlet.go b/config/servlet.go deleted file mode 100644 index a2c6c92..0000000 --- a/config/servlet.go +++ /dev/null @@ -1,6 +0,0 @@ -package config - -type Servlet struct { - Entry string `json:"entry" yaml:"entry" toml:"entry"` - Socket *Socket `json:"socket" yaml:"socket" toml:"socket"` -} diff --git a/config/socket.go b/config/socket.go deleted file mode 100644 index 74a9f0d..0000000 --- a/config/socket.go +++ /dev/null @@ -1,13 +0,0 @@ -package config - -import "time" - -type Socket struct { - MaxMessageSize int64 `json:"maxMessageSize" yaml:"maxMessageSize" toml:"maxMessageSize"` - WriteTimeout time.Duration `json:"writeTimeout" yaml:"writeTimeout" toml:"writeTimeout"` - ReadTimeout time.Duration `json:"readTimeout" yaml:"readTimeout" toml:"readTimeout"` - PongTimeout time.Duration `json:"pongTimeout" yaml:"pongTimeout" toml:"pongTimeout"` - PingTimeout time.Duration `json:"pingTimeout" yaml:"pingTimeout" toml:"pingTimeout"` - PingPeriod time.Duration `json:"pingPeriod" yaml:"pingPeriod" toml:"pingPeriod"` - BinaryMessage bool `json:"binaryMessage" yaml:"binaryMessage" toml:"binaryMessage"` -} diff --git a/config/websocket.go b/config/websocket.go deleted file mode 100644 index 42a187c..0000000 --- a/config/websocket.go +++ /dev/null @@ -1,10 +0,0 @@ -package config - -import "time" - -type Websocket struct { - HandshakeTimeout time.Duration `json:"handshakeTimeout" yaml:"handshakeTimeout" toml:"handshakeTimeout"` - ReadBufferSize int `json:"readBufferSize" yaml:"readBufferSize" toml:"readBufferSize"` - WriteBufferSize int `json:"writeBufferSize" yaml:"writeBufferSize" toml:"writeBufferSize"` - EnableCompression bool `json:"enableCompression" yaml:"enableCompression" toml:"enableCompression"` -} diff --git a/glide.yaml b/glide.yaml index b50ceb6..ddf48ca 100644 --- a/glide.yaml +++ b/glide.yaml @@ -12,3 +12,4 @@ import: - package: google.golang.org/grpc - package: github.com/valyala/fasthttp version: v20160617 +- package: git.loafle.net/overflow/overflow_server_config