cli

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PickLatestMajorVersion added in v0.2.0

func PickLatestMajorVersion(versions api.LeafVersionsResult, leaf string, _ string) (string, error)

func PickLatestMinorVersion added in v0.2.0

func PickLatestMinorVersion(versions api.LeafVersionsResult, leaf string, major string) (string, error)

Types

type APIClient added in v0.0.9

type APIClient interface {
	GetDebugConnectionInfo(debugKey string) (api.DebugConnectionInfo, error)
	InitiateRun(api.InitiateRunConfig) (*api.InitiateRunResult, error)
	ObtainAuthCode(api.ObtainAuthCodeConfig) (*api.ObtainAuthCodeResult, error)
	AcquireToken(tokenUrl string) (*api.AcquireTokenResult, error)
	Whoami() (*api.WhoamiResult, error)
	SetSecretsInVault(api.SetSecretsInVaultConfig) (*api.SetSecretsInVaultResult, error)
	GetLeafVersions() (*api.LeafVersionsResult, error)
}

type Config

type Config struct {
	APIClient  APIClient
	FileSystem fs.FileSystem
	SSHClient  SSHClient
}

func (Config) Validate

func (c Config) Validate() error

type DebugTaskConfig added in v0.0.9

type DebugTaskConfig struct {
	DebugKey string
}

func (DebugTaskConfig) Validate added in v0.0.9

func (c DebugTaskConfig) Validate() error

type InitiateRunConfig

type InitiateRunConfig struct {
	InitParameters map[string]string
	Json           bool
	MintDirectory  string
	MintFilePath   string
	NoCache        bool
	TargetedTasks  []string
	Title          string
}

func (InitiateRunConfig) Validate

func (c InitiateRunConfig) Validate() error

type LoginConfig added in v0.0.9

type LoginConfig struct {
	DeviceName         string
	AccessTokenBackend accesstoken.Backend
	Stdout             io.Writer
	OpenUrl            func(url string) error
}

func (LoginConfig) Validate added in v0.0.9

func (c LoginConfig) Validate() error

type SSHClient added in v0.0.9

type SSHClient interface {
	Close() error
	Connect(addr string, cfg ssh.ClientConfig) error
	InteractiveSession() error
}

type Service

type Service struct {
	Config
}

Service holds the main business logic of the CLI.

func NewService

func NewService(cfg Config) (Service, error)

func (Service) DebugTask added in v0.0.9

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) 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) Login added in v0.0.9

func (s Service) Login(cfg LoginConfig) error

InitiateRun will connect to the Cloud API and start a new run in Mint.

func (Service) SetSecretsInVault added in v0.0.12

func (s Service) SetSecretsInVault(cfg SetSecretsInVaultConfig) error

func (Service) UpdateLeaves added in v0.2.0

func (s Service) UpdateLeaves(cfg UpdateLeavesConfig) error

func (Service) Whoami added in v0.0.10

func (s Service) Whoami(cfg WhoamiConfig) error

type SetSecretsInVaultConfig added in v0.0.12

type SetSecretsInVaultConfig struct {
	Secrets []string
	Vault   string
	File    string
	Stdout  io.Writer
}

func (SetSecretsInVaultConfig) Validate added in v0.0.12

func (c SetSecretsInVaultConfig) Validate() error

type UpdateLeavesConfig added in v0.2.0

type UpdateLeavesConfig struct {
	DefaultDir               string
	Files                    []string
	ReplacementVersionPicker func(versions api.LeafVersionsResult, leaf string, major string) (string, error)
	Stdout                   io.Writer
	Stderr                   io.Writer
}

func (UpdateLeavesConfig) Validate added in v0.2.0

func (c UpdateLeavesConfig) Validate() error

type WhoamiConfig added in v0.0.10

type WhoamiConfig struct {
	Json   bool
	Stdout io.Writer
}

func (WhoamiConfig) Validate added in v0.0.10

func (c WhoamiConfig) Validate() error

Jump to

Keyboard shortcuts

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