Documentation
¶
Index ¶
- Constants
- Variables
- func Map[T any, R any](input []T, transformer func(T) R) []R
- func PickLatestMajorVersion(versions api.PackageVersionsResult, rwxPackage string, _ string) (string, error)
- func PickLatestMinorVersion(versions api.PackageVersionsResult, rwxPackage string, major string) (string, error)
- type APIClient
- type BaseLayerRunFile
- type BaseLayerSpec
- type Config
- type DebugTaskConfig
- type GetDispatchConfig
- type GetDispatchRun
- type GitClient
- type InitiateDispatchConfig
- type InitiateRunConfig
- type LintConfig
- type LintOutputFormat
- type LoginConfig
- type MintYAMLFile
- type PackageVersion
- type PushImageConfig
- type PushImageOutput
- type ResolveBaseConfig
- type ResolveBaseResult
- type ResolvePackagesConfig
- type ResolvePackagesResult
- type RwxDirectoryEntry
- type SSHClient
- type Service
- func (s Service) DebugTask(cfg DebugTaskConfig) error
- func (s Service) GetDispatch(cfg GetDispatchConfig) ([]GetDispatchRun, error)
- func (s Service) InitiateDispatch(cfg InitiateDispatchConfig) (*api.InitiateDispatchResult, error)
- func (s Service) InitiateRun(cfg InitiateRunConfig) (*api.InitiateRunResult, error)
- func (s Service) Lint(cfg LintConfig) (*api.LintResult, error)
- func (s Service) Login(cfg LoginConfig) error
- func (s Service) PushImage(config PushImageConfig) error
- func (s Service) ResolveBase(cfg ResolveBaseConfig) (ResolveBaseResult, error)
- func (s Service) ResolvePackages(cfg ResolvePackagesConfig) (ResolvePackagesResult, error)
- func (s Service) SetSecretsInVault(cfg SetSecretsInVaultConfig) error
- func (s Service) UpdateBase(cfg UpdateBaseConfig) (ResolveBaseResult, error)
- func (s Service) UpdatePackages(cfg UpdatePackagesConfig) error
- func (s Service) Whoami(cfg WhoamiConfig) error
- type SetSecretsInVaultConfig
- type TaskDefinition
- type UpdateBaseConfig
- type UpdatePackagesConfig
- type WhoamiConfig
- type YAMLDoc
- func (doc *YAMLDoc) AllTasksAreEmbeddedRuns() bool
- func (doc *YAMLDoc) Bytes() []byte
- func (doc *YAMLDoc) ForEachNode(yamlPath string, f func(node ast.Node) error) error
- func (doc *YAMLDoc) HasBase() bool
- func (doc *YAMLDoc) HasChanges() bool
- func (doc *YAMLDoc) HasTasks() bool
- func (doc *YAMLDoc) InsertBefore(beforeYamlPath string, value any) error
- func (doc *YAMLDoc) IsListOfTasks() bool
- func (doc *YAMLDoc) IsRunDefinition() bool
- func (doc *YAMLDoc) MergeAtPath(yamlPath string, value any) error
- func (doc *YAMLDoc) ReadStringAtPath(yamlPath string) (string, error)
- func (doc *YAMLDoc) ReplaceAtPath(yamlPath string, replacement any) error
- func (doc *YAMLDoc) SetAtPath(yamlPath string, value any) error
- func (doc *YAMLDoc) String() string
- func (doc *YAMLDoc) TryReadStringAtPath(yamlPath string) string
- func (doc *YAMLDoc) WriteFile(path string) error
Constants ¶
View Source
const DefaultArch = "x86_64"
Variables ¶
View Source
var HandledError = errors.New("handled error")
Functions ¶
func PickLatestMajorVersion ¶
func PickLatestMinorVersion ¶
Types ¶
type APIClient ¶
type APIClient interface {
GetDebugConnectionInfo(debugKey string) (api.DebugConnectionInfo, error)
GetDispatch(api.GetDispatchConfig) (*api.GetDispatchResult, error)
InitiateRun(api.InitiateRunConfig) (*api.InitiateRunResult, error)
InitiateDispatch(api.InitiateDispatchConfig) (*api.InitiateDispatchResult, error)
ObtainAuthCode(api.ObtainAuthCodeConfig) (*api.ObtainAuthCodeResult, error)
AcquireToken(tokenUrl string) (*api.AcquireTokenResult, error)
Lint(api.LintConfig) (*api.LintResult, error)
Whoami() (*api.WhoamiResult, error)
SetSecretsInVault(api.SetSecretsInVaultConfig) (*api.SetSecretsInVaultResult, error)
GetPackageVersions() (*api.PackageVersionsResult, error)
ResolveBaseLayer(api.ResolveBaseLayerConfig) (api.ResolveBaseLayerResult, error)
StartImagePush(cfg api.StartImagePushConfig) (api.StartImagePushResult, error)
ImagePushStatus(pushID string) (api.ImagePushStatusResult, error)
}
type BaseLayerRunFile ¶
type BaseLayerRunFile struct {
Spec BaseLayerSpec
OriginalBase BaseLayerSpec
ResolvedBase BaseLayerSpec
OriginalPath string
Error error
}
func (BaseLayerRunFile) HasChanges ¶
func (rf BaseLayerRunFile) HasChanges() bool
type BaseLayerSpec ¶
type BaseLayerSpec struct {
Os string `yaml:"os"`
Tag string `yaml:"tag"`
Arch string `yaml:"arch"`
}
func (BaseLayerSpec) Equal ¶
func (b BaseLayerSpec) Equal(other BaseLayerSpec) bool
func (BaseLayerSpec) Merge ¶
func (b BaseLayerSpec) Merge(other BaseLayerSpec) BaseLayerSpec
func (BaseLayerSpec) TagVersion ¶
func (b BaseLayerSpec) TagVersion() *semver.Version
type Config ¶
type DebugTaskConfig ¶
type DebugTaskConfig struct {
DebugKey string
}
func (DebugTaskConfig) Validate ¶
func (c DebugTaskConfig) Validate() error
type GetDispatchConfig ¶
type GetDispatchConfig struct {
DispatchId string
}
type GetDispatchRun ¶
type InitiateDispatchConfig ¶
type InitiateDispatchConfig struct {
DispatchKey string
Params map[string]string
Ref string
Json bool
Title string
}
func (InitiateDispatchConfig) Validate ¶
func (c InitiateDispatchConfig) Validate() error
type InitiateRunConfig ¶
type InitiateRunConfig struct {
InitParameters map[string]string
Json bool
RwxDirectory string
MintFilePath string
NoCache bool
TargetedTasks []string
Title string
GitBranch string
GitSha string
}
func (InitiateRunConfig) Validate ¶
func (c InitiateRunConfig) Validate() error
type LintConfig ¶
type LintConfig struct {
RwxDirectory string
OutputFormat LintOutputFormat
}
func NewLintConfig ¶
func NewLintConfig(rwxDir string, formatString string) (LintConfig, error)
func (LintConfig) Validate ¶
func (c LintConfig) Validate() error
type LintOutputFormat ¶
type LintOutputFormat int
const ( LintOutputNone LintOutputFormat = iota LintOutputOneLine LintOutputMultiLine )
type LoginConfig ¶
type LoginConfig struct {
DeviceName string
AccessTokenBackend accesstoken.Backend
OpenUrl func(url string) error
PollInterval time.Duration
}
func (LoginConfig) Validate ¶
func (c LoginConfig) Validate() error
type MintYAMLFile ¶
type MintYAMLFile struct {
Entry RwxDirectoryEntry
Doc *YAMLDoc
}
type PackageVersion ¶ added in v1.9.0
type PushImageConfig ¶ added in v1.12.0
type PushImageConfig struct {
TaskID string
References []reference.Named
DockerCLI dockercli.AuthConfigurator
JSON bool
Wait bool
OpenURL func(url string) error
PollInterval time.Duration
}
func NewPushImageConfig ¶ added in v1.12.0
type PushImageOutput ¶ added in v1.12.0
type ResolveBaseConfig ¶
type ResolveBaseConfig struct {
RwxDirectory string
Files []string
Os string
Tag string
Arch string
}
func (ResolveBaseConfig) Validate ¶
func (c ResolveBaseConfig) Validate() error
type ResolveBaseResult ¶
type ResolveBaseResult struct {
ErroredRunFiles []BaseLayerRunFile
UpdatedRunFiles []BaseLayerRunFile
}
func (ResolveBaseResult) HasChanges ¶
func (r ResolveBaseResult) HasChanges() bool
type ResolvePackagesConfig ¶ added in v1.9.0
type ResolvePackagesConfig struct {
RwxDirectory string
Files []string
LatestVersionPicker func(versions api.PackageVersionsResult, rwxPackage string, _ string) (string, error)
}
func (ResolvePackagesConfig) PickLatestVersion ¶ added in v1.9.0
func (c ResolvePackagesConfig) PickLatestVersion(versions api.PackageVersionsResult, rwxPackage string) (string, error)
func (ResolvePackagesConfig) Validate ¶ added in v1.9.0
func (c ResolvePackagesConfig) Validate() error
type ResolvePackagesResult ¶ added in v1.9.0
func (ResolvePackagesResult) HasChanges ¶ added in v1.9.0
func (r ResolvePackagesResult) HasChanges() bool
type RwxDirectoryEntry ¶
type RwxDirectoryEntry = api.RwxDirectoryEntry
type Service ¶
type Service struct {
Config
}
Service holds the main business logic of the CLI.
func NewService ¶
func (Service) DebugTask ¶
func (s Service) DebugTask(cfg DebugTaskConfig) error
DebugRunConfig will connect to a running task over SSH. Key exchange is facilitated over the Cloud API.
func (Service) GetDispatch ¶
func (s Service) GetDispatch(cfg GetDispatchConfig) ([]GetDispatchRun, error)
func (Service) InitiateDispatch ¶
func (s Service) InitiateDispatch(cfg InitiateDispatchConfig) (*api.InitiateDispatchResult, error)
func (Service) InitiateRun ¶
func (s Service) InitiateRun(cfg InitiateRunConfig) (*api.InitiateRunResult, error)
InitiateRun will connect to the Cloud API and start a new run in Mint.
func (Service) Lint ¶
func (s Service) Lint(cfg LintConfig) (*api.LintResult, error)
func (Service) Login ¶
func (s Service) Login(cfg LoginConfig) error
func (Service) PushImage ¶ added in v1.12.0
func (s Service) PushImage(config PushImageConfig) error
func (Service) ResolveBase ¶
func (s Service) ResolveBase(cfg ResolveBaseConfig) (ResolveBaseResult, error)
func (Service) ResolvePackages ¶ added in v1.9.0
func (s Service) ResolvePackages(cfg ResolvePackagesConfig) (ResolvePackagesResult, error)
func (Service) SetSecretsInVault ¶
func (s Service) SetSecretsInVault(cfg SetSecretsInVaultConfig) error
func (Service) UpdateBase ¶
func (s Service) UpdateBase(cfg UpdateBaseConfig) (ResolveBaseResult, error)
func (Service) UpdatePackages ¶ added in v1.9.0
func (s Service) UpdatePackages(cfg UpdatePackagesConfig) error
func (Service) Whoami ¶
func (s Service) Whoami(cfg WhoamiConfig) error
type SetSecretsInVaultConfig ¶
func (SetSecretsInVaultConfig) Validate ¶
func (c SetSecretsInVaultConfig) Validate() error
type TaskDefinition ¶
type TaskDefinition = api.TaskDefinition
type UpdateBaseConfig ¶
func (UpdateBaseConfig) Validate ¶
func (c UpdateBaseConfig) Validate() error
type UpdatePackagesConfig ¶ added in v1.9.0
type UpdatePackagesConfig struct {
RwxDirectory string
Files []string
ReplacementVersionPicker func(versions api.PackageVersionsResult, rwxPackage string, major string) (string, error)
}
func (UpdatePackagesConfig) Validate ¶ added in v1.9.0
func (c UpdatePackagesConfig) Validate() error
type WhoamiConfig ¶
type WhoamiConfig struct {
Json bool
}
func (WhoamiConfig) Validate ¶
func (c WhoamiConfig) Validate() error
type YAMLDoc ¶
type YAMLDoc struct {
// contains filtered or unexported fields
}
func ParseYAMLDoc ¶
func ParseYAMLFile ¶
func (*YAMLDoc) AllTasksAreEmbeddedRuns ¶ added in v1.12.0
func (*YAMLDoc) ForEachNode ¶
func (*YAMLDoc) HasChanges ¶
func (*YAMLDoc) InsertBefore ¶
func (*YAMLDoc) IsListOfTasks ¶
func (*YAMLDoc) IsRunDefinition ¶
func (*YAMLDoc) ReadStringAtPath ¶
func (*YAMLDoc) ReplaceAtPath ¶
func (*YAMLDoc) TryReadStringAtPath ¶
Click to show internal directories.
Click to hide internal directories.