config

package
v6.4.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: Apache-2.0 Imports: 6 Imported by: 132

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Environments() []Environment
	ResolveEnvironment(urlOrAlias string) string
	AliasEnvironment(url, alias, caCert string) (Config, error)
	UnaliasEnvironment(alias string) (Config, error)

	CACert(url string) string

	Credentials(url string) Creds
	SetCredentials(url string, creds Creds) Config
	UnsetCredentials(url string) Config
	UpdateConfigWithToken(environment string, t uaa.AccessToken) error

	Save() error
}

type Creds

type Creds struct {
	// Basic auth username/password or UAA client creds
	Client       string
	ClientSecret string

	// For UAA users
	AccessTokenType string
	AccessToken     string
	RefreshToken    string
}

func (Creds) Description

func (c Creds) Description() string

func (Creds) IsBasicComplete

func (c Creds) IsBasicComplete() bool

func (Creds) IsUAA

func (c Creds) IsUAA() bool

func (Creds) IsUAAClient

func (c Creds) IsUAAClient() bool

type Environment

type Environment struct {
	URL   string
	Alias string
}

type FSConfig

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

func NewFSConfigFromPath

func NewFSConfigFromPath(path string, fs boshsys.FileSystem) (FSConfig, error)

func (FSConfig) AliasEnvironment added in v0.0.96

func (c FSConfig) AliasEnvironment(url, alias, caCert string) (Config, error)

func (FSConfig) CACert

func (c FSConfig) CACert(urlOrAlias string) string

func (FSConfig) Credentials

func (c FSConfig) Credentials(urlOrAlias string) Creds

func (FSConfig) Environments

func (c FSConfig) Environments() []Environment

func (FSConfig) ResolveEnvironment

func (c FSConfig) ResolveEnvironment(urlOrAlias string) string

func (FSConfig) Save

func (c FSConfig) Save() error

func (FSConfig) SetCredentials

func (c FSConfig) SetCredentials(urlOrAlias string, creds Creds) Config

func (FSConfig) UnaliasEnvironment

func (c FSConfig) UnaliasEnvironment(alias string) (Config, error)

func (FSConfig) UnsetCredentials

func (c FSConfig) UnsetCredentials(urlOrAlias string) Config

func (FSConfig) UpdateConfigWithToken

func (c FSConfig) UpdateConfigWithToken(environment string, t uaa.AccessToken) error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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