Documentation
¶
Index ¶
- type CmonInstance
- type Config
- func (cfg *Config) AddController(cmon *CmonInstance, persist bool) error
- func (cfg *Config) AddUser(user *ProxyUser) error
- func (cfg *Config) ControllerByUrl(url string) *CmonInstance
- func (cfg *Config) ControllerUrls() []string
- func (cfg *Config) GetUser(username string) (*ProxyUser, error)
- func (cfg *Config) RemoveController(url string, persist bool) error
- func (cfg *Config) RemoveUser(username string) error
- func (cfg *Config) Save() error
- func (cfg *Config) UpdateUser(user *ProxyUser) error
- type ProxyUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmonInstance ¶
type CmonInstance struct { Url string `yaml:"url" json:"url"` Name string `yaml:"name,omitempty" json:"name,omitempty"` Username string `yaml:"username,omitempty" json:"username,omitempty` Password string `yaml:"password,omitempty" json:"password,omitempty"` Keyfile string `yaml:"keyfile,omitempty" json:"keyfile,omitempty"` FrontendUrl string `yaml:"frontend_url,omitempty" json:"frontend_url,omitempty"` }
func (*CmonInstance) Verify ¶
func (cmon *CmonInstance) Verify() error
type Config ¶
type Config struct { Filename string FetchJobsHours int `yaml:"fetch_jobs_hours,omitempty" json:"fetch_jobs_hours,omitempty"` FetchBackupDays int `yaml:"fetch_backups_days,omitempty" json:"fetch_backups_days,omitempty"` Instances []*CmonInstance `yaml:"instances,omitempty"` Timeout int `yaml:"timeout,omitempty"` Logfile string `yaml:"logfile,omitempty"` Users []*ProxyUser `yaml:"users,omitempty"` FrontendPath string `yaml:"frontend_path,omitempty" json:"frontend_path,omitempty"` Port int `yaml:"port" json:"port"` TlsCert string `yaml:"tls_cert,omitempty" json:"tls_cert,omitempty"` TlsKey string `yaml:"tls_key,omitempty" json:"tls_key,omitempty"` SessionTtl int64 `yaml:"session_ttl" json:"session_ttl"` // contains filtered or unexported fields }
Config holds the configuration of cmon-proxy, it is pretty minimal now
func (*Config) AddController ¶
func (cfg *Config) AddController(cmon *CmonInstance, persist bool) error
AddController adds a controller to the configuration and perists the config
func (*Config) ControllerByUrl ¶
func (cfg *Config) ControllerByUrl(url string) *CmonInstance
ControllerByUrl returns a CmonInstance having the specified url
func (*Config) ControllerUrls ¶
ControllerUrls returns the URLs of the configured controllers
func (*Config) RemoveController ¶
RemoveConroller removes a cmon instance from config file and persists the configuration
func (*Config) RemoveUser ¶
func (*Config) UpdateUser ¶
type ProxyUser ¶
type ProxyUser struct { Username string `yaml:"username,omitempty" json:"username,omitempty"` EmailAddress string `yaml:"email,omitempty" json:"email,omitempty"` PasswordHash string `yaml:"passwordhash,omitempty" json:"passwordhash,omitempty"` FirstName string `yaml:"firstname,omitempty" json:"firstname,omitempty"` LastName string `yaml:"lastname,omitempty" json:"lastname,omitempty"` }
func (*ProxyUser) SetPassword ¶
func (*ProxyUser) ValidatePassword ¶
Click to show internal directories.
Click to hide internal directories.