Documentation
¶
Overview ¶
Package resources defines models used for provisioning.
Index ¶
- type AppConfig
- type DB
- type EphemeralUser
- type Pool
- func (p *Pool) ClonePath(port uint) string
- func (p *Pool) ClonesDir() string
- func (p *Pool) DataDir() string
- func (p *Pool) IsEmpty() bool
- func (p *Pool) ObserverDir(port uint) string
- func (p *Pool) SetDSA(dsa time.Time)
- func (p *Pool) SetStatus(status PoolStatus)
- func (p *Pool) SocketCloneDir(name string) string
- func (p *Pool) SocketDir() string
- func (p *Pool) Status() PoolStatus
- type PoolStatus
- type Session
- type SessionState
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct {
CloneName string
DockerImage string
Pool *Pool
Host string
Port uint
DB *DB
NetworkID string
ContainerConf map[string]string
// contains filtered or unexported fields
}
AppConfig currently stores Postgres configuration (other application in the future too).
func (*AppConfig) SetExtraConf ¶
SetExtraConf sets a map with an extra configuration.
type EphemeralUser ¶
type EphemeralUser struct {
// TODO(anatoly): Were private fields. How to keep them private?
Name string `json:"name"`
Password string `json:"password"`
Restricted bool `json:"restricted"`
AvailableDB string `json:"availableDB"`
}
EphemeralUser describes an ephemeral database user defined by Database Lab users.
type Pool ¶
type Pool struct {
Name string
Mode string
DSA time.Time
PoolDirName string
MountDir string
CloneSubDir string
DataSubDir string
SocketSubDir string
ObserverSubDir string
// contains filtered or unexported fields
}
Pool describes a storage pool.
func (*Pool) ObserverDir ¶
ObserverDir returns a path to the observer directory of the storage pool.
func (*Pool) SetStatus ¶
func (p *Pool) SetStatus(status PoolStatus)
SetStatus sets a status to the pool.
func (*Pool) SocketCloneDir ¶
SocketCloneDir returns a path to the socket clone directory.
type PoolStatus ¶
type PoolStatus string
PoolStatus represents a pool status.
const ( // ActivePool defines an active pool status. ActivePool PoolStatus = "active" // RefreshingPool defines the status of a pool when data retrieval in progress. RefreshingPool PoolStatus = "refreshing" // EmptyPool defines the status of an inactive pool. EmptyPool PoolStatus = "empty" )
type Session ¶
type Session struct {
ID string `json:"id"`
Pool string `json:"pool"`
// Database.
Port uint `json:"port"`
User string `json:"user"`
SocketHost string `json:"socketHost"`
EphemeralUser EphemeralUser `json:"ephemeralUser"`
ExtraConfig map[string]string `json:"extraConfig"`
}
Session defines clone provision information and connection info.
type SessionState ¶
SessionState defines current state of a Session.