Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ Name: "default", Host: "http://localhost:8086", Active: true, }
DefaultConfig is default config without token
Functions ¶
func DefaultPath ¶
DefaultPath computes the path where CLI configs will be stored if not overridden.
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"`
Cookie string `toml:"cookie,omitempty" json:"cookie,omitempty"`
}
Config store the crendentials of influxdb host and token.
type Service ¶
type Service interface {
CreateConfig(Config) (Config, error)
DeleteConfig(name string) (Config, error)
UpdateConfig(Config) (Config, error)
SwitchActive(name string) (Config, error)
Active() (Config, error)
ListConfigs() (Configs, error)
}
Service is the service to list and write configs.
func NewLocalConfigService ¶
NewLocalConfigService creates a new service that can write and parse configs to/from a path on local disk.
Click to show internal directories.
Click to hide internal directories.