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 bool, allowPrivilegedSet bool, ...)
- 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 a Artifact.
func (Artifact) StringCanonical ¶
StringCanonical returns a string representation of the Artifact.
type Command ¶ added in v0.6.15
type Command struct { // Remote representation. GitURL string `json:"gitUrl"` // e.g. "github.com/earthly/earthly/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 ¶ added in v0.6.15
ParseCommand parses a string into a Command.
func (Command) DebugString ¶ added in v0.6.15
DebugString returns a string that can be printed out for debugging purposes
func (Command) GetImportRef ¶ added in v0.6.15
GetImportRef returns the ImportRef portion of the command.
func (Command) GetLocalPath ¶ added in v0.6.15
GetLocalPath returns the Path portion of the command.
func (Command) IsExternal ¶ added in v0.6.15
IsExternal returns whether the command is external to the current project.
func (Command) IsImportReference ¶ added in v0.6.15
IsImportReference returns whether the target is a reference to an import.
func (Command) IsLocalExternal ¶ added in v0.6.15
IsLocalExternal returns whether the command is a local, but external command.
func (Command) IsLocalInternal ¶ added in v0.6.15
IsLocalInternal returns whether the command is in the same Earthfile.
func (Command) IsUnresolvedImportReference ¶ added in v0.6.15
IsUnresolvedImportReference returns whether the command is an import reference that has no remote or local information set.
func (Command) ProjectCanonical ¶ added in v0.6.15
ProjectCanonical returns a string representation of the project of the command, in canonical form.
func (Command) StringCanonical ¶ added in v0.6.15
StringCanonical returns a string representation of the command, in canonical form.
type ImportTracker ¶ added in v0.6.15
type ImportTracker struct {
// contains filtered or unexported fields
}
ImportTracker is a resolver which also takes into account imports.
func NewImportTracker ¶ added in v0.6.15
func NewImportTracker(console conslogging.ConsoleLogger, global map[string]ImportTrackerVal) *ImportTracker
NewImportTracker creates a new import resolver.
func (*ImportTracker) Add ¶ added in v0.6.15
func (ir *ImportTracker) Add(importStr string, as string, global, currentlyPrivileged, allowPrivilegedFlag bool) error
Add adds an import to the resolver.
func (*ImportTracker) Deref ¶ added in v0.6.15
func (ir *ImportTracker) Deref(ref Reference) (resolvedRef Reference, allowPrivileged bool, allowPrivilegedSet bool, err error)
Deref resolves the import (if any) and returns a reference with the full path.
func (*ImportTracker) Global ¶ added in v0.6.15
func (ir *ImportTracker) Global() map[string]ImportTrackerVal
Global returns the internal map of global imports.
func (*ImportTracker) SetGlobal ¶ added in v0.6.15
func (ir *ImportTracker) SetGlobal(gi map[string]ImportTrackerVal)
SetGlobal sets the global import map.
type ImportTrackerVal ¶ added in v0.6.15
type ImportTrackerVal struct {
// contains filtered or unexported fields
}
ImportTrackerVal is used to resolve imports
type Reference ¶ added in v0.6.15
type Reference interface { // GetGitURL is the git URL part of the reference. E.g. "github.com/earthly/earthly/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/earthly/earthly/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 ¶ added in v0.4.0
DebugString returns a string that can be printed out for debugging purposes
func (Target) GetImportRef ¶ added in v0.6.15
GetImportRef returns the ImportRef portion of the target.
func (Target) GetLocalPath ¶ added in v0.6.15
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 ¶ added in v0.6.15
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 ¶ added in v0.6.15
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.