configuration

package
v6.3.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2014 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeAccessToken

func DecodeAccessToken(accessToken string) (tokenJson []byte, err error)

func DefaultFilePath

func DefaultFilePath() string

func JsonMarshalV3

func JsonMarshalV3(config *Data) (output []byte, err error)

func JsonUnmarshalV3

func JsonUnmarshalV3(input []byte, config *Data) (err error)

Types

type AuthPrompt

type AuthPrompt struct {
	Type        AuthPromptType
	DisplayName string
}

type AuthPromptType

type AuthPromptType string
const (
	AuthPromptTypeText     AuthPromptType = "TEXT"
	AuthPromptTypePassword AuthPromptType = "PASSWORD"
)

type Data

type Data struct {
	ConfigVersion         int
	Target                string
	ApiVersion            string
	AuthorizationEndpoint string
	LoggregatorEndPoint   string
	UaaEndpoint           string
	AccessToken           string
	RefreshToken          string
	OrganizationFields    models.OrganizationFields
	SpaceFields           models.SpaceFields
	SSLDisabled           bool
	AsyncTimeout          uint
	Trace                 string
	ColorEnabled          string
}

func NewData

func NewData() (data *Data)

type DiskPersistor

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

func NewDiskPersistor

func NewDiskPersistor(path string) (dp DiskPersistor)

func (DiskPersistor) Delete

func (dp DiskPersistor) Delete()

func (DiskPersistor) Load

func (dp DiskPersistor) Load() (data *Data, err error)

func (DiskPersistor) Save

func (dp DiskPersistor) Save(data *Data) (err error)

type Persistor

type Persistor interface {
	Delete()
	Load() (*Data, error)
	Save(*Data) error
}

type ReadWriter

type ReadWriter interface {
	Reader
	ClearSession()
	SetApiEndpoint(string)
	SetApiVersion(string)
	SetAuthenticationEndpoint(string)
	SetLoggregatorEndpoint(string)
	SetUaaEndpoint(string)
	SetAccessToken(string)
	SetRefreshToken(string)
	SetOrganizationFields(models.OrganizationFields)
	SetSpaceFields(models.SpaceFields)
	SetSSLDisabled(bool)
	SetAsyncTimeout(uint)
	SetTrace(string)
	SetColorEnabled(string)
}

type Reader

type Reader interface {
	ApiEndpoint() string
	ApiVersion() string
	HasAPIEndpoint() bool

	AuthenticationEndpoint() string
	LoggregatorEndpoint() string
	UaaEndpoint() string
	AccessToken() string
	RefreshToken() string

	OrganizationFields() models.OrganizationFields
	HasOrganization() bool

	SpaceFields() models.SpaceFields
	HasSpace() bool

	Username() string
	UserGuid() string
	UserEmail() string
	IsLoggedIn() bool
	IsSSLDisabled() bool

	AsyncTimeout() uint
	Trace() string

	ColorEnabled() string
}

type Repository

type Repository interface {
	ReadWriter
	Close()
}

func NewRepositoryFromFilepath

func NewRepositoryFromFilepath(filepath string, errorHandler func(error)) Repository

func NewRepositoryFromPersistor

func NewRepositoryFromPersistor(persistor Persistor, errorHandler func(error)) Repository

type TokenInfo

type TokenInfo struct {
	Username string `json:"user_name"`
	Email    string `json:"email"`
	UserGuid string `json:"user_id"`
}

func NewTokenInfo

func NewTokenInfo(accessToken string) (info TokenInfo)

Jump to

Keyboard shortcuts

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