Documentation
¶
Index ¶
- Constants
- func Abspath(p string) string
- func DeviceFlow(profile map[string]string, cmd *cobra.Command) (*idp.Context, error)
- func FromToml(ctx *idp.Context, t *toml.Tree) error
- func GetAllContext(cmd *cobra.Command) map[string]interface{}
- func GetClient() (*sdk.Client, error)
- func GetClientID(cmd *cobra.Command) (string, error)
- func GetClientSystemTenant() (*sdk.Client, error)
- func GetContext(cmd *cobra.Command, tenant string) *idp.Context
- func GetCurrentContext(clientID string, tenant string) *idp.Context
- func GetEnvironmentName() string
- func GetEnvironmentProfile() (map[string]string, error)
- func GetFlow(kind string) (func(map[string]string, *cobra.Command) (*idp.Context, error), error)
- func GetProfile(name string) (map[string]string, error)
- func GetProfileName() string
- func Login(cmd *cobra.Command, ...) (*idp.Context, error)
- func LoginSetUp() error
- func PkceFlow(profile map[string]string, cmd *cobra.Command) (*idp.Context, error)
- func RefreshFlow(profile map[string]string, cmd *cobra.Command) (*idp.Context, error)
- func SetContext(cmd *cobra.Command, tenant string, context map[string]interface{})
- func ToMap(ctx *idp.Context) map[string]interface{}
- type Cfg
- type Environment
- type GlogWrapper
- type IdpService
- type ScloudTesExecCancledError
- type Service
Constants ¶
const DefaultEnv = "prod"
const SCloudHome = "SCLOUD_HOME"
const (
// use ScloudTestDone to indicate the scloud test command is done when using testhook-dryrun flag
ScloudTestDone = "Test Command is done\n"
)
Variables ¶
This section is empty.
Functions ¶
func Abspath ¶
Returns an absolute path. If the given path is not absolute it looks for the environment variable SCLOUD HOME and is joined with that. If the environment variable is not defined, the path is joined with the path to the home dir
func DeviceFlow ¶ added in v1.11.1
func GetAllContext ¶
Return all the contexts associated with the current environment
func GetClientID ¶ added in v1.8.0
Return client id
func GetClientSystemTenant ¶
func GetContext ¶ added in v1.7.0
Returns the context for a given tenant from .scloud_context
func GetCurrentContext ¶ added in v1.8.0
Returns the cached authorization context associated with the given clientID.
func GetEnvironmentName ¶ added in v1.7.0
func GetEnvironmentName() string
Returns the name of the selected environment.
func GetEnvironmentProfile ¶ added in v1.7.0
func GetProfile ¶
Returns the named application profile.
func GetProfileName ¶ added in v1.7.0
func GetProfileName() string
Returns the name of the selected app profile.
func Login ¶
func Login(cmd *cobra.Command, authFlow func(map[string]string, *cobra.Command) (*idp.Context, error)) (*idp.Context, error)
Authenticate, using the selected app profile.
func LoginSetUp ¶ added in v1.7.0
func LoginSetUp() error
func RefreshFlow ¶ added in v1.7.0
func SetContext ¶ added in v1.7.0
Set context in .scloud_context
Types ¶
type Cfg ¶
type Cfg struct {
Profiles map[string]map[string]string `yaml:"profiles"`
Environments map[string]*Environment `yaml:"environments"`
}
type Environment ¶
type Environment struct {
APIService Service `yaml:"api-service"`
AppService Service `yaml:"app-service"`
IdpService IdpService `yaml:"idp-service"`
Profile string `yaml:"profile"`
}
func GetEnvironment ¶
func GetEnvironment(name string) (*Environment, error)
type GlogWrapper ¶
type GlogWrapper struct {
}
GlogWrapper is used to wrap glog.info() in a Print() function usable by splunk-cloud-sdk-go
func (*GlogWrapper) Print ¶
func (gw *GlogWrapper) Print(v ...interface{})
type IdpService ¶
type ScloudTesExecCancledError ¶
type ScloudTesExecCancledError struct {
}
func (ScloudTesExecCancledError) Error ¶
func (ste ScloudTesExecCancledError) Error() string