Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis 配置信息 #2

Open
narrowizard opened this issue Aug 29, 2017 · 2 comments
Open

redis 配置信息 #2

narrowizard opened this issue Aug 29, 2017 · 2 comments

Comments

@narrowizard
Copy link
Owner

narrowizard commented Aug 29, 2017

通过tinygo的配置项SessionSource来配置redis连接, 有以下两种方案:

  1. 在SessionSource 配置项中指定额外的配置文件
  2. 使用SessionSource 字符串配置redis连接
@narrowizard
Copy link
Owner Author

方案1在指定外部配置文件时, 难以获取到应用的绝对路径.

@narrowizard
Copy link
Owner Author

介于redis连接的配置项并不多, 直接采用json来书写SessionSource配置项, 结构如下:

type redisConfig struct {
	Host        string
	MaxIdle     int
	MaxActive   int
	IdleTimeout int // seconds
	DB          int
	Password    string // not authorize if empty
	Wait        bool
}
{
    "Host": "localhost:6379",
    "MaxIdle": 3,
    "MaxActive": 1,
    "IdleTimeout": 60,
    "Wait": false,
    "DB": 2,
    "Password": ""
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant