nodesignature

package module
v0.0.0-...-36b9157 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

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 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.

LICENSE

apache v2

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

func IsVersionCompatible(ver string) (bool, error)

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

Jump to

Keyboard shortcuts

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