class

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SupportsVersion added in v1.3.2

func SupportsVersion(requested, supported string) bool

SupportsVersion reports whether the requested version is satisfied by the supported version. An empty requested version is treated as compatible. Versions are numeric suffixes: "v0", "v1", etc.

Types

type Class

type Class string

Class is a full policy runtime specification: the base evaluator name@version plus optional plugin and transformer version requirements. Format: "name@version[?plugin:name=version[&transformer:name=version...]]" Example: "cel@v1?plugin:semver=v1&transformer:protobom=v1"

func MustParseClass added in v1.3.2

func MustParseClass(s string) Class

MustParseClass parses a class string and panics on error. Intended for package-level var declarations and test helpers.

func ParseClass added in v1.3.2

func ParseClass(s string) (Class, error)

ParseClass parses and validates a class string. The evaluator name must be non-empty, and versions must be in vN format. Each query param key must have a recognised prefix ("plugin:" or "transformer:"), a non-empty name, and a valid vN version value.

func (*Class) BaseClass added in v1.3.2

func (c *Class) BaseClass() Class

BaseClass returns the base "name@version" part of the class, stripping any plugin/transformer requirements.

func (*Class) Identity added in v1.3.2

func (c *Class) Identity() *Identity

Identity returns the base name and version as a parsed Identity. Panics if the class string is malformed; use ParseClass before calling this.

func (*Class) Name

func (c *Class) Name() string

Name returns the evaluator name from the class.

func (*Class) Plugins added in v1.3.2

func (c *Class) Plugins() map[string]string

Plugins returns the plugin name→version requirements declared in the class. Returns nil if no plugin requirements are set.

func (*Class) String added in v1.3.2

func (c *Class) String() string

String returns the class string.

func (*Class) Transformers added in v1.3.2

func (c *Class) Transformers() map[string]string

Transformers returns the transformer name→version requirements declared in the class. Returns nil if no transformer requirements are set.

func (*Class) Version

func (c *Class) Version() string

Version returns the evaluator version from the class.

type Identity added in v1.3.2

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

Identity is a validated versioned name identifier for a plugin or transformer. Format: "name@vN"

func MustParseIdentity added in v1.3.2

func MustParseIdentity(s string) *Identity

MustParseIdentity parses a versioned name string and panics on error.

func ParseIdentity added in v1.3.2

func ParseIdentity(s string) (*Identity, error)

ParseIdentity parses and validates a versioned name string.

func (*Identity) Name added in v1.3.2

func (i *Identity) Name() string

func (*Identity) String added in v1.3.2

func (i *Identity) String() string

func (*Identity) Version added in v1.3.2

func (i *Identity) Version() string

Jump to

Keyboard shortcuts

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