config

package
v5.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

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)

	CACert(url string) string

	Credentials(url string) Creds
	SetCredentials(url string, creds Creds) Config
	UnsetCredentials(url string) Config

	Save() error
}

type Creds

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

	// For UAA users
	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) UnsetCredentials

func (c FSConfig) UnsetCredentials(urlOrAlias string) Config

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