Documentation
¶
Index ¶
- Variables
- func Auth() (*scalingo.User, string, error)
- func Display()
- func GetRegion(c Config, name string, opts GetRegionOpts) (scalingo.Region, error)
- func HomeDir() string
- func ScalingoAuthClient() (*scalingo.Client, error)
- func ScalingoAuthClientFromToken(token string) (*scalingo.Client, error)
- func ScalingoClient() (*scalingo.Client, error)
- func ScalingoClientForRegion(region string) (*scalingo.Client, error)
- func ScalingoClientFromToken(token string) (*scalingo.Client, error)
- func ScalingoUnauthenticatedAuthClient() (*scalingo.Client, error)
- func SetCurrentUser(user *scalingo.User, token string) error
- func SetRegion(regionName string) error
- type CliAuthenticator
- type ClientConfigOpts
- type Config
- type ConfigFile
- type GetRegionOpts
- type RegionsCache
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAuthenticationFailed = errors.New("authentication failed")
)
View Source
var (
ErrUnauthenticated = errgo.New("user unauthenticated")
)
View Source
var Version = "1.16.6"
Functions ¶
func GetRegion ¶ added in v1.16.6
func GetRegion(c Config, name string, opts GetRegionOpts) (scalingo.Region, error)
GetRegion returns the requested region configuration, use local file system cache if any. In case of cache fault, save on disk for 10 minutes the available regions
func ScalingoAuthClient ¶ added in v1.16.6
func ScalingoAuthClient() (*scalingo.Client, error)
func ScalingoAuthClientFromToken ¶ added in v1.16.6
func ScalingoClient ¶ added in v1.16.6
func ScalingoClient() (*scalingo.Client, error)
func ScalingoClientForRegion ¶ added in v1.16.6
func ScalingoClientFromToken ¶ added in v1.16.6
func ScalingoUnauthenticatedAuthClient ¶ added in v1.16.6
func ScalingoUnauthenticatedAuthClient() (*scalingo.Client, error)
func SetCurrentUser ¶ added in v1.16.6
Types ¶
type CliAuthenticator ¶ added in v1.16.6
type CliAuthenticator struct{}
func (*CliAuthenticator) LoadAuth ¶ added in v1.16.6
func (a *CliAuthenticator) LoadAuth() (*scalingo.User, *auth.UserToken, error)
func (*CliAuthenticator) RemoveAuth ¶ added in v1.16.6
func (a *CliAuthenticator) RemoveAuth() error
func (*CliAuthenticator) StoreAuth ¶ added in v1.16.6
func (a *CliAuthenticator) StoreAuth(user *scalingo.User, token string) error
type ClientConfigOpts ¶ added in v1.16.6
type Config ¶ added in v1.1.0
type Config struct { ApiVersion string DisableInteractive bool DisableUpdateChecker bool UnsecureSsl bool RollbarToken string // Override region configuration ScalingoApiUrl string ScalingoAuthUrl string ScalingoDbUrl string ScalingoRegion string ScalingoSshHost string // Configuration files ConfigDir string AuthFile string LogFile string ConfigFilePath string ConfigFile ConfigFile // Cache related files CacheDir string RegionsCachePath string Logger *log.Logger // contains filtered or unexported fields }
func (Config) CurrentUser ¶ added in v1.16.6
type ConfigFile ¶ added in v1.16.6
type ConfigFile struct {
Region string `json:"region"`
}
type GetRegionOpts ¶ added in v1.16.6
type GetRegionOpts struct {
Token string
}
GetRegionOpts allows the caller to use a custom API token instead of the default one of the authentication used
type RegionsCache ¶ added in v1.16.6
type RegionsCache struct { ExpireAt time.Time `json:"expire_at"` Regions []scalingo.Region `json:"regions"` }
func EnsureRegionsCache ¶ added in v1.16.6
func EnsureRegionsCache(c Config, opts GetRegionOpts) (RegionsCache, error)
Click to show internal directories.
Click to hide internal directories.