config

package
v1.16.6 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2020 License: BSD-4-Clause, MIT Imports: 24 Imported by: 30

Documentation

Index

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 Auth added in v1.16.6

func Auth() (*scalingo.User, string, error)

func Display added in v1.16.6

func Display()

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 HomeDir added in v1.1.0

func HomeDir() string

func ScalingoAuthClient added in v1.16.6

func ScalingoAuthClient() (*scalingo.Client, error)

func ScalingoAuthClientFromToken added in v1.16.6

func ScalingoAuthClientFromToken(token string) (*scalingo.Client, error)

func ScalingoClient added in v1.16.6

func ScalingoClient() (*scalingo.Client, error)

func ScalingoClientForRegion added in v1.16.6

func ScalingoClientForRegion(region string) (*scalingo.Client, error)

func ScalingoClientFromToken added in v1.16.6

func ScalingoClientFromToken(token string) (*scalingo.Client, error)

func ScalingoUnauthenticatedAuthClient added in v1.16.6

func ScalingoUnauthenticatedAuthClient() (*scalingo.Client, error)

func SetCurrentUser added in v1.16.6

func SetCurrentUser(user *scalingo.User, token string) error

func SetRegion added in v1.16.6

func SetRegion(regionName string) error

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 ClientConfigOpts struct {
	Region   string
	APIToken string
	AuthOnly bool
}

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
}
var (
	C         Config
	TlsConfig *tls.Config
)

func (Config) CurrentUser added in v1.16.6

func (config Config) CurrentUser() (*scalingo.User, error)

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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