Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrExists = errors.New("resource already exists") ErrNotFound = errors.New("resource not found") )
View Source
var ( // GlobalID is the zero value of ID, representing the ID of the abstract // top-level "global" entity to which all resources belong. GlobalID = ID{} )
Functions ¶
This section is empty.
Types ¶
type Common ¶ added in v0.2.0
Common provides functionality common to all resources.
func (Common) Ancestors ¶ added in v0.2.0
Ancestors provides a list of successive parents, starting with the direct parents.
func (Common) Dependencies ¶ added in v0.3.4
func (Common) HasAncestor ¶ added in v0.2.0
func (Common) WithDependencies ¶ added in v0.3.4
type ID ¶
ID is a unique identifier for a pug entity.
type Resource ¶
type Resource interface {
// GetID retrieves the unique identifier for the resource.
GetID() ID
// GetKind retrieves the kind of resource.
GetKind() Kind
// GetParent retrieves the resource's parent, the resource from which the
// resource was spawned.
GetParent() Resource
// HasAncestor determines whether the resource has an ancestor with the
// given ID.
HasAncestor(ID) bool
// Ancestors retrieves a list of the resource's ancestors, nearest first.
Ancestors() []Resource
// String is a human-readable identifier for the resource. Not necessarily
// unique across pug.
String() string
// Module retrieves the resource's module. Returns nil if the resource does
// not have a module ancestor.
Module() Resource
// Workspace retrieves the resource's workspcae. Returns nil if the resource does
// not have a workspace ancestor.
Workspace() Resource
// Dependencies returns both direct dependencies and indirect dependencies that
// ancestor resources have.
Dependencies() []ID
}
Resource is a unique pug entity spawned from another entity.
Click to show internal directories.
Click to hide internal directories.