Configuration for creating a new caskin service instance.
{
"default_superadmin_domain_name": "",
"default_superadmin_role_name": "",
"db": {},
"dictionary": {},
"watcher": {},
}default_superadmin_domain_name (optional) is a string for setting superadmin domain name. The default value is "superadmin_domain"
{
"default_superadmin_domain_name": "超级管理域"
}default_superadmin_role_name (optional) is a string for setting superadmin role name. The default value is "superadmin_role"
{
"default_superadmin_role_name": "超级管理员"
}db (required) is a structure for defining caskin and caskin metadata database client.
dsnis the path to database.typeis the type of database.
| type | dsn relate package version |
|---|---|
sqlite |
gorm.io/driver/sqlite v1.3.6 |
mysql |
gorm.io/driver/mysql v1.3.6 |
postgres |
gorm.io/driver/postgres v1.3.6 |
{
"db": {
"dsn": "./sqlite.db",
"type": "sqlite"
}
}dictionary (required) is the option for loading Dictionary configuration.
dsnis the path to load dictionary configuration.typeis dictionary adaptor type.
| adaptor type | description |
|---|---|
|
default type is FILE |
FILE |
load dictionary configuration from file |
{
"dictionary": {
"dsn": "caskin.toml",
"type": "FILE"
}
}watcher (optional) is an option for setting to keep consistence between multiple caskin enforcer instances.
type(required) is the type of watcher.address(optional) is the address of watcher.password(optional) is the password of watcher.channel(optional) is the channel key of watcher.auto_load(optional) is an autoload time interval setting whentypeis default.
| type | description |
|---|---|
|
default type is no watcher. |
redis |
redis watcher. |
{
"watcher": {
"type": "redis",
"address": "localhost:6379",
"password": "",
"channel": "caskin",
"auto_load": 0
}
}