elemhdlr

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccessOutput = []string{"ACCESSTYPE", "ACCESSSPEC"}
View Source
var MetaOutput = []string{"NAME", "VERSION", "IDENTITY"}

Sort is a processing chain sorting original objects provided by type handler.

Functions

func Compare

func Compare(a, b interface{}) int

func MapAccessOutput

func MapAccessOutput(e compdesc.AccessSpec) []string

func MapMetaOutput

func MapMetaOutput(e interface{}) []string

func MapNodeOutput

func MapNodeOutput(e interface{}) []string

func MapToCompHandlerOptions

func MapToCompHandlerOptions(opts ...Option) comphdlr.Options

func NewTypeHandler

func NewTypeHandler(octx clictx.OCM, oopts *output.Options, repobase ocm.Repository, session ocm.Session, kind string, compspecs []string, elemaccess func(ocm.ComponentVersionAccess) compdesc.ElementListAccessor, hopts ...Option) (utils.TypeHandler, error)

func NodeMapping

func NodeMapping(n int) output.TreeOutputOption

func NodeTitle

func NodeTitle(obj *tree.TreeObject) string

Types

type ElementFilter

type ElementFilter interface {
	Accept(e compdesc.ElementMetaAccessor) bool
}

type Manifest

type Manifest struct {
	History common.History   `json:"context"`
	Element compdesc.Element `json:"element"`
}

type Object

type Object struct {
	History   common.History
	Version   ocm.ComponentVersionAccess
	VersionId metav1.Identity

	Spec    metav1.Identity
	Index   int
	Id      metav1.Identity
	Node    *common.NameVersion
	Element compdesc.ElementMetaAccessor
}

func (*Object) AsManifest

func (o *Object) AsManifest() interface{}

func (*Object) Compare

func (o *Object) Compare(b *Object) int

func (*Object) GetHistory

func (o *Object) GetHistory() common.History

func (*Object) IsNode

func (o *Object) IsNode() *common.NameVersion

func (*Object) IsValid

func (o *Object) IsValid() bool

func (*Object) String

func (o *Object) String() string

type Objects

type Objects []*Object

func ObjectSlice

func ObjectSlice(s data.Iterable) Objects

func (Objects) Get

func (this Objects) Get(i int) interface{}

func (Objects) Iterator

func (this Objects) Iterator() data.Iterator

func (Objects) Len

func (this Objects) Len() int

type Option

type Option interface {
	ApplyToElemHandler(handler *TypeHandler)
}

func ForceEmpty

func ForceEmpty(b bool) Option

func LatestOnly

func LatestOnly(b ...bool) Option

func WithFilter

func WithFilter(fi ElementFilter) Option

func WithVersionConstraints

func WithVersionConstraints(c []*semver.Constraints) Option

type Options

type Options []Option

func OptionsFor

func OptionsFor(o options.OptionSetProvider) Options

func (Options) ApplyToElemHandler

func (o Options) ApplyToElemHandler(handler *TypeHandler)

type TypeHandler

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

func (*TypeHandler) All

func (h *TypeHandler) All() ([]output.Object, error)

func (*TypeHandler) Close

func (h *TypeHandler) Close() error

func (*TypeHandler) Get

func (h *TypeHandler) Get(elemspec utils.ElemSpec) ([]output.Object, error)

func (*TypeHandler) SetFilter

func (h *TypeHandler) SetFilter(f ElementFilter)

Jump to

Keyboard shortcuts

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