mirror of
https://github.com/grafana/grafana.git
synced 2025-01-09 23:53:25 -06:00
a2e21eac8c
* fix merge conflicts * make token expiration configurable
29 lines
1.4 KiB
Go
29 lines
1.4 KiB
Go
package setting
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type CloudMigrationSettings struct {
|
|
IsTarget bool
|
|
GcomAPIToken string
|
|
FetchInstanceTimeout time.Duration
|
|
CreateAccessPolicyTimeout time.Duration
|
|
FetchAccessPolicyTimeout time.Duration
|
|
DeleteAccessPolicyTimeout time.Duration
|
|
CreateTokenTimeout time.Duration
|
|
TokenExpiresAfter time.Duration
|
|
}
|
|
|
|
func (cfg *Cfg) readCloudMigrationSettings() {
|
|
cloudMigration := cfg.Raw.Section("cloud_migration")
|
|
cfg.CloudMigration.IsTarget = cloudMigration.Key("is_target").MustBool(false)
|
|
cfg.CloudMigration.GcomAPIToken = cloudMigration.Key("gcom_api_token").MustString("")
|
|
cfg.CloudMigration.FetchInstanceTimeout = cloudMigration.Key("fetch_instance_timeout").MustDuration(5 * time.Second)
|
|
cfg.CloudMigration.CreateAccessPolicyTimeout = cloudMigration.Key("create_access_policy_timeout").MustDuration(5 * time.Second)
|
|
cfg.CloudMigration.FetchAccessPolicyTimeout = cloudMigration.Key("fetch_access_policy_timeout").MustDuration(5 * time.Second)
|
|
cfg.CloudMigration.DeleteAccessPolicyTimeout = cloudMigration.Key("delete_access_policy_timeout").MustDuration(5 * time.Second)
|
|
cfg.CloudMigration.CreateTokenTimeout = cloudMigration.Key("create_token_timeout").MustDuration(5 * time.Second)
|
|
cfg.CloudMigration.TokenExpiresAfter = cloudMigration.Key("token_expires_after").MustDuration(7 * 24 * time.Hour)
|
|
}
|