Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ HTTP: HTTPConfig{ Listen: ":9091", }, HarmonyDB: HarmonyDBConfig{ URL: "postgres://yugabyte:yugabyte@127.0.0.1:5433/curio?search_path=curio", }, Chain: ChainConfig{ APIs: []string{ "token:/ip4/127.0.0.1/tcp/1234/http", }, }, Auth: AuthConfig{ Secret: lo.RandomString(32, lo.LettersCharset), Expires: 24 * 30, Users: []UserConfig{ {Username: "admin", Password: lo.RandomString(24, lo.LettersCharset), Description: "Administrator"}, }, }, Features: FeaturesConfig{ Metrics: MetricsConfig{ Enabled: true, Prometheus: "http://localhost:9090", }, }, Curio: CurioConfig{ APIs: []string{ "http://127.0.0.1:4701", }, }, }
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct { Secret string `toml:"secret" comment:"Secret key for JWT token, default to a random string, keep it confidential"` Expires int `toml:"expires" comment:"Token expiration time in hours, default to 24 hours"` Users []UserConfig `toml:"users" comment:"List of users allow to access the dashboard"` }
type ChainConfig ¶
type ChainConfig struct {
APIs []string `toml:"apis" comment:"List of chain API to connect to"`
}
type Config ¶
type Config struct { HTTP HTTPConfig `toml:"api" comment:"Http configuration"` HarmonyDB HarmonyDBConfig `toml:"harmonydb" comment:"HarmonyDB database configuration"` Chain ChainConfig `toml:"chain" comment:"Chain API configuration"` Curio CurioConfig `toml:"curio" comment:"Curio configuration"` Auth AuthConfig `toml:"auth" comment:"Authentication configuration"` Features FeaturesConfig `toml:"features" comment:"Features configuration"` }
func NewFromFile ¶
type CurioConfig ¶
type CurioConfig struct {
APIs []string `toml:"apis" comment:"List of Curio API to connect to"`
}
type FeaturesConfig ¶
type FeaturesConfig struct {
Metrics MetricsConfig `toml:"metrics" comment:"Metrics configuration"`
}
type HTTPConfig ¶
type HTTPConfig struct {
Listen string `toml:"listen" comment:"Address to listen on for the API server"`
}
type HarmonyDBConfig ¶
type HarmonyDBConfig struct {
URL string `` /* 162-byte string literal not displayed */
}
type MetricsConfig ¶
type UserConfig ¶
Click to show internal directories.
Click to hide internal directories.