Documentation
¶
Index ¶
- type Artifact
- type Command
- func (ec Command) DebugString() string
- func (ec Command) GetGitURL() string
- func (ec Command) GetImportRef() string
- func (ec Command) GetLocalPath() string
- func (ec Command) GetName() string
- func (ec Command) GetTag() string
- func (ec Command) IsExternal() bool
- func (ec Command) IsImportReference() bool
- func (ec Command) IsLocalExternal() bool
- func (ec Command) IsLocalInternal() bool
- func (ec Command) IsRemote() bool
- func (ec Command) IsUnresolvedImportReference() bool
- func (ec Command) ProjectCanonical() string
- func (ec Command) String() string
- func (ec Command) StringCanonical() string
- type ImportTracker
- func (ir *ImportTracker) Add(importStr string, as string, ...) error
- func (ir *ImportTracker) Deref(ref Reference) (resolvedRef Reference, allowPrivileged, allowPrivilegedSet bool, err error)
- func (ir *ImportTracker) Global() map[string]ImportTrackerVal
- func (ir *ImportTracker) SetGlobal(gi map[string]ImportTrackerVal)
- type ImportTrackerVal
- type Reference
- type Target
- func (et Target) DebugString() string
- func (et Target) GetGitURL() string
- func (et Target) GetImportRef() string
- func (et Target) GetLocalPath() string
- func (et Target) GetName() string
- func (et Target) GetTag() string
- func (et Target) IsExternal() bool
- func (et Target) IsImportReference() bool
- func (et Target) IsLocalExternal() bool
- func (et Target) IsLocalInternal() bool
- func (et Target) IsRemote() bool
- func (et Target) IsUnresolvedImportReference() bool
- func (et Target) ProjectCanonical() string
- func (et Target) String() string
- func (et Target) StringCanonical() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
Artifact is an earthly artifact identifier.
func ParseArtifact ¶
ParseArtifact parses a string representation of an Artifact.
func (Artifact) StringCanonical ¶
StringCanonical returns a string representation of the Artifact.
type Command ¶
type Command struct {
// Remote representation.
GitURL string `json:"gitUrl"` // e.g. "github.com/EarthBuild/earthbuild/examples/go"
Tag string `json:"tag"` // e.g. "main"
// Local representation. E.g. in "./some/path+something" this is "./some/path".
LocalPath string `json:"localPath"`
// Import representation. E.g. in "foo+bar" this is "foo".
ImportRef string `json:"importRef"`
// Command name. E.g. in "+SOMETHING" this is "SOMETHING".
Command string `json:"command"`
}
Command is an earthly command identifier.
func ParseCommand ¶
ParseCommand parses a string into a Command.
func (Command) DebugString ¶
DebugString returns a string that can be printed out for debugging purposes.
func (Command) GetImportRef ¶
GetImportRef returns the ImportRef portion of the command.
func (Command) GetLocalPath ¶
GetLocalPath returns the Path portion of the command.
func (Command) IsExternal ¶
IsExternal returns whether the command is external to the current project.
func (Command) IsImportReference ¶
IsImportReference returns whether the target is a reference to an import.
func (Command) IsLocalExternal ¶
IsLocalExternal returns whether the command is a local, but external command.
func (Command) IsLocalInternal ¶
IsLocalInternal returns whether the command is in the same Earthfile.
func (Command) IsUnresolvedImportReference ¶
IsUnresolvedImportReference returns whether the command is an import reference that has no remote or local information set.
func (Command) ProjectCanonical ¶
ProjectCanonical returns a string representation of the project of the command, in canonical form.
func (Command) StringCanonical ¶
StringCanonical returns a string representation of the command, in canonical form.
type ImportTracker ¶
type ImportTracker struct {
// contains filtered or unexported fields
}
ImportTracker is a resolver which also takes into account imports.
func NewImportTracker ¶
func NewImportTracker(console conslogging.ConsoleLogger, global map[string]ImportTrackerVal) *ImportTracker
NewImportTracker creates a new import resolver.
func (*ImportTracker) Add ¶
func (ir *ImportTracker) Add(importStr string, as string, global, currentlyPrivileged, allowPrivilegedFlag bool) error
Add adds an import to the resolver.
func (*ImportTracker) Deref ¶
func (ir *ImportTracker) Deref( ref Reference, ) (resolvedRef Reference, allowPrivileged, allowPrivilegedSet bool, err error)
Deref resolves the import (if any) and returns a reference with the full path.
func (*ImportTracker) Global ¶
func (ir *ImportTracker) Global() map[string]ImportTrackerVal
Global returns the internal map of global imports.
func (*ImportTracker) SetGlobal ¶
func (ir *ImportTracker) SetGlobal(gi map[string]ImportTrackerVal)
SetGlobal sets the global import map.
type ImportTrackerVal ¶
type ImportTrackerVal struct {
// contains filtered or unexported fields
}
ImportTrackerVal is used to resolve imports.
type Reference ¶
type Reference interface {
// GetGitURL is the git URL part of the reference. E.g. "github.com/EarthBuild/earthbuild/examples/go"
GetGitURL() string
// GetTag is the git tag of the reference. E.g. "main"
GetTag() string
// GetLocalPath is the local path representation of the reference.
// E.g. in "./some/path+something" this is "./some/path".
GetLocalPath() string
// GetImportRef is the import identifier. E.g. in "foo+bar" this is "foo".
GetImportRef() string
// GetName is the target name or the command name of the reference. E.g. in "+something" this is "something".
GetName() string
// IsExternal returns whether the ref is external to the current project.
IsExternal() bool
// IsLocalInternal returns whether the ref is a local.
IsLocalInternal() bool
// IsLocalExternal returns whether the ref is a local, but external target.
IsLocalExternal() bool
// IsRemote returns whether the ref is remote.
IsRemote() bool
// IsImportReference returns whether the ref is a reference to an import.
IsImportReference() bool
// IsUnresolvedImportReference returns whether the ref is an import reference that has
// no remote or local information set.
IsUnresolvedImportReference() bool
// DebugString returns a string that can be printed out for debugging purposes.
DebugString() string
// String returns a string representation of the ref.
String() string
// StringCanonical returns a string representation of the ref, in canonical form.
StringCanonical() string
// ProjectCanonical returns a string representation of the project of the ref, in canonical form.
ProjectCanonical() string
}
Reference is a target or a command reference.
type Target ¶
type Target struct {
// Remote representation.
GitURL string `json:"gitUrl"` // e.g. "github.com/EarthBuild/earthbuild/examples/go"
Tag string `json:"tag"` // e.g. "main"
// Local representation. E.g. in "./some/path+something" this is "./some/path".
LocalPath string `json:"localPath"`
// Import representation. E.g. in "foo+bar" this is "foo".
ImportRef string `json:"importRef"`
// Target name. E.g. in "+something" this is "something".
Target string `json:"target"`
}
Target is an earthly target identifier.
func ParseTarget ¶
ParseTarget parses a string into a Target.
func (Target) DebugString ¶
DebugString returns a string that can be printed out for debugging purposes.
func (Target) GetImportRef ¶
GetImportRef returns the ImportRef portion of the target.
func (Target) GetLocalPath ¶
GetLocalPath returns the Path portion of the target.
func (Target) IsExternal ¶
IsExternal returns whether the target is external to the current project.
func (Target) IsImportReference ¶
IsImportReference returns whether the target is a reference to an import.
func (Target) IsLocalExternal ¶
IsLocalExternal returns whether the target is a local, but external target.
func (Target) IsLocalInternal ¶
IsLocalInternal returns whether the target is in the same Earthfile.
func (Target) IsUnresolvedImportReference ¶
IsUnresolvedImportReference returns whether the target is an import reference that has no remote or local information set.
func (Target) ProjectCanonical ¶
ProjectCanonical returns a string representation of the project of the target, in canonical form.
func (Target) StringCanonical ¶
StringCanonical returns a string representation of the Target, in canonical form.