Documentation
¶
Index ¶
Constants ¶
View Source
const ( CLI_NAME = "kinde" USER_AGENT = "Kinde CLI" ConfigContextKey contextKey = "config" )
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
NewContext retrieves the Config instance from the context.
Types ¶
type Config ¶
type Config struct {
CurrentEnvironment string `json:"current"`
Environments map[string]Environment `json:"environments"`
}
func (*Config) GetEnvironment ¶
func (i *Config) GetEnvironment() *Environment
GetEnvironment implements IConfig.
func (*Config) PersistConfig ¶
PersistConfig writes the current configuration to the config file.
func (*Config) SetEnvironment ¶
func (i *Config) SetEnvironment(f func(e *Environment)) error
func (*Config) SwitchEnvironment ¶
SwitchEnvironment sets the current environment to the specified value, creating it if it doesn't exist.
type Environment ¶
type Environment struct {
DomainName string `json:"domain_name"`
ClientID string `json:"client_id,omitempty"`
ClientSecret string `json:"client_secret,omitempty"`
}
func (*Environment) NewClientCredentialsFlow ¶
func (env *Environment) NewClientCredentialsFlow() (client_credentials.IClientCredentialsFlow, error)
func (*Environment) NewDeviceAuthorizationFlow ¶
func (env *Environment) NewDeviceAuthorizationFlow() (authorization_code.IDeviceAuthorizationFlow, error)
NewDeviceAuthorizationFlow creates a new Device Authorization Flow with the given options.
type IConfig ¶
type IConfig interface {
Validate() (error, bool)
SwitchEnvironment(val string) error
PersistConfig() error
GetEnvironment() *Environment
SetEnvironment(f func(e *Environment)) error
}
used for testing
type IEnvironment ¶
type IEnvironment interface {
NewDeviceAuthorizationFlow() (authorization_code.IDeviceAuthorizationFlow, error)
NewClientCredentialsFlow() (client_credentials.IClientCredentialsFlow, error)
}
Click to show internal directories.
Click to hide internal directories.