Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ Name: "default", Host: "http://localhost:9999", Active: true, }
DefaultConfig is default config without token
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `toml:"-" json:"-"` Host string `toml:"url" json:"url"` // Token is base64 encoded sequence. Token string `toml:"token" json:"token"` Org string `toml:"org" json:"org"` Active bool `toml:"active,omitempty" json:"active,omitempty"` PreviousActive bool `toml:"previous,omitempty" json:"previous,omitempty"` }
Config store the crendentials of influxdb host and token.
type ConfigsService ¶
type ConfigsService interface { CreateConfig(Config) (Config, error) DeleteConfig(name string) (Config, error) UpdateConfig(Config) (Config, error) SwitchActive(name string) (Config, error) ListConfigs() (Configs, error) }
ConfigsService is the service to list and write configs.
func NewLocalConfigSVC ¶
func NewLocalConfigSVC(Path, Dir string) ConfigsService
NewLocalConfigSVC create a new local config svc.
Click to show internal directories.
Click to hide internal directories.