utils

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const ContextFileName = "context"

Variables

This section is empty.

Functions

func Capture

func Capture(command *cobra.Command)

func CurrentApplication

func CurrentApplication() (Id, Name, error)

func CurrentEnvironment

func CurrentEnvironment() (Id, Name, error)

func CurrentOrganization

func CurrentOrganization() (Id, Name, error)

func CurrentProject

func CurrentProject() (Id, Name, error)

func DeleteFile

func DeleteFile(path string)

func DeleteFolder

func DeleteFolder(path string)

func GenerateExportEnvVarsScript

func GenerateExportEnvVarsScript(vars []Var, clusterId string)

func GetAccessTokenExpiration

func GetAccessTokenExpiration() (time.Time, error)

func GetFullPath

func GetFullPath(clusterId string) string

func InitializeQoveryContext

func InitializeQoveryContext() error

func PrintlnContext

func PrintlnContext() error

func PrintlnError

func PrintlnError(err error)

func PrintlnInfo

func PrintlnInfo(info string)

func QoveryContextExists

func QoveryContextExists() bool

func QoveryContextPath

func QoveryContextPath() (string, error)

func QoveryDirExists

func QoveryDirExists() bool

func QoveryDirPath

func QoveryDirPath() (string, error)

func RefreshAccessToken

func RefreshAccessToken() error

func RefreshExpiredTokenSilently

func RefreshExpiredTokenSilently()

func ResetApplicationContext

func ResetApplicationContext() error

func SelectApplication

func SelectApplication(environment Id) error

func SelectEnvironment

func SelectEnvironment(project Id) error

func SelectOrganization

func SelectOrganization() error

func SelectProject

func SelectProject(organization Id) error

func SetAccessToken

func SetAccessToken(token AccessToken, expiration time.Time) error

func SetApplication

func SetApplication(name Name, id Id) error

func SetEnvironment

func SetEnvironment(name Name, id Id) error

func SetOrganization

func SetOrganization(name Name, id Id) error

func SetProject

func SetProject(name Name, id Id) error

func SetRefreshToken

func SetRefreshToken(token RefreshToken) error

func StoreContext

func StoreContext(context QoveryContext) error

func WriteInFile

func WriteInFile(clusterId string, fileName string, content []byte) string

Types

type AccessToken

type AccessToken string

func GetAccessToken

func GetAccessToken() (AccessToken, error)

type Id

type Id string

type Name

type Name string

type QoveryContext

type QoveryContext struct {
	AccessToken           AccessToken  `json:"access_token"`
	AccessTokenExpiration time.Time    `json:"access_token_expiration"`
	RefreshToken          RefreshToken `json:"refresh_token"`
	OrganizationId        Id           `json:"organization_id"`
	OrganizationName      Name         `json:"organization_name"`
	ProjectId             Id           `json:"project_id"`
	ProjectName           Name         `json:"project_name"`
	EnvironmentId         Id           `json:"environment_id"`
	EnvironmentName       Name         `json:"environment_name"`
	ApplicationId         Id           `json:"application_id"`
	ApplicationName       Name         `json:"application_name"`
	User                  Name         `json:"user"`
}

func CurrentContext

func CurrentContext() (QoveryContext, error)

func (QoveryContext) ToPosthogProperties

func (c QoveryContext) ToPosthogProperties() map[string]interface{}

type RefreshToken

type RefreshToken string

func GetRefreshToken

func GetRefreshToken() (RefreshToken, error)

type TokensResponse

type TokensResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

type Var

type Var struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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