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) 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" DefaultUpdateEndpoint = "dl.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") ErrNoSession = errors.New("no session found") )
View Source
var (
DefaultCookieURL = &url.URL{
Scheme: "https",
Host: "scale.sh",
}
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
APIEndpoint string `yaml:"api_endpoint"`
AuthEndpoint string `yaml:"auth_endpoint"`
UpdateEndpoint string `yaml:"update_endpoint"`
DisableAutoUpdate bool `yaml:"disable_auto_update"`
NoTelemetry bool `yaml:"no_telemetry"`
CacheDirectory string `yaml:"cache_directory"`
Session *session.Session `yaml:"-"`
// 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) 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.