Documentation ¶
Index ¶
- type Authentication
- type Config
- func (c *Config) AddHook(tableName, hookType, content string) error
- func (c *Config) ChangeVersion(id int) error
- func (c *Config) CheckSum() (string, error)
- func (c *Config) DB(dbName string) *gorm.DB
- func (c *Config) DBs() map[string]*gorm.DB
- func (c *Config) UpdateConfig(cfg *Config) error
- func (c *Config) UpdateConfigFromAgent() error
- func (c *Config) UpdateConfigFromAgentConfig(agentCfg *agentConfig.Config) error
- func (c *Config) UpdateDB() error
- type Querier
- type Reader
- type ReaderWriterQuerier
- type Version
- type Wrapper
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authentication ¶
type Authentication struct {
SerectKey string `yaml:"secret_key" json:"secret_key"`
}
Authentication use to authenticate
type Config ¶
type Config struct { SerectKey string `yaml:"agent_serect_key"` AgentURL string `yaml:"agent_url"` PersistenceSupport string `yaml:"persistence_support"` PersistenceFileName string `yaml:"persistence_file_name"` database.ConnectionInfo `yaml:"-"` Databases []database.Database `yaml:"-" json:"databases_list,omitempty"` ModelMap map[string]map[string]database.Model `yaml:"-" json:"-"` Version Version `yaml:"-" json:"version"` Authentication *Authentication `yaml:"authentication" json:"authentication"` sync.Mutex `yaml:"-"` // contains filtered or unexported fields }
Config contain config for dashboard
func (*Config) ChangeVersion ¶
ChangeVersion get config in persistent by version number
func (*Config) UpdateConfig ¶
UpdateConfig update configuration
func (*Config) UpdateConfigFromAgent ¶
UpdateConfigFromAgent update configuration from agent
func (*Config) UpdateConfigFromAgentConfig ¶
func (c *Config) UpdateConfigFromAgentConfig(agentCfg *agentConfig.Config) error
UpdateConfigFromAgentConfig update config from AgentConfig
type ReaderWriterQuerier ¶
ReaderWriterQuerier compose interface for read/write/query config for agent
func NewBoltPersistent ¶
func NewBoltPersistent(persistenceFileName string, versionID int) ReaderWriterQuerier
NewBoltPersistent Peristent Bolt
type Version ¶
type Version struct { Checksum string `json:"checksum"` ID int `json:"id"` SyncAt time.Time `json:"sync_at"` }
Version version of backend config
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper use to hide detail of a config
func (*Wrapper) SyncConfig ¶
SyncConfig get synchronized config from wrapper
Click to show internal directories.
Click to hide internal directories.