Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- func (c *Config) APIClient() *apiClient.ScaleAPIV1
- func (c *Config) AuthClient() *authClient.AuthAPIV1
- func (c *Config) DefaultConfigDir() (string, error)
- func (c *Config) DefaultConfigFile() string
- func (c *Config) DefaultConfigPath() (string, error)
- func (c *Config) DefaultLogFile() string
- func (c *Config) DefaultLogPath() (string, error)
- func (c *Config) GetConfigFile() string
- func (c *Config) GetLogFile() string
- func (c *Config) GlobalRequiredFlags(_ *cobra.Command) error
- func (c *Config) IsAuthenticated() bool
- func (c *Config) NewAuthenticatedAPIClient() (*apiClient.ScaleAPIV1, error)
- func (c *Config) NewAuthenticatedAuthClient() (*authClient.AuthAPIV1, error)
- func (c *Config) NewUnauthenticatedAPIClient() *apiClient.ScaleAPIV1
- func (c *Config) NewUnauthenticatedAuthClient() *authClient.AuthAPIV1
- func (c *Config) RootPersistentFlags(flags *pflag.FlagSet)
- func (c *Config) SessionCookieURL() *url.URL
- func (c *Config) SessionPath() (string, error)
- func (c *Config) SetAPIClient(apiClient *apiClient.ScaleAPIV1)
- func (c *Config) SetAuthClient(authClient *authClient.AuthAPIV1)
- func (c *Config) SetConfigFile(file string)
- func (c *Config) SetLogFile(file string)
- func (c *Config) Validate() error
- func (c *Config) WriteSession() error
Constants ¶
View Source
const ( DefaultAPIEndpoint = "api.scale.sh" DefaultAuthEndpoint = "auth.scale.sh" DefaultUIEndpoint = "scale.sh" DefaultUpdateEndpoint = "dl.scale.sh" DefaultSessionDomain = "scale.sh" )
Variables ¶
View Source
var ( ErrAPIEndpointRequired = errors.New("api endpoint is required") ErrAuthEndpointRequired = errors.New("auth endpoint is required") ErrUpdateEndpointRequired = errors.New("update endpoint is required") ErrUIEndpointRequired = errors.New("ui endpoint is required") ErrSessionDomainRequired = errors.New("session domain is required") ErrNoSession = errors.New("no session found") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { APIEndpoint string `mapstructure:"api_endpoint"` AuthEndpoint string `mapstructure:"auth_endpoint"` UIEndpoint string `mapstructure:"ui_endpoint"` UpdateEndpoint string `mapstructure:"update_endpoint"` SessionDomain string `mapstructure:"session_domain"` DisableAutoUpdate bool `mapstructure:"disable_auto_update"` NoTelemetry bool `mapstructure:"no_telemetry"` StorageDirectory string `mapstructure:"storage_directory"` Session *session.Session `mapstructure:"-"` // contains filtered or unexported fields }
Config is dynamically sourced from various files and environment variables.
func (*Config) APIClient ¶
func (c *Config) APIClient() *apiClient.ScaleAPIV1
func (*Config) AuthClient ¶
func (c *Config) AuthClient() *authClient.AuthAPIV1
func (*Config) DefaultConfigDir ¶
func (*Config) DefaultConfigFile ¶
func (*Config) DefaultConfigPath ¶
func (*Config) DefaultLogFile ¶
func (*Config) DefaultLogPath ¶
func (*Config) GetConfigFile ¶
func (*Config) GetLogFile ¶
func (*Config) IsAuthenticated ¶
func (*Config) NewAuthenticatedAPIClient ¶
func (c *Config) NewAuthenticatedAPIClient() (*apiClient.ScaleAPIV1, error)
NewAuthenticatedAPIClient creates an Authenticated Scale API client from our configuration
func (*Config) NewAuthenticatedAuthClient ¶
func (c *Config) NewAuthenticatedAuthClient() (*authClient.AuthAPIV1, error)
NewAuthenticatedAuthClient creates an Authenticated Scale Auth API client from our configuration
func (*Config) NewUnauthenticatedAPIClient ¶
func (c *Config) NewUnauthenticatedAPIClient() *apiClient.ScaleAPIV1
NewUnauthenticatedAPIClient creates an Unauthenticated Scale API client from our configuration
func (*Config) NewUnauthenticatedAuthClient ¶
func (c *Config) NewUnauthenticatedAuthClient() *authClient.AuthAPIV1
NewUnauthenticatedAuthClient creates an Unauthenticated Scale Auth API client from our configuration
func (*Config) RootPersistentFlags ¶
func (*Config) SessionCookieURL ¶ added in v0.1.7
func (*Config) SessionPath ¶
SessionPath is the path for the session file
func (*Config) SetAPIClient ¶
func (c *Config) SetAPIClient(apiClient *apiClient.ScaleAPIV1)
func (*Config) SetAuthClient ¶
func (c *Config) SetAuthClient(authClient *authClient.AuthAPIV1)
func (*Config) SetConfigFile ¶
func (*Config) SetLogFile ¶
func (*Config) WriteSession ¶
Click to show internal directories.
Click to hide internal directories.