Documentation

Index

Constants

const (
	REFRESH_TOKEN      = GrantType("refresh_token")
	AUTHCODE           = GrantType("authorization_code")
	IMPLICIT           = GrantType("implicit")
	PASSWORD           = GrantType("password")
	CLIENT_CREDENTIALS = GrantType("client_credentials")
)

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

func ConfigPath

func ConfigPath() string

func RemoveConfig

func RemoveConfig() error

func WriteConfig

func WriteConfig(c Config) error

Types

type Config

type Config struct {
	Verbose          bool
	ZoneSubdomain    string
	Targets          map[string]Target
	ActiveTargetName string
}

func NewConfig

func NewConfig() Config

func NewConfigWithServerURL

func NewConfigWithServerURL(url string) Config

func ReadConfig

func ReadConfig() Config

func (*Config) AddContext

func (c *Config) AddContext(newContext UaaContext)

func (*Config) AddTarget

func (c *Config) AddTarget(newTarget Target)

func (Config) GetActiveContext

func (c Config) GetActiveContext() UaaContext

func (Config) GetActiveTarget

func (c Config) GetActiveTarget() Target

type GrantType

type GrantType string

type Target

type Target struct {
	BaseUrl           string
	SkipSSLValidation bool
	Contexts          map[string]UaaContext
	ActiveContextName string
}

func NewTarget

func NewTarget() Target

func (Target) GetActiveContext

func (t Target) GetActiveContext() UaaContext

type UaaContext

type UaaContext struct {
	ClientId  string    `json:"client_id"`
	GrantType GrantType `json:"grant_type"`
	Username  string    `json:"username"`
	Token     oauth2.Token
}

func NewContextWithToken

func NewContextWithToken(accessToken string) UaaContext