Documentation
¶
Index ¶
- Constants
- func FullyQualifyName(table TableName, relativeName string) string
- func GetKeyForBlade(region string, zone string, rack string, blade int64) (string, error)
- func GetKeyForIndexBlades(region string, zone string, rack string) (string, error)
- func GetKeyForIndexEntryBlade(region string, zone string, rack string, blade int64) (string, error)
- func GetKeyForIndexEntryPdu(region string, zone string, rack string, pdu int64) (string, error)
- func GetKeyForIndexEntryRack(region string, zone string, rack string) (string, error)
- func GetKeyForIndexEntryRegion(region string) (string, error)
- func GetKeyForIndexEntryTor(region string, zone string, rack string, tor int64) (string, error)
- func GetKeyForIndexEntryZone(region string, zone string) (string, error)
- func GetKeyForIndexPdus(region string, zone string, rack string) (string, error)
- func GetKeyForIndexRacks(region string, zone string) (string, error)
- func GetKeyForIndexRegions() string
- func GetKeyForIndexTors(region string, zone string, rack string) (string, error)
- func GetKeyForIndexZones(region string) (string, error)
- func GetKeyForPdu(region string, zone string, rack string, pdu int64) (string, error)
- func GetKeyForRack(region string, zone string, rack string) (string, error)
- func GetKeyForRegion(region string) (string, error)
- func GetKeyForTor(region string, zone string, rack string, tor int64) (string, error)
- func GetKeyForZone(region string, zone string) (string, error)
- func GetKeyFromKeyRootAndName(r KeyRoot, n string) string
- func GetKeyFromUsername(name string) string
- func GetNameFromKeyRootAndKey(r KeyRoot, k string) string
- func GetNamespacePrefixFromKeyRoot(r KeyRoot) string
- func GetNormalizedName(name string) string
- type Address
- func GetAddressFromKey(key string) (*Address, error)
- func NewBlade(table TableName, region string, zone string, rack string, blade int64) *Address
- func NewPdu(table TableName, region string, zone string, rack string, pdu int64) *Address
- func NewRack(table TableName, region string, zone string, rack string) *Address
- func NewRegion(table TableName, region string) *Address
- func NewTor(table TableName, region string, zone string, rack string, tor int64) *Address
- func NewZone(table TableName, region string, zone string) *Address
- func (a *Address) Blade() int64
- func (a *Address) Pdu() int64
- func (a *Address) Rack() string
- func (a *Address) Region() string
- func (a *Address) String() string
- func (a *Address) Table() TableName
- func (a *Address) Tor() int64
- func (a *Address) Type() AddressType
- func (a *Address) Validate() error
- func (a *Address) Zone() string
- type AddressType
- type KeyRoot
- type TableName
- type TableNameSet
Constants ¶
const ( // DefinitionTable is a constant to indicate the inventory operation should be // performed against the inventory definition table for the item of interest. // DefinitionTable TableName = "definition" // DefinitionTableStdTest is a constant to indicate the inventory operation should be // performed against the test inventory definition table for the standard test // inventory for the item of interest. // DefinitionTableStdTest TableName = "definitionstdtest" // ActualTable is a constant to indicate the inventory operation should be // performed against the inventory actual state table for the item of interest. // ActualTable TableName = "actual" // ObservedTable is a constant to indicate the inventory operation should be // performed against the inventory observed state table for the item of interest. // ObservedTable TableName = "observed" // TargetTable is a constant to indicate the inventory operation should be // performed against the inventory target state table for the item of interest. // TargetTable TableName = "target" // InvalidTable is a default value for the case where a TableName in not one // of the valid set. // InvalidTable TableName = "" // InvalidRegion is used when a return value is needed for a region but where // the value cannot be used in any way other than for comparison. // InvalidRegion string = "" // InvalidZone is used when a return value is needed for a zone but where // the value cannot be used in any way other than for comparison. // InvalidZone string = "" // InvalidRack is used when a return value is needed for a rack but where // the value cannot be used in any way other than for comparison. // InvalidRack string = "" // InvalidPdu is used when a return value is needed for a pdu but where // the value cannot be used in any way other than for comparison. // InvalidPdu int64 = -1 // InvalidBlade is used when a return value is needed for a blade but where // the value cannot be used in any way other than for comparison. // InvalidBlade int64 = -1 )
Variables ¶
This section is empty.
Functions ¶
func FullyQualifyName ¶
FullyQualifyName applies the table name to the relative key string. It returns a key string that has been specialized to the table name.
func GetKeyForBlade ¶
GetKeyForBlade generates the key to operate on the record for a blade by any specific table (definition, actual, observed, target)
func GetKeyForIndexBlades ¶
GetKeyForIndexBlades generates the key to discover the list of blades by any specific table (definition, actual, observed, target)
func GetKeyForIndexEntryBlade ¶
GetKeyForIndexEntryBlade generates the key to create an index entry for a blade by any specific table (definition, actual, observed, target)
func GetKeyForIndexEntryPdu ¶
GetKeyForIndexEntryPdu generates the key to create an index entry for a pdu by any specific table (definition, actual, observed, target)
func GetKeyForIndexEntryRack ¶
GetKeyForIndexEntryRack generates the key to create an index entry for a rack by any specific table (definition, actual, observed, target)
func GetKeyForIndexEntryRegion ¶
GetKeyForIndexEntryRegion generates the key to create an index entry for a region by any specific table (definition, actual, observed, target)
func GetKeyForIndexEntryTor ¶
GetKeyForIndexEntryTor generates the key to create an index entry for a tor by any specific table (definition, actual, observed, target)
func GetKeyForIndexEntryZone ¶
GetKeyForIndexEntryZone generates the key to create an index entry for a zone by any specific table (definition, actual, observed, target)
func GetKeyForIndexPdus ¶
GetKeyForIndexPdus generates the key to discover the list of pdus by any specific table (definition, actual, observed, target)
func GetKeyForIndexRacks ¶
GetKeyForIndexRacks generates the key to discover the list of racks by any specific table (definition, actual, observed, target)
func GetKeyForIndexRegions ¶
func GetKeyForIndexRegions() string
GetKeyForIndexRegions generates the key to discover the list of regions by any specific table (definition, actual, observed, target)
func GetKeyForIndexTors ¶
GetKeyForIndexTors generates the key to discover the list of tors by any specific table (definition, actual, observed, target)
func GetKeyForIndexZones ¶
GetKeyForIndexZones generates the key to discover the list of zones by any specific table (definition, actual, observed, target)
func GetKeyForPdu ¶
GetKeyForPdu generates the key to operate on the record for a pdu by any specific table (definition, actual, observed, target)
func GetKeyForRack ¶
GetKeyForRack generates the key to operate on the record for a rack by any specific table (definition, actual, observed, target)
func GetKeyForRegion ¶
GetKeyForRegion generates the key to operate on the record for a region by any specific table (definition, actual, observed, target)
func GetKeyForTor ¶
GetKeyForTor generates the key to operate on the record for a tor by any specific table (definition, actual, observed, target)
func GetKeyForZone ¶
GetKeyForZone generates the key to operate on the record for a zone by any specific table (definition, actual, observed, target)
func GetKeyFromUsername ¶
GetKeyFromUsername is a utility function to convert a supplied username to a store usable key for use when operating with user records.
func GetNormalizedName ¶
GetNormalizedName is a utility function to prepare a name for use when building a key suitable for operating with records in the store
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
func GetAddressFromKey ¶
GetAddressFromKey is a function to parse a key string, typically as returned by a watch event and generate a generic address for that string.
Keys follow a number of rules ¶
must contain no spaces use fields separated by a "/" character must begin with either "index" or "data" must contain a second field which is one of the legal table names must contain a set of 1 or more pairs of fields where the first field is the item type and the second field is the item instance. The item type is one of
- "region"
- "zone"
- "rack"
- "pdu"
- "tor"
- "blade"
Item type region, zone, and rack have string instance fields. Item types pdu, tor and blade have integer instance fields
func (*Address) Type ¶
func (a *Address) Type() AddressType
type AddressType ¶
type AddressType int64
const ( AddressTypeInvalid AddressType = iota AddressTypeRegion AddressTypeZone AddressTypeRack AddressTypePdu AddressTypeTor AddressTypeBlade )
type KeyRoot ¶
type KeyRoot int
KeyRoot is used to describe which part of the store namespace should be used for the corresponding record access.
type TableNameSet ¶
type TableNameSet interface { Definition() TableName Actual() TableName Observed() TableName Target() TableName }
TableNameSet specifies the table names to use for each of the different views.
func NewTableNameSet ¶
func NewTableNameSet( definition TableName, actual TableName, observed TableName, target TableName) (TableNameSet, error)
NewTableNameSet creates a table name set with the specified set of table names for the different views. The table names must not be empty.