Documentation
¶
Index ¶
- func Connect(conf *DatabaseConfig) (*gorm.DB, error)
- func EnsureDatabaseExists(cnf *DatabaseConfig) error
- type Data
- type DatabaseConfig
- type Service
- func (ss *Service) DeleteEntry(appName, scope, name string) error
- func (ss *Service) GetCurrentVersion(appName, scope string) (int64, error)
- func (ss *Service) GetEntries(appName string, scope string) (map[string]interface{}, error)
- func (ss *Service) GetEntry(appName, scope, name string) (interface{}, error)
- func (ss *Service) GetLatestVersion(appName, scope string) (int64, error)
- func (ss *Service) ListAppNames() ([]string, error)
- func (ss *Service) ListEntries(appName, scope string) ([]string, error)
- func (ss *Service) Read(appName, scope string) error
- func (ss *Service) SetEntries(appName string, scope string, values map[string]interface{}) error
- func (ss *Service) SetEntry(appName, scope, name string, value interface{}) error
- func (ss *Service) Write(appName, scope string) error
- type TableNameReplaceable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDatabaseExists ¶
func EnsureDatabaseExists(cnf *DatabaseConfig) error
Types ¶
type DatabaseConfig ¶
type DatabaseConfig struct { Driver string `yaml:"driver" env:"KAIGARA_DATABASE_DRIVER" env-description:"Database driver"` Host string `yaml:"host" env:"KAIGARA_DATABASE_HOST" env-description:"Database host"` Port string `yaml:"port" env:"KAIGARA_DATABASE_PORT" env-description:"Database port"` Name string `yaml:"name" env:"KAIGARA_DATABASE_NAME" env-description:"Database name"` Schema string `yaml:"schema" env:"KAIGARA_DATABASE_SCHEMA" env-description:"Database schema"` Table TableNameReplaceable `yaml:"table" env:"KAIGARA_DATABASE_TABLE" env-description:"Database table"` User string `yaml:"user" env:"KAIGARA_DATABASE_USER" env-description:"Database user"` Pass string `env:"KAIGARA_DATABASE_PASS" env-description:"Database user password"` Pool int `yaml:"pool" env:"KAIGARA_DATABASE_POOL" env-description:"Database pool size" env-default:"0"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service contains a gorm DB client and a container for data loaded from DB into memory
func NewService ¶
func (*Service) DeleteEntry ¶
func (*Service) GetCurrentVersion ¶
func (*Service) GetEntries ¶
func (*Service) GetLatestVersion ¶
func (*Service) ListAppNames ¶
func (*Service) ListEntries ¶
func (*Service) SetEntries ¶
type TableNameReplaceable ¶
type TableNameReplaceable string
func (TableNameReplaceable) Replace ¶
func (customName TableNameReplaceable) Replace(name string) string
Click to show internal directories.
Click to hide internal directories.