commands

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//Defaults:
	DefaultCPUs           = 4
	DefaultGPUs           = 0
	DefaultMemoryMiB      = 16384
	DefaultSharedMemoryMB = 64
)
View Source
const ConfigPath = "$HOME/.resim"
View Source
const CredentialCacheFilename = "cache.json"

Variables

View Source
var FlagSetUsageTemplate string = `` /* 163-byte string literal not displayed */
View Source
var ReSimUsageTemplate string = `` /* 1503-byte string literal not displayed */

Functions

func AliasNormalizeFunc added in v0.1.20

func AliasNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName

func ApplyReSimStyle added in v0.1.20

func ApplyReSimStyle(cmd *cobra.Command)

func DetermineTriggerMethod added in v0.3.5

func DetermineTriggerMethod() *api.TriggeredVia

Attempt to determine the environment we're in. i.e. are we running in Gitlab CI? Github CI? or maybe just running locally on a customer's machine? This information is useful downstream, for understanding where a batch was triggered from.

func Execute

func Execute() error

func GetCIEnvironmentVariableAccount added in v0.3.1

func GetCIEnvironmentVariableAccount() string

func GetConfigDir added in v0.1.31

func GetConfigDir() (string, error)

func OutputJson added in v0.1.20

func OutputJson(data interface{})

func RegisterViperFlags added in v0.1.10

func RegisterViperFlags(cmd *cobra.Command, args []string)

func RegisterViperFlagsAndSetClient added in v0.1.19

func RegisterViperFlagsAndSetClient(cmd *cobra.Command, args []string)

func SetClient added in v0.1.31

func SetClient(cmd *cobra.Command, args []string)

func ValidateResponse added in v0.1.14

func ValidateResponse(expectedStatusCode int, message string, response *http.Response, body []byte)

Validate Response fails the command if the response is nil, or the status code is not what we expect.

Types

type AuthMode added in v0.3.6

type AuthMode string
const (
	ClientCredentials AuthMode = "clientcredentials"
	DeviceCode        AuthMode = "devicecode"
	Password          AuthMode = "password"
)

type CredentialCache added in v0.1.18

type CredentialCache struct {
	Tokens      map[string]oauth2.Token `json:"tokens"`
	TokenSource oauth2.TokenSource
	ClientID    string
}

func (*CredentialCache) SaveCredentialCache added in v0.1.18

func (c *CredentialCache) SaveCredentialCache()

type FlagSets added in v0.1.20

type FlagSets struct {
	// contains filtered or unexported fields
}

func (FlagSets) HasOptional added in v0.1.20

func (fs FlagSets) HasOptional() bool

func (FlagSets) HasRequired added in v0.1.20

func (fs FlagSets) HasRequired() bool

func (FlagSets) OptionalUsages added in v0.1.20

func (fs FlagSets) OptionalUsages() string

func (FlagSets) RequiredUsages added in v0.1.20

func (fs FlagSets) RequiredUsages() string

Jump to

Keyboard shortcuts

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