Documentation ¶
Overview ¶
Package nodesignature computes the signature of a working set. A "working set" is a unordered set of namespaced work units running at any given time on a "node". The "signature" is a unique identifer which is bound to that specific working set. This allows to uniquely and concisely identify a workingset without enumerating - and storing - all the names all the time. This concepts maps nicely on kubernetes (but is not limited to): "namespaced work units" = pods and "node" = (kubernetes) nodes.
Index ¶
Constants ¶
View Source
const ( // Prefix is the string common to all the signatures // A prefix is always 4 bytes long Prefix = "nsgn" // Version is the version of this signature. You should // only compare compatible versions. // A Version is always 4 bytes long, in the form v\d\d\d Version = "v001" )
Variables ¶
View Source
var ( ErrMalformed = fmt.Errorf("malformed signature") ErrIncompatibleVersion = fmt.Errorf("incompatible version") )
Functions ¶
func IsVersionCompatible ¶
Types ¶
type NodeSignature ¶
type NodeSignature struct {
// contains filtered or unexported fields
}
func NewNodeSignature ¶
func NewNodeSignature() *NodeSignature
func (*NodeSignature) Add ¶
func (ns *NodeSignature) Add(namespace, name string) error
func (*NodeSignature) Check ¶
func (ns *NodeSignature) Check(sign string) error
func (*NodeSignature) Len ¶
func (ns *NodeSignature) Len() int
func (*NodeSignature) Sign ¶
func (ns *NodeSignature) Sign() string
func (*NodeSignature) Sum ¶
func (ns *NodeSignature) Sum() []byte
Click to show internal directories.
Click to hide internal directories.