Documentation ¶
Index ¶
- Constants
- Variables
- func CompareHistoryElement(a, b interface{}) int
- func CompareHistorySource(a, b interface{}) int
- func CompareNameVersion(a, b NameVersion) int
- func DigestToFileName(digest digest.Digest) string
- func Flush(o interface{}) error
- func IterfaceSlice(slice interface{}) []interface{}
- func PathToDigest(path string) digest.Digest
- func SortHistoryElements(s interface{})
- type Flusher
- type FlushingPrinter
- type History
- func (h *History) Add(kind string, nv NameVersion) error
- func (h History) Append(nv ...NameVersion) History
- func (h History) Compare(o History) int
- func (h History) Compare2(o History) (int, bool)
- func (h History) Contains(nv NameVersion) bool
- func (h History) Copy() History
- func (h History) Cycle(nv NameVersion) (History, History)
- func (h History) Equals(o History) bool
- func (h History) HasPrefix(o History) bool
- func (h History) RemovePrefix(prefix History) History
- func (h History) String() string
- type HistoryElement
- type HistorySource
- type NameVersion
- type NameVersionInfo
- type Printer
- type Properties
- func (p Properties) Copy() Properties
- func (p Properties) Digest() ([]byte, error)
- func (p Properties) Equals(o Properties) bool
- func (p Properties) Match(obj map[string]string) (bool, error)
- func (c Properties) Names() set.Set[string]
- func (p Properties) SetNonEmptyValue(name, value string)
- func (c Properties) String() string
- type VersionedElement
- type WalkingState
Constants ¶
const OCM_TYPE_GROUP_SUFFIX = ".ocm.software"
Variables ¶
var ( StdoutPrinter = NewPrinter(os.Stdout) StderrPrinter = NewPrinter(os.Stderr) NonePrinter = NewPrinter(nil) )
Functions ¶
func CompareHistoryElement ¶
func CompareHistoryElement(a, b interface{}) int
func CompareHistorySource ¶
func CompareHistorySource(a, b interface{}) int
func CompareNameVersion ¶ added in v0.10.0
func CompareNameVersion(a, b NameVersion) int
func DigestToFileName ¶
func DigestToFileName(digest digest.Digest) string
DigestToFileName returns the file name for a digest.
func IterfaceSlice ¶
func IterfaceSlice(slice interface{}) []interface{}
func PathToDigest ¶
func PathToDigest(path string) digest.Digest
PathToDigest retuurns the digest encoded into a file name.
func SortHistoryElements ¶
func SortHistoryElements(s interface{})
Types ¶
type FlushingPrinter ¶
func NewLoggingPrinter ¶
func NewLoggingPrinter(log logging.Logger) FlushingPrinter
NewLoggingPrinter returns a printer logging the output to an info-level log. It should not be used to print binary data, but text data, only.
type History ¶
type History []NameVersion
func (*History) Add ¶
func (h *History) Add(kind string, nv NameVersion) error
Add provided a new extended non-cyclic history. If the new entry would lead to a cycle an appropriate error is returned.
func (History) Append ¶
func (h History) Append(nv ...NameVersion) History
Append provides a new extended history without cycle check.
func (History) Contains ¶
func (h History) Contains(nv NameVersion) bool
func (History) RemovePrefix ¶
type HistoryElement ¶
type HistoryElement interface { HistorySource GetKey() NameVersion }
type HistorySource ¶
type HistorySource interface {
GetHistory() History
}
type NameVersion ¶
type NameVersion struct {
// contains filtered or unexported fields
}
func NewNameVersion ¶
func NewNameVersion(name, version string) NameVersion
func ParseNameVersion ¶
func ParseNameVersion(s string) (NameVersion, error)
func VersionedElementKey ¶
func VersionedElementKey(v VersionedElement) NameVersion
func (NameVersion) Compare ¶
func (n NameVersion) Compare(o NameVersion) int
func (NameVersion) GetName ¶
func (n NameVersion) GetName() string
func (NameVersion) GetVersion ¶
func (n NameVersion) GetVersion() string
func (NameVersion) MarshalJSON ¶
func (n NameVersion) MarshalJSON() ([]byte, error)
func (NameVersion) String ¶
func (n NameVersion) String() string
type NameVersionInfo ¶
type NameVersionInfo[T any] map[NameVersion]T
func (NameVersionInfo[T]) Add ¶
func (s NameVersionInfo[T]) Add(nv NameVersion, data ...T) bool
func (NameVersionInfo[T]) Contains ¶
func (s NameVersionInfo[T]) Contains(nv NameVersion) bool
type Printer ¶
type Printer interface { io.Writer Printf(msg string, args ...interface{}) (int, error) AddGap(gap string) Printer }
func AssurePrinter ¶ added in v0.3.0
func NewBufferedPrinter ¶
func NewPrinter ¶
type Properties ¶
Properties describes a set of name/value pairs.
func (Properties) Digest ¶
func (p Properties) Digest() ([]byte, error)
Digest returns the object digest of a Property set.
func (Properties) Equals ¶
func (p Properties) Equals(o Properties) bool
Equals compares two identities.
func (Properties) Match ¶
func (p Properties) Match(obj map[string]string) (bool, error)
Match implements the selector interface.
func (Properties) Names ¶
func (c Properties) Names() set.Set[string]
Names returns the set of property names.
func (Properties) SetNonEmptyValue ¶
func (p Properties) SetNonEmptyValue(name, value string)
func (Properties) String ¶
func (c Properties) String() string
String returns a string representation.
type VersionedElement ¶
type VersionedElement interface { // GetName gets the name of the element GetName() string // GetVersion gets the version of the element GetVersion() string }
VersionedElement describes an element that has a name and a version.
type WalkingState ¶
type WalkingState[T any, C any] struct { LogCtx logging.Context Logger logging.Logger Context C Closure NameVersionInfo[T] History History }
func NewWalkingState ¶
func NewWalkingState[T any, C any](ctx C, lctx ...logging.Context) WalkingState[T, C]
func (*WalkingState[T, C]) Add ¶
func (s *WalkingState[T, C]) Add(kind string, nv NameVersion) (bool, error)
func (*WalkingState[T, C]) Contains ¶
func (s *WalkingState[T, C]) Contains(nv NameVersion) bool
func (*WalkingState[T, C]) Get ¶
func (s *WalkingState[T, C]) Get(nv NameVersion) T