resourceid

package
v3.0.0-rc49 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckName

func CheckName(s string) error

CheckName returns an error when s holds a character no resource id, nor pattern of them, is made of.

func IsExact

func IsExact(s string) bool

IsExact reports whether an expression element names one resource, rather than filtering on a set of them.

A driver group like "sync" and a pattern like "fs#d*" are filters: they say which of the resources an object has to act on, and an object having none is an object with nothing to do. A literal resource id like "fs#1" is a selection: it names a resource, and an object not having it was asked for something it cannot do.

The rules follow Match: an element parsing as a driver group with no index filters on that group, and every other element is matched with fnmatch, so it selects only when it holds no wildcard.

func Match

func Match(s1, s2 string) bool

Types

type T

type T struct {
	Name string
	// contains filtered or unexported fields
}

func Parse

func Parse(s string) (*T, error)

func (*T) DriverGroup

func (t *T) DriverGroup() driver.Group

func (*T) Index

func (t *T) Index() string

func (*T) IsIndexed

func (t *T) IsIndexed() bool

IsIndexed reports whether the id has the <group>#<index> shape a resource section has.

A section without it, as a bare "node", names no resource, whatever its group: it is a section of another purpose, or of none.

func (*T) IsZero

func (t *T) IsZero() bool

func (T) MarshalJSON

func (t T) MarshalJSON() ([]byte, error)

func (T) Match

func (t T) Match(s string) bool

func (T) MatchUnion

func (t T) MatchUnion(s string) bool

func (T) String

func (t T) String() string

func (*T) UnmarshalJSON

func (t *T) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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