Documentation
¶
Index ¶
- func GetMSsqlCreateDDL() []byte
- func GetMysqlCreateDDL() []byte
- type BoltDB
- func (store BoltDB) Get(configItem ConfigItem) (ConfigItem, error)
- func (store BoltDB) GetAll() ([]ConfigItem, error)
- func (store BoltDB) GetAllApplications() ([]string, error)
- func (store BoltDB) GetAllForApplication(application string) ([]ConfigItem, error)
- func (store BoltDB) InitStore(overwrite bool) error
- func (store BoltDB) Remove(configItem ConfigItem) error
- func (store BoltDB) Set(configItem ConfigItem) (ConfigItem, error)
- type ConfigItem
- type ConfigResponse
- type ConfigService
- type MSSqlDB
- func (store MSSqlDB) Get(configItem ConfigItem) (ConfigItem, error)
- func (store MSSqlDB) GetAll() ([]ConfigItem, error)
- func (store MSSqlDB) GetAllApplications() ([]string, error)
- func (store MSSqlDB) GetAllForApplication(application string) ([]ConfigItem, error)
- func (store MSSqlDB) InitStore(overwrite bool) error
- func (store MSSqlDB) Remove(configItem ConfigItem) error
- func (store MSSqlDB) Set(configItem ConfigItem) (ConfigItem, error)
- type MySqlDB
- func (store MySqlDB) Get(configItem ConfigItem) (ConfigItem, error)
- func (store MySqlDB) GetAll() ([]ConfigItem, error)
- func (store MySqlDB) GetAllApplications() ([]string, error)
- func (store MySqlDB) GetAllForApplication(application string) ([]ConfigItem, error)
- func (store MySqlDB) InitStore(overwrite bool) error
- func (store MySqlDB) Remove(configItem ConfigItem) error
- func (store MySqlDB) Set(configItem ConfigItem) (ConfigItem, error)
- type UnknownDB
- func (store UnknownDB) Get(configItem ConfigItem) (ConfigItem, error)
- func (store UnknownDB) GetAll() ([]ConfigItem, error)
- func (store UnknownDB) GetAllApplications() ([]string, error)
- func (store UnknownDB) GetAllForApplication(application string) ([]ConfigItem, error)
- func (store UnknownDB) InitStore(overwrite bool) error
- func (store UnknownDB) Remove(configItem ConfigItem) error
- func (store UnknownDB) Set(configItem ConfigItem) (ConfigItem, error)
- type WebSocketResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMSsqlCreateDDL ¶ added in v1.0.113
func GetMSsqlCreateDDL() []byte
func GetMysqlCreateDDL ¶ added in v1.0.108
func GetMysqlCreateDDL() []byte
Types ¶
type BoltDB ¶
The BoltDB database information
func (BoltDB) Get ¶
func (store BoltDB) Get(configItem ConfigItem) (ConfigItem, error)
func (BoltDB) GetAll ¶ added in v1.0.20
func (store BoltDB) GetAll() ([]ConfigItem, error)
func (BoltDB) GetAllApplications ¶ added in v1.0.49
func (BoltDB) GetAllForApplication ¶ added in v1.0.49
func (store BoltDB) GetAllForApplication(application string) ([]ConfigItem, error)
func (BoltDB) Remove ¶ added in v1.0.28
func (store BoltDB) Remove(configItem ConfigItem) error
func (BoltDB) Set ¶
func (store BoltDB) Set(configItem ConfigItem) (ConfigItem, error)
type ConfigItem ¶
type ConfigItem struct {
Id int64 `sql:"id" json:"id"`
Application string `sql:"application" json:"application"`
Machine string `sql:"machine" json:"machine"`
Name string `sql:"name" json:"name"`
Value string `sql:"value" json:"value"`
LastUpdated time.Time `sql:"updated" json:"updated"`
}
ConfigItem represents a configuration item
type ConfigResponse ¶ added in v1.0.25
type ConfigResponse struct {
Status int `json:"status"`
Message string `json:"message"`
Data interface{} `json:"data"`
}
ConfigResponse represents an API response
type ConfigService ¶
type ConfigService interface {
// Initialize the store (create the DDL if necessary)
InitStore(overwrite bool) error
// Create / update a config item
Set(c ConfigItem) (ConfigItem, error)
// Get a specific config item
Get(c ConfigItem) (ConfigItem, error)
// Get all config items for the given application
GetAllForApplication(application string) ([]ConfigItem, error)
// Get all config items for all applications (including global)
GetAll() ([]ConfigItem, error)
// Get all applications (including global)
GetAllApplications() ([]string, error)
// Remove a config item
Remove(c ConfigItem) error
}
ConfigService encapsulates account (user) based operations This allows us to create a testable service layer. See https://github.com/tonyhb/tonyhb.com/blob/master/posts/Building%20a%20testable%20Golang%20database%20layer.md for more information
func GetConfigDatastore ¶ added in v1.0.24
func GetConfigDatastore() ConfigService
Get the currently configured datastore
type MSSqlDB ¶ added in v1.0.113
The MSSQL database information
func (MSSqlDB) Get ¶ added in v1.0.118
func (store MSSqlDB) Get(configItem ConfigItem) (ConfigItem, error)
func (MSSqlDB) GetAll ¶ added in v1.0.118
func (store MSSqlDB) GetAll() ([]ConfigItem, error)
func (MSSqlDB) GetAllApplications ¶ added in v1.0.118
func (MSSqlDB) GetAllForApplication ¶ added in v1.0.118
func (store MSSqlDB) GetAllForApplication(application string) ([]ConfigItem, error)
func (MSSqlDB) Remove ¶ added in v1.0.118
func (store MSSqlDB) Remove(configItem ConfigItem) error
func (MSSqlDB) Set ¶ added in v1.0.118
func (store MSSqlDB) Set(configItem ConfigItem) (ConfigItem, error)
type MySqlDB ¶ added in v1.0.86
The MysqlDB database information
func (MySqlDB) Get ¶ added in v1.0.86
func (store MySqlDB) Get(configItem ConfigItem) (ConfigItem, error)
func (MySqlDB) GetAll ¶ added in v1.0.86
func (store MySqlDB) GetAll() ([]ConfigItem, error)
func (MySqlDB) GetAllApplications ¶ added in v1.0.86
func (MySqlDB) GetAllForApplication ¶ added in v1.0.86
func (store MySqlDB) GetAllForApplication(application string) ([]ConfigItem, error)
func (MySqlDB) Remove ¶ added in v1.0.86
func (store MySqlDB) Remove(configItem ConfigItem) error
func (MySqlDB) Set ¶ added in v1.0.86
func (store MySqlDB) Set(configItem ConfigItem) (ConfigItem, error)
type UnknownDB ¶ added in v1.0.154
type UnknownDB struct{}
The Unknown database information
func (UnknownDB) Get ¶ added in v1.0.154
func (store UnknownDB) Get(configItem ConfigItem) (ConfigItem, error)
func (UnknownDB) GetAll ¶ added in v1.0.154
func (store UnknownDB) GetAll() ([]ConfigItem, error)
func (UnknownDB) GetAllApplications ¶ added in v1.0.154
func (UnknownDB) GetAllForApplication ¶ added in v1.0.154
func (store UnknownDB) GetAllForApplication(application string) ([]ConfigItem, error)
func (UnknownDB) Remove ¶ added in v1.0.154
func (store UnknownDB) Remove(configItem ConfigItem) error
func (UnknownDB) Set ¶ added in v1.0.154
func (store UnknownDB) Set(configItem ConfigItem) (ConfigItem, error)
type WebSocketResponse ¶ added in v1.0.163
type WebSocketResponse struct {
Type string `json:"type"`
Data ConfigItem `json:"data"`
}
WebSocketResponse represents a WebSocket event response
Click to show internal directories.
Click to hide internal directories.