Documentation ¶
Index ¶
- Constants
- Variables
- func AMCIsEnterprise() bool
- func AMCIsProd() bool
- func Comma(v int64, sep string) string
- func DeleteEmpty(s []string) []string
- func InitConfig(configFile, configDir string, config *Config)
- func MaxInt64(a, b int64) int64
- func ParseTimeStrict(layout, value string) (time.Time, error)
- func PublicKeyFile(file string) ssh.AuthMethod
- func Round(val float64, roundOn float64, places int) (newVal float64)
- func SSHAgent() ssh.AuthMethod
- func SetupDatabase(filepath string)
- func SortStrings(s []string) []string
- func SplitHostPort(addr string) (host string, port int, err error)
- func StrDiff(o, n []string) (added, removed []string)
- func StrUniq(l []string) []string
- func ToNullString(s string) sql.NullString
- type Alert
- type AlertBucket
- func (ad *AlertBucket) AlertsFrom(nodeAddress string, id int64) []*Alert
- func (ad *AlertBucket) DrainNewAlerts() []*Alert
- func (ad *AlertBucket) Recurring(alert *Alert) *Alert
- func (ad *AlertBucket) RedAlertsFrom(nodeAddress string, ID int64) int
- func (ad *AlertBucket) Register(alert *Alert) (recurring bool)
- func (ad *AlertBucket) ResolveAlert(alert *Alert)
- type AlertStatus
- type AlertType
- type AlertsByID
- type BackupRestore
- type BackupRestoreStatus
- type BackupRestoreType
- type Config
- func (c *Config) AeroLogLevel() aslog.LogPriority
- func (c *Config) AlertEmails() []string
- func (c *Config) AppendAlertEmails(emails []string) error
- func (c *Config) ClientPool() []tls.Certificate
- func (c *Config) DeleteAlertEmails(emails []string) error
- func (c *Config) FromAddress() string
- func (c *Config) LogLevel() log.Level
- func (c *Config) ServerPool() *x509.CertPool
- type IndexType
- type Info
- func (s Info) Clone() Info
- func (s Info) Float(name string, aliases ...string) float64
- func (s Info) Get(name string, aliases ...string) interface{}
- func (s Info) GetMulti(names ...string) Info
- func (s Info) Int(name string, aliases ...string) int64
- func (s Info) ToInfo(name string) Info
- func (s Info) ToInfoMap(name string, alias string, delim string) map[string]Info
- func (s Info) ToStats() Stats
- func (s Info) ToStatsMap(name string, alias string, delim string) map[string]Stats
- func (s Info) TryFloat(name string, defValue float64, aliases ...string) float64
- func (s Info) TryInt(name string, defValue int64, aliases ...string) int64
- func (s Info) TryNumericValue(name string, defVal interface{}, aliases ...string) interface{}
- func (s Info) TryString(name string, defValue string, aliases ...string) string
- type InfoParser
- type JSONRawString
- type NullTime
- type SSHClient
- type SSHCommand
- type SinglePointValue
- type Stats
- func (s Stats) AggregateStats(other Stats)
- func (s Stats) Clone() Stats
- func (s Stats) Del(names ...string)
- func (s Stats) ExistsGet(name string) (interface{}, bool)
- func (s Stats) Get(name string, aliases ...string) interface{}
- func (s Stats) GetMulti(names ...string) Stats
- func (s Stats) Int(name string, aliases ...string) int64
- func (s Stats) ToStringValues() map[string]interface{}
- func (s Stats) TryFloat(name string, defValue float64, aliases ...string) float64
- func (s Stats) TryInt(name string, defValue int64, aliases ...string) int64
- func (s Stats) TryString(name string, defValue string, aliases ...string) string
- type StatsBy
- type SyncInfo
- func (s *SyncInfo) Clone() Info
- func (s *SyncInfo) Float(name string, aliases ...string) float64
- func (s *SyncInfo) Get(name string, aliases ...string) interface{}
- func (s *SyncInfo) GetMulti(names ...string) Info
- func (s *SyncInfo) Int(name string, aliases ...string) int64
- func (s *SyncInfo) SetInfo(info Info)
- func (s *SyncInfo) ToInfo(name string) Info
- func (s *SyncInfo) ToInfoMap(name string, alias string, delim string) map[string]Info
- func (s *SyncInfo) ToStatsMap(name string, alias string, delim string) map[string]Stats
- func (s *SyncInfo) TryFloat(name string, defValue float64, aliases ...string) float64
- func (s *SyncInfo) TryInt(name string, defValue int64, aliases ...string) int64
- func (s *SyncInfo) TryNumericValue(name string, defVal interface{}, aliases ...string) interface{}
- func (s *SyncInfo) TryString(name string, defValue string, aliases ...string) string
- type SyncStats
- func (s *SyncStats) AggregateStatsTo(other Stats)
- func (s *SyncStats) Clone() Stats
- func (s *SyncStats) CloneInto(res Stats)
- func (s *SyncStats) Del(names ...string)
- func (s *SyncStats) Exists(name string) bool
- func (s *SyncStats) ExistsGet(name string) (interface{}, bool)
- func (s *SyncStats) Get(name string, aliases ...string) interface{}
- func (s *SyncStats) GetMulti(names ...string) Stats
- func (s *SyncStats) Int(name string, aliases ...string) int64
- func (s *SyncStats) Set(name string, value interface{})
- func (s *SyncStats) SetStats(info Stats)
- func (s *SyncStats) TryFloat(name string, defValue float64, aliases ...string) float64
- func (s *SyncStats) TryInt(name string, defValue int64, aliases ...string) int64
- func (s *SyncStats) TryString(name string, defValue string, aliases ...string) string
- type SyncValue
Constants ¶
const NOT_AVAILABLE = "N/A"
const NOT_SUPPORTED = "N/S"
Variables ¶
var AMCBuild string
AMCBuild - AMC Build
var AMCEdition string
AMCEdition - AMC Edition (EE)
var AMCEnv string
AMCEnv - AMC Environment (dev/prod)
var AMCVersion string
AMCVersion - AMC Version
var ByFloatField = func(fieldName string, p1, p2 Stats) bool {
return p1.TryFloat(fieldName, 0) < p2.TryFloat(fieldName, 0)
}
ByFloatField - sort by float field
var ByIntField = func(fieldName string, p1, p2 Stats) bool {
return p1.TryInt(fieldName, 0) < p2.TryInt(fieldName, 0)
}
ByIntField - sort by int field
var ByStringField = func(fieldName string, p1, p2 Stats) bool {
return p1.TryString(fieldName, "") < p2.TryString(fieldName, "")
}
ByStringField - sort by string field
Functions ¶
func AMCIsEnterprise ¶
func AMCIsEnterprise() bool
AMCIsEnterprise was originally for knowing if this is the EE version of AMC. It is now always true
func InitConfig ¶
InitConfig - init the config struct
func ParseTimeStrict ¶
ParseTimeStrict parses a formatted string and returns the time value it represents. The output is identical to time.Parse except it returns an error for strings that don't format to the input value.
An example where the output differs from time.Parse would be: parseTimeStrict("1/2/06", "11/31/15")
- time.Parse returns "2015-12-01 00:00:00 +0000 UTC"
- parseTimeStrict returns an error
func PublicKeyFile ¶
func PublicKeyFile(file string) ssh.AuthMethod
PublicKeyFile - return Public Key
func SplitHostPort ¶
SplitHostPort - convert aerospike host string to basic parts
func ToNullString ¶
func ToNullString(s string) sql.NullString
ToNullString - convert string into sql.NullString
Types ¶
type Alert ¶
type Alert struct { ID int64 Type AlertType ClusterID string NodeAddress string Namespace sql.NullString Desc string Created time.Time LastOccured time.Time Resolved NullTime Recurrence int64 Status AlertStatus }
Alert structure
type AlertBucket ¶
type AlertBucket struct {
// contains filtered or unexported fields
}
AlertBucket structure
func (*AlertBucket) AlertsFrom ¶
func (ad *AlertBucket) AlertsFrom(nodeAddress string, id int64) []*Alert
AlertsFrom - get alert from table
func (*AlertBucket) DrainNewAlerts ¶
func (ad *AlertBucket) DrainNewAlerts() []*Alert
DrainNewAlerts - frain the news alerts
func (*AlertBucket) Recurring ¶
func (ad *AlertBucket) Recurring(alert *Alert) *Alert
Recurring - recurring alert
func (*AlertBucket) RedAlertsFrom ¶
func (ad *AlertBucket) RedAlertsFrom(nodeAddress string, ID int64) int
RedAlertsFrom - get red alerts
func (*AlertBucket) Register ¶
func (ad *AlertBucket) Register(alert *Alert) (recurring bool)
Register - register alert
func (*AlertBucket) ResolveAlert ¶
func (ad *AlertBucket) ResolveAlert(alert *Alert)
ResolveAlert - clear alert
type AlertStatus ¶
type AlertStatus string
AlertStatus - type
const ( AlertStatusRed AlertStatus = "red" AlertStatusYellow AlertStatus = "yellow" AlertStatusGreen AlertStatus = "green" )
Alert colors
func (*AlertStatus) Scan ¶
func (nt *AlertStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type AlertType ¶
type AlertType int
AlertType - type
const ( AlertTypeNodeStatus AlertType = 0 AlertTypeNodeVisibility AlertType = 1 AlertTypeNodeDisk AlertType = 2 AlertTypeNodeMemory AlertType = 3 AlertTypeNodeTransQueue AlertType = 4 AlertTypeNodeFileDescriptors AlertType = 5 AlertTypeNamespaceAvailablePct AlertType = 6 AlertTypeNamespaceDiskPctHighWatermark AlertType = 7 AlertTypeNamespaceDiskPctStopWrites AlertType = 8 AlertTypeNamespaceMemoryPctHighWatermark AlertType = 9 AlertTypeNamespaceMemoryPctStopWrites AlertType = 10 )
Alert Types
type AlertsByID ¶
type AlertsByID []*Alert
AlertsByID implements sort.Interface for []*Alert based on the Age field.
func (AlertsByID) Len ¶
func (a AlertsByID) Len() int
func (AlertsByID) Less ¶
func (a AlertsByID) Less(i, j int) bool
func (AlertsByID) Swap ¶
func (a AlertsByID) Swap(i, j int)
type BackupRestore ¶
type BackupRestore struct { Type BackupRestoreType ID string ClusterID string Namespace string DestinationAddress string Username string Password string DestinationPath string Sets sql.NullString MetadataOnly bool TerminateOnClusterChange bool ScanPriority int Created time.Time Finished NullTime Status BackupRestoreStatus ModifiedBefore string ModifiedAfter string Progress int Error string SSHClient *SSHClient // contains filtered or unexported fields }
BackupRestore struct
func NewBackupRestore ¶
func NewBackupRestore( Type BackupRestoreType, ClusterID string, Namespace string, DestinationAddress string, Username string, Password string, DestinationPath string, Sets string, MetadataOnly bool, TerminateOnClusterChange bool, ScanPriority int, ModifiedBefore string, ModifiedAfter string, Status BackupRestoreStatus) *BackupRestore
NewBackupRestore - Create new backup/restore
func SuccessfulBackups ¶
func SuccessfulBackups() ([]*BackupRestore, error)
SuccessfulBackups - return list of successful backups
func (*BackupRestore) UpdateError ¶
func (br *BackupRestore) UpdateError(errorMsg string) error
UpdateError - update on error
func (*BackupRestore) UpdateProgress ¶
func (br *BackupRestore) UpdateProgress(percent int) error
UpdateProgress - update progrss
func (*BackupRestore) UpdateStatus ¶
func (br *BackupRestore) UpdateStatus(status BackupRestoreStatus) error
UpdateStatus - update status
type BackupRestoreStatus ¶
type BackupRestoreStatus string
BackupRestoreStatus type
const ( BackupStatusInProgress BackupRestoreStatus = "In Progress" BackupStatusFailed BackupRestoreStatus = "Failure" BackupStatusFinished BackupRestoreStatus = "Success" )
BackupRestoreStatus
func (*BackupRestoreStatus) Scan ¶
func (nt *BackupRestoreStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type BackupRestoreType ¶
type BackupRestoreType string
BackupRestoreType type
const ( BackupRestoreTypeBackup BackupRestoreType = "backup" BackupRestoreTypeRestore BackupRestoreType = "restore" )
BackupRestoreType
func (*BackupRestoreType) Scan ¶
func (nt *BackupRestoreType) Scan(value interface{}) error
Scan implements the Scanner interface.
type Config ¶
type Config struct { AMC struct { UpdateInterval int `toml:"update_interval"` InactiveDurBeforeRemoval int `toml:"cluster_inactive_before_removal"` CertFile string `toml:"certfile"` KeyFile string `toml:"keyfile"` ForceTLS12 bool `toml:"force_tls12"` MaxTLSSecurity bool `toml:"max_tls_security"` StaticPath string `toml:"static_dir"` // BackupHost string `toml:"backup_host"` // BackupHostUser string `toml:"backup_host_user"` // BackupHostPassword string `toml:"backup_host_password"` BackupHostKeyFile string `toml:"backup_host_public_key_file"` Database string `toml:"database"` Clusters map[string]struct { Host string `toml:"host"` TLSName string `toml:"tls_name"` Port uint16 `toml:"port"` User string `toml:"user"` Password string `toml:"password"` Alias string `toml:"alias"` UseServicesAlternate bool `toml:"use_services_alternate"` ShowInUI bool `toml:"show_in_ui"` } `toml:"clusters"` Bind string `toml:"bind"` LogLevel string `toml:"loglevel"` ErrorLog string `toml:"errorlog"` Chdir string `toml:"chdir"` Timeout int `toml:"timeout"` PIDFile string `toml:"pidfile"` } Mailer struct { TemplatePath string `toml:"template_path"` Host string `toml:"host"` Port uint16 `toml:"port"` User string `toml:"user"` Password string `toml:"password"` FromAddress string `toml:"from_address"` SendTo []string `toml:"send_to"` AcceptInvalidCert bool `toml:"accept_invalid_cert"` // contains filtered or unexported fields } `toml:"mailer"` BasicAuth struct { User string `toml:"user"` Password string `toml:"password"` } `toml:"basic_auth"` TLS struct { ServerPool []string `toml:"server_cert_pool"` ClientPool map[string]struct { CertFile string `toml:"cert_file"` KeyFile string `toml:"key_file"` } `toml:"client_certs"` } `toml:"tls"` LogFile *os.File // contains filtered or unexported fields }
Config struct
func (*Config) AeroLogLevel ¶
func (c *Config) AeroLogLevel() aslog.LogPriority
AeroLogLevel - return aslog.LogPriority
func (*Config) AppendAlertEmails ¶
AppendAlertEmails - send email
func (*Config) ClientPool ¶
func (c *Config) ClientPool() []tls.Certificate
ClientPool - return clientPool
func (*Config) DeleteAlertEmails ¶
DeleteAlertEmails - delete email
func (*Config) ServerPool ¶
ServerPool - return serverPool
type Info ¶
Info - map type
func (Info) Float ¶
Float - Value MUST exist, and MUST be an float64 or a convertible string. Panics if the above constraints are not met
func (Info) Int ¶
Int - Value MUST exist, and MUST be an int64 or a convertible string. Panics if the above constraints are not met
func (Info) ToInfo ¶
ToInfo - Value should be an stats or a convertible string; otherwise nil is returns this function never panics
func (Info) ToInfoMap ¶
ToInfoMap - Value should be an stats or a convertible string; otherwise nil is returns this function never panics
func (Info) ToStats ¶
ToStats - Value should be an stats or a convertible string; otherwise nil is returns this function never panics
func (Info) ToStatsMap ¶
ToStatsMap - Value should be an stats or a convertible string; otherwise nil is returns this function never panics
func (Info) TryFloat ¶
TryFloat - Value should be an float64 or a convertible string; otherwise defValue is returned this function never panics
func (Info) TryInt ¶
TryInt - Value should be an int64 or a convertible string; otherwise defValue is returned this function never panics
func (Info) TryNumericValue ¶
TryNumericValue - Value should be an float64, int64 or a convertible string; otherwise defValue is returned this function never panics
type InfoParser ¶
InfoParser struct
func (*InfoParser) Expect ¶
func (ip *InfoParser) Expect(s string) error
Expect expect a value, assert if not expected value
type JSONRawString ¶
type JSONRawString string
JSONRawString - Value should be a string
func (*JSONRawString) MarshalJSON ¶
func (m *JSONRawString) MarshalJSON() ([]byte, error)
MarshalJSON returns *m as the JSON encoding of m.
type NullTime ¶
type NullTime struct {
// contains filtered or unexported fields
}
NullTime to store time and nullibility
type SSHClient ¶
type SSHClient struct { Config *ssh.ClientConfig Host string Port int }
SSHClient struct
func (*SSHClient) RunCommand ¶
func (client *SSHClient) RunCommand(cmd *SSHCommand) error
RunCommand - run ssh command
type SSHCommand ¶
type SSHCommand struct { Path string Env []string Stdin io.Reader Stdout io.Writer Stderr io.Writer }
SSHCommand struct
type SinglePointValue ¶
type SinglePointValue struct {
// contains filtered or unexported fields
}
SinglePointValue struct
func NewSinglePointValue ¶
func NewSinglePointValue(timestamp *int64, value *float64) *SinglePointValue
NewSinglePointValue - create new PointValue for graphs
func (*SinglePointValue) Timestamp ¶
func (spv *SinglePointValue) Timestamp(mult int64) *int64
Timestamp - get timestamp for graph
func (*SinglePointValue) TimestampJSON ¶
func (spv *SinglePointValue) TimestampJSON(defVal *time.Time) *int64
TimestampJSON - return timestamp at unix time
func (*SinglePointValue) Value ¶
func (spv *SinglePointValue) Value(defVal *float64) *float64
Value - return SinglePointValue value or default
type Stats ¶
type Stats map[string]interface{}
Stats - map type
func AggregateInfo ¶
AggregateInfo - Value should be an float64 or a convertible string; otherwise defValue is returned this function never panics
func (Stats) AggregateStats ¶
AggregateStats - Value should be an float64 or a convertible string this function never panics
func (Stats) ToStringValues ¶
ToStringValues - conver Stats to string
func (Stats) TryFloat ¶
TryFloat - Value should be an float64 or a convertible string; otherwise defValue is returned this function never panics
type StatsBy ¶
StatsBy is the type of a "less" function that defines the ordering of its Stats arguments.
func (StatsBy) SortReverse ¶
SortReverse - stats reverse sorter
type SyncInfo ¶
type SyncInfo struct {
// contains filtered or unexported fields
}
SyncInfo struct
func (*SyncInfo) Float ¶
Float - Value MUST exist, and MUST be an float64 or a convertible string. Panics if the above constraints are not met
func (*SyncInfo) Int ¶
Int - Value MUST exist, and MUST be an int64 or a convertible string. Panics if the above constraints are not met
func (*SyncInfo) ToInfoMap ¶
ToInfoMap - Value should be an stats or a convertible string; otherwise nil is returns this function never panics
func (*SyncInfo) ToStatsMap ¶
ToStatsMap Syncinfo to statsMap
func (*SyncInfo) TryFloat ¶
TryFloat - Value should be an float64 or a convertible string; otherwise defValue is returned this function never panics
func (*SyncInfo) TryInt ¶
TryInt - Value should be an int64 or a convertible string; otherwise defValue is returned this function never panics
func (*SyncInfo) TryNumericValue ¶
TryNumericValue - Value should be an float64, int64 or a convertible string; otherwise defValue is returned this function never panics
type SyncStats ¶
type SyncStats struct {
// contains filtered or unexported fields
}
SyncStats strunct
func (*SyncStats) AggregateStatsTo ¶
AggregateStatsTo - Value should be an float64 or a convertible string this function never panics
func (*SyncStats) Int ¶
Int - Value MUST exist, and MUST be an int64 or a convertible string. Panics if the above constraints are not met
func (*SyncStats) TryFloat ¶
TryFloat - Value should be an float64 or a convertible string; otherwise defValue is returned this function never panics