Documentation
¶
Overview ¶
chunks.go provides a base parser that loads rladmin output and parses it into chunks for each section. Copyright © 2024 Nic Gibson <nic.gibson@redis.com>
Copyright © 2024 Nic Gibson <nic.gibson@redis.com>
databases.go provides a parser for the database information in the rladmin output Copyright © 2024 Nic Gibson <nic.gibson@redis.com>
endpoints.go provides a parser for the node information in the rladmin output Copyright © 2024 Nic Gibson <nic.gibson@redis.com>
nodes.go provides a parser for the node information in the rladmin output Copyright © 2024 Nic Gibson <nic.gibson@redis.com>
shards.go provides a parser for the shard information in the rladmin output Copyright © 2024 Nic Gibson <nic.gibson@redis.com>
Index ¶
- Constants
- type Chunks
- func (c *Chunks) ExtractTimeStamp() (time.Time, error)
- func (c *Chunks) Parse(input io.Reader) error
- func (c *Chunks) ParseDatabases(parent *ClusterInfo) (Databases, error)
- func (c *Chunks) ParseEndpoints(parent *ClusterInfo) (Endpoints, error)
- func (c *Chunks) ParseNodes(parent *ClusterInfo) (Nodes, error)
- func (c *Chunks) ParseShards(parent *ClusterInfo) (Shards, error)
- type ClusterInfo
- type DBEndPoints
- type DBNodes
- type DBShards
- type Database
- type DatabaseWithNodes
- type Databases
- type DatabasesWithNodes
- type Endpoint
- type Endpoints
- type IP
- type MemoryInfo
- type Node
- type Nodes
- type RAMFloat
- type Serializer
- type Shard
- type ShardInfo
- type Shards
Constants ¶
const ( ChunkNone = iota ChunkCluster ChunkNodes ChunkDatabases ChunkEndpoints ChunkShards )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunks ¶
Chunks is used to store the output of the base parser.
func (*Chunks) ExtractTimeStamp ¶
ExtractTimeStamp finds the timestamp at the start of the output and returns it as time.Time
func (*Chunks) ParseDatabases ¶
func (c *Chunks) ParseDatabases(parent *ClusterInfo) (Databases, error)
func (*Chunks) ParseEndpoints ¶
func (c *Chunks) ParseEndpoints(parent *ClusterInfo) (Endpoints, error)
func (*Chunks) ParseNodes ¶
func (c *Chunks) ParseNodes(parent *ClusterInfo) (Nodes, error)
func (*Chunks) ParseShards ¶
func (c *Chunks) ParseShards(parent *ClusterInfo) (Shards, error)
type ClusterInfo ¶
type ClusterInfo struct { Unparsed *Chunks `json:"-"` Databases Databases `json:"databases"` Endpoints Endpoints `json:"endpoints"` Shards Shards `json:"shards"` Nodes Nodes `json:"nodes"` TimeStamp time.Time `json:"timeSteamp"` }
ClusterInfo represents all the data loaded from the rladmin status output
func NewClusterInfo ¶
func NewClusterInfo(in io.Reader) (*ClusterInfo, error)
func (*ClusterInfo) DatabasesWithNodes ¶
func (c *ClusterInfo) DatabasesWithNodes() DatabasesWithNodes
func (*ClusterInfo) JSON ¶
func (c *ClusterInfo) JSON() (string, error)
type DBEndPoints ¶
type DBEndPoints []string
func (*DBEndPoints) MarshalCSV ¶
func (e *DBEndPoints) MarshalCSV() (string, error)
func (*DBEndPoints) UnmarshalCSV ¶
func (e *DBEndPoints) UnmarshalCSV(input string) error
type DBNodes ¶
func (*DBNodes) MarshalCSV ¶
type Database ¶
type Database struct { Id string `csv:"DB:ID" json:"id"` Name string `csv:"NAME" json:"name"` Type string `csv:"TYPE" json:"type"` Status string `csv:"STATUS" json:"status"` MasterShards uint16 `csv:"SHARDS" json:"shards"` Placement string `csv:"PLACEMENT" json:"placement"` Replication string `csv:"REPLICATION" json:"replication"` Persistence string `csv:"PERSISTENCE" json:"persistence"` Endpoint DBEndPoints `csv:"ENDPOINT" json:"endpoints"` ExecState string `csv:"EXEC_STATE" json:"execState"` ExecStateMachine string `csv:"EXEC_STATE_MACHINE" json:"execStateMachine"` BackupProgress string `csv:"BACKUP_PROGRESS" json:"backupProgress"` MissingBackupTime string `csv:"MISSING_BACKUP_TIME" json:"missingBackupTime"` RedisVersion string `csv:"REDIS_VERSION" json:"redisVersion"` // contains filtered or unexported fields }
func (*Database) ShardCount ¶
ShardCount returns the total number of shards by counting them.
type DatabaseWithNodes ¶
type DatabasesWithNodes ¶
type DatabasesWithNodes []*DatabaseWithNodes
func (DatabasesWithNodes) CSV ¶
func (d DatabasesWithNodes) CSV() (string, error)
func (DatabasesWithNodes) JSON ¶
func (d DatabasesWithNodes) JSON() (string, error)
type Endpoint ¶
type Endpoint struct { Id string `json:"id" csv:"ID"` DBId string `json:"dbId" csv:"DB:ID"` Name string `json:"name" csv:"NAME"` Node string `json:"node" csv:"NODE"` Role string `json:"role" csv:"ROLE"` SSL bool `json:"ssl" csv:"SSL"` WatchdogStatus string `json:"watchdogStatus" csv:"WATCHDOG_STATUS"` // contains filtered or unexported fields }
type IP ¶
func (*IP) UnmarshalCSV ¶
type MemoryInfo ¶
func (*MemoryInfo) UnmarshalCSV ¶
func (m *MemoryInfo) UnmarshalCSV(input string) error
type Node ¶
type Node struct { Id string `json:"id" csv:"NODE:ID"` Role string `json:"role" csv:"ROLE"` Address IP `json:"address" csv:"ADDRESS"` ExternalAddress IP `json:"externalAddress" csv:"EXTERNAL_ADDRESS"` HostName string `json:"hostName" csv:"HOSTNAME"` OverbookingDepth RAMFloat `json:"overbookingDepth" csv:"OVERBOOKING_DEPTH"` Masters uint16 `json:"masters" csv:"MASTERS"` Replicas uint16 `json:"replicas" csv:"SLAVES"` ShardUsage ShardInfo `json:"shards" csv:"SHARDS"` Cores uint16 `json:"cores" csv:"CORES"` RedisRAM MemoryInfo `json:"redisRAM" csv:"FREE_RAM"` ProvisionalRAM MemoryInfo `json:"provisionalRAM" csv:"PROVISIONAL_RAM"` Version string `json:"version" csv:"VERSION"` SHA string `json:"sha" csv:"SHA"` RackId string `json:"rackId" csv:"RACK-ID"` Status string `json:"status" csv:"STATUS"` Quorum bool `json:"quorum" csv:"-"` // contains filtered or unexported fields }
type RAMFloat ¶
type RAMFloat float64
func (*RAMFloat) MarshalCSV ¶
func (*RAMFloat) MarshalJSON ¶
func (*RAMFloat) UnmarshalCSV ¶
type Shard ¶
type Shard struct { Id string `json:"id" csv:"ID"` DBId string `json:"dbId" csv:"DB:ID"` Name string `json:"name" csv:"NAME"` Node string `json:"node" csv:"NODE"` Role string `json:"role" csv:"ROLE"` Slots string `json:"slots" csv:"SLOTS"` UsedMemory RAMFloat `json:"usedMemory" csv:"USED_MEMORY"` BackupProgress string `json:"backupProgress" csv:"BACKUP_PROGRESS"` RAMFrag RAMFloat `json:"ramFrag" csv:"RAM_FRAG"` WatchdogStatus string `json:"watchdogStatus" csv:"WATCHDOG_STATUS"` Status string `json:"status" csv:"STATUS"` // contains filtered or unexported fields }