Documentation
¶
Index ¶
- func ListBackups(containerName, prefix string, limit int) error
- func Restore(containerName, prefix string) error
- type Collector
- type Dynomite
- func (dyno Dynomite) Backup(containerName, prefix string) error
- func (dyno Dynomite) BackupEvery(every time.Duration, containerName, prefix string) error
- func (dyno Dynomite) GetState() (State, error)
- func (dyno Dynomite) Info() (*InfoReport, error)
- func (dyno Dynomite) SetState(state State) (string, error)
- func (dyno Dynomite) Warmup(master Redis, accecptedDiff int64, timeout time.Duration, slaveHost string) (bool, error)
- type InfoReport
- type Redis
- func (r Redis) BGSave(timeout time.Duration) (time.Time, error)
- func (r Redis) DBSize() (int64, error)
- func (r Redis) LastSave() (time.Time, error)
- func (r Redis) Ping() (bool, error)
- func (r Redis) Replicate(master Redis) (bool, error)
- func (r Redis) ReplicationOffsets(slaveHost string) (*ReplicationOffsets, error)
- func (r Redis) Role() (string, error)
- func (r Redis) StopReplication() error
- func (r Redis) WaitFor(timeout time.Duration) error
- func (r Redis) Warmup(master Redis, accecptedDiff int64, timeout time.Duration, slaveHost string) (bool, error)
- type ReplicationOffsets
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListBackups ¶
ListBackups shows the possible restore candidates
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector implements the prometheus.Collector interface.
func NewCollector ¶
NewCollector creates a new Collector.
func (*Collector) Collect ¶
func (c *Collector) Collect(ch chan<- prometheus.Metric)
Collect implements the prometheus.Collector interface.
func (*Collector) Describe ¶
func (c *Collector) Describe(ch chan<- *prometheus.Desc)
Describe implements the prometheus.Collector interface.
type Dynomite ¶
Dynomite represents a dynomite instance
func NewDynomite ¶
NewDynomite returns a new instance of Dynomite
func NewDynomiteRedis ¶
NewDynomiteRedis creates a new Redis struct with initialized ConnectionPool
func (Dynomite) BackupEvery ¶
BackupEvery calls Backup() periodicly
func (Dynomite) Info ¶
func (dyno Dynomite) Info() (*InfoReport, error)
Info returns the InfoReport for a Dynomite instance.
func (Dynomite) SetState ¶
SetState sets Dynomite's internal state and returns the response status, if successful.
func (Dynomite) Warmup ¶
func (dyno Dynomite) Warmup(master Redis, accecptedDiff int64, timeout time.Duration, slaveHost string) (bool, error)
Warmup starts the warmup process 1. Set Dynomite in Standby mode 2. Set Dynomite Backend as replica of master 3. Wait for accecptable replication offset difference between master and replica or timeout 4. Set Dynomite State to write_only 5. Stop replication 6. Set Dynomite State to resuming 7. Set Dynomite State to normal
type InfoReport ¶
type InfoReport struct {
Uptime uint64 `json:"uptime"`
Rack string `json:"rack"`
DC string `json:"dc"`
Pool struct {
ClientConnections uint64 `json:"client_connections"`
ClientReadRequests uint64 `json:"client_read_requests"`
ClientWriteRequests uint64 `json:"client_write_requests"`
ClientDroppedRequests uint64 `json:"client_dropped_requests"`
} `json:"dyn_o_mite"`
}
InfoReport contains the information as reported by the /info endpoint of a Dynomite instance.
type Redis ¶
Redis represent the dynomite backend as Redis instance
func (Redis) ReplicationOffsets ¶
func (r Redis) ReplicationOffsets(slaveHost string) (*ReplicationOffsets, error)
ReplicationOffsets determines the ReplicationOffset difference between master and slave
func (Redis) StopReplication ¶
StopReplication activates replication from the given master
type ReplicationOffsets ¶
ReplicationOffsets represents the current state of replication of master and slave
type State ¶
type State string
State representing the working mode of dynomite
const ( Normal State = "normal" Standby State = "standby" WritesOnly State = "writes_only" Resuming State = "resuming" )
Possible states of dynomite
func StrToState ¶
StrToState validates and converts a string to a State.