config

package
v0.0.0-...-4c166a8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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

Jump to

Keyboard shortcuts

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