commit 79424c10e4d60a4020876a6bc0bd67e9d670b54e Author: crusader Date: Thu Nov 23 16:31:28 2017 +0900 ing diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3733e36 --- /dev/null +++ b/.gitignore @@ -0,0 +1,68 @@ +# Created by .ignore support plugin (hsz.mobi) +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties +### Go template +# Binaries for programs and plugins +*.exe +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 +.glide/ +.idea/ +*.iml + +vendor/ +glide.lock +.DS_Store +dist/ +debug diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..2ca2b1d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,32 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug", + "type": "go", + "request": "launch", + "mode": "debug", + "remotePath": "", + "port": 2345, + "host": "127.0.0.1", + "program": "${workspaceRoot}/main.go", + "env": {}, + "args": [], + "showLog": true + }, + { + "name": "File Debug", + "type": "go", + "request": "launch", + "mode": "debug", + "remotePath": "", + "port": 2345, + "host": "127.0.0.1", + "program": "${fileDirname}", + "env": {}, + "args": [], + "showLog": true + } + + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..20af2f6 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +// Place your settings in this file to overwrite default and user settings. +{ +} \ No newline at end of file diff --git a/auth.go b/auth.go new file mode 100644 index 0000000..0670d90 --- /dev/null +++ b/auth.go @@ -0,0 +1,5 @@ +package overflow_server_config + +type Auth struct { + SigningKey string `json:"signingKey" yaml:"signingKey" toml:"signingKey"` +} diff --git a/glide.yaml b/glide.yaml new file mode 100644 index 0000000..34e8a27 --- /dev/null +++ b/glide.yaml @@ -0,0 +1,2 @@ +package: git.loafle.net/overflow/overflow_server_config +import: [] diff --git a/grpc.go b/grpc.go new file mode 100644 index 0000000..24f26b7 --- /dev/null +++ b/grpc.go @@ -0,0 +1,6 @@ +package overflow_server_config + +type GRPC struct { + Server + Pool *Pool `json:"pool" yaml:"pool" toml:"pool"` +} diff --git a/pool.go b/pool.go new file mode 100644 index 0000000..ce71259 --- /dev/null +++ b/pool.go @@ -0,0 +1,10 @@ +package overflow_server_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/redis.go b/redis.go new file mode 100644 index 0000000..1801b7e --- /dev/null +++ b/redis.go @@ -0,0 +1,6 @@ +package overflow_server_config + +type Redis struct { + Server + Pool *Pool `json:"pool" yaml:"pool" toml:"pool"` +} diff --git a/server.go b/server.go new file mode 100644 index 0000000..d1c0a10 --- /dev/null +++ b/server.go @@ -0,0 +1,12 @@ +package overflow_server_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/servlet.go b/servlet.go new file mode 100644 index 0000000..448775d --- /dev/null +++ b/servlet.go @@ -0,0 +1,6 @@ +package overflow_server_config + +type Servlet struct { + Entry string `json:"entry" yaml:"entry" toml:"entry"` + Socket *Socket `json:"socket" yaml:"socket" toml:"socket"` +} diff --git a/socket.go b/socket.go new file mode 100644 index 0000000..ae183dd --- /dev/null +++ b/socket.go @@ -0,0 +1,13 @@ +package overflow_server_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/websocket.go b/websocket.go new file mode 100644 index 0000000..fe326a0 --- /dev/null +++ b/websocket.go @@ -0,0 +1,10 @@ +package overflow_server_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"` +}