This commit is contained in:
crusader 2017-11-23 16:34:55 +09:00
parent e17aceb743
commit 9ea3676888
10 changed files with 11 additions and 74 deletions

View File

@ -1,5 +0,0 @@
package config
type Auth struct {
SigningKey string `json:"signingKey" yaml:"signingKey" toml:"signingKey"`
}

View File

@ -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"`
}

View File

@ -1,6 +0,0 @@
package config
type GRPC struct {
Server
Pool *Pool `json:"pool" yaml:"pool" toml:"pool"`
}

View File

@ -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"`
}

View File

@ -1,6 +0,0 @@
package config
type Redis struct {
Server
Pool *Pool `json:"pool" yaml:"pool" toml:"pool"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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