lib

package module
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 7

README

Aerospike Management Lib

Aerospike management lib is a library for interacting with Aerospike clusters.

It provides the following components

  • Aerospike configuration - functions for validation and converting Aerospike server configuration to and from YAML.
  • Deployment - functions for inspecting and running administration calls on Aerospike clusters.
  • Info - function to run info commands on Aerospike clusters.

Documentation

Index

Constants

View Source
const NotAvailable = "N/A"
View Source
const NotSupported = "N/S"

Variables

View Source
var ByFloatField = func(fieldName string, p1, p2 Stats) bool {
	return p1.TryFloat(fieldName, 0) < p2.TryFloat(fieldName, 0)
}
View Source
var ByIntField = func(fieldName string, p1, p2 Stats) bool {
	return p1.TryInt(fieldName, 0) < p2.TryInt(fieldName, 0)
}
View Source
var ByStringField = func(fieldName string, p1, p2 Stats) bool {
	return p1.TryString(fieldName, "") < p2.TryString(fieldName, "")
}

Functions

func CompareVersions added in v1.1.0

func CompareVersions(version1, version2 string) (int, error)

CompareVersions compares Aerospike Server versions if version1 == version2 returns 0 else if version1 < version2 returns -1 else returns 1

func CompareVersionsIgnoreRevision added in v1.1.0

func CompareVersionsIgnoreRevision(version1, version2 string) (int, error)

CompareVersionsIgnoreRevision compares Aerospike Server versions ignoring revisions and builds. if version1 == version2 returns 0 else if version1 < version2 returns -1 else returns 1

func DeepCopy

func DeepCopy(src interface{}) interface{}

DeepCopy creates a deep copy of whatever is passed to it and returns the copy in an interface{}. The returned value will need to be asserted to the correct type.

func ToString

func ToString(sv interface{}) (string, error)

Types

type InfoParser

type InfoParser struct {
	*bufio.Reader
}

func NewInfoParser

func NewInfoParser(s string) *InfoParser

func (*InfoParser) Expect

func (ip *InfoParser) Expect(s string) error

func (*InfoParser) ReadFloat

func (ip *InfoParser) ReadFloat(delim byte) (float64, error)

func (*InfoParser) ReadUntil

func (ip *InfoParser) ReadUntil(delim byte) (string, error)

type Stats

type Stats map[string]interface{}

func NewStats

func NewStats() Stats

NewStats returns a new stat

func ToStats

func ToStats(inMap interface{}) Stats

func ToStatsDeep

func ToStatsDeep(input Stats) Stats

func (Stats) AggregateStats

func (s Stats) AggregateStats(other Stats)

AggregateStats Value should be a float64 or a convertible string this function never panics

func (Stats) Clone

func (s Stats) Clone() Stats

func (Stats) DeepClone

func (s Stats) DeepClone() Stats

DeepClone CopyMap(map)

func (Stats) Del

func (s Stats) Del(names ...string)

func (Stats) ExistsGet

func (s Stats) ExistsGet(name string) (interface{}, bool)

func (Stats) FindKeyPath

func (s Stats) FindKeyPath(del, key string) []string

func (Stats) FindKeysPath

func (s Stats) FindKeysPath(del string, keys ...string) map[string][]string

func (Stats) Flatten

func (s Stats) Flatten(sep string) Stats

func (Stats) Get

func (s Stats) Get(name string, aliases ...string) interface{}

func (Stats) GetInnerVal

func (s Stats) GetInnerVal(keys ...string) Stats

GetInnerVal will give inner map from a nested map, not the base field. By using this we can get the map at any level. if this map is the lowermost then there are other TryString type calls which can be used to further get any specific type of base field

func (Stats) GetMulti

func (s Stats) GetMulti(names ...string) Stats

func (Stats) GetRaw

func (s Stats) GetRaw(keys ...string) interface{}

GetRaw input is full qualified name

func (Stats) Int

func (s Stats) Int(name string, aliases ...string) int64

Int returns in64 value of a field after asserting value is an int64 and exists otherwise panics

func (Stats) Len

func (s Stats) Len() int

func (Stats) ToParsedValues

func (s Stats) ToParsedValues() map[string]interface{}

ToParsedValues Type should be map[string]interface{} otherwise same map is returned. info_parser needs parsed values

func (Stats) ToStringValues

func (s Stats) ToStringValues() map[string]interface{}

func (Stats) TryFloat

func (s Stats) TryFloat(
	name string, defValue float64, aliases ...string,
) float64

TryFloat returns float64 value of a field after asserting it is float64 or a convertible string otherwise defValue is returned.

func (Stats) TryInt

func (s Stats) TryInt(name string, defValue int64, aliases ...string) int64

TryInt - Value should be an int64 or a convertible string; otherwise defValue is returned this function never panics

func (Stats) TryList

func (s Stats) TryList(name string, aliases ...string) []string

func (Stats) TryStats

func (s Stats) TryStats(name string, aliases ...string) Stats

func (Stats) TryStatsList

func (s Stats) TryStatsList(name string, aliases ...string) []Stats

func (Stats) TryString

func (s Stats) TryString(
	name string, defValue string, aliases ...string,
) string

TryString Value should be an int64 or a convertible string; otherwise defValue is returned this function never panics

func (Stats) TryStringP

func (s Stats) TryStringP(
	name string, defValue string, aliases ...string,
) *string

TryStringP value should be an int64 or a convertible string; otherwise defValue is returned this function never panics

type StatsBy

type StatsBy func(fieldName string, p1, p2 Stats) bool

StatsBy is the type of "less" function that defines the ordering of its Stats arguments.

func (StatsBy) Sort

func (by StatsBy) Sort(fieldName string, statsList []Stats)

func (StatsBy) SortReverse

func (by StatsBy) SortReverse(fieldName string, statsList []Stats)

type SyncStats

type SyncStats struct {
	// contains filtered or unexported fields
}

func NewSyncStats

func NewSyncStats(stats Stats) *SyncStats

func (*SyncStats) AggregateStatsTo

func (s *SyncStats) AggregateStatsTo(other Stats)

AggregateStatsTo Value should be a float64 or a convertible string this function never panics

func (*SyncStats) Clone

func (s *SyncStats) Clone() Stats

func (*SyncStats) CloneInto

func (s *SyncStats) CloneInto(res Stats)

func (*SyncStats) Del

func (s *SyncStats) Del(names ...string)

func (*SyncStats) Exists

func (s *SyncStats) Exists(name string) bool

func (*SyncStats) ExistsGet

func (s *SyncStats) ExistsGet(name string) (interface{}, bool)

func (*SyncStats) Get

func (s *SyncStats) Get(name string, aliases ...string) interface{}

func (*SyncStats) GetMulti

func (s *SyncStats) GetMulti(names ...string) Stats

func (*SyncStats) Int

func (s *SyncStats) Int(name string, aliases ...string) int64

Int Value MUST exist, and MUST be an int64 or a convertible string. Panics if the above constraints are not met

func (*SyncStats) Set

func (s *SyncStats) Set(name string, value interface{})

func (*SyncStats) SetStats

func (s *SyncStats) SetStats(info Stats)

func (*SyncStats) TryFloat

func (s *SyncStats) TryFloat(
	name string, defValue float64, aliases ...string,
) float64

TryFloat Value should be a float64 or a convertible string; otherwise defValue is/returned this function never panics

func (*SyncStats) TryInt

func (s *SyncStats) TryInt(
	name string, defValue int64, aliases ...string,
) int64

TryInt Value should be an int64 or a convertible string; otherwise defValue is returned this function never panics

func (*SyncStats) TryString

func (s *SyncStats) TryString(
	name string, defValue string, aliases ...string,
) string

TryString Value should be a string; otherwise defValue is returned this function never panics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL