utils

package
v0.48.4 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const AdminUrl = "https://api-admin.qovery.com"
View Source
const ContextFileName = "context"

Variables

This section is empty.

Functions

func AddEnvironmentVariable added in v0.40.0

func AddEnvironmentVariable(application Id, key string, value string) error

func AddSecret added in v0.40.0

func AddSecret(application Id, key string, value string) error

func Capture

func Capture(command *cobra.Command)

func CheckAdminUrl added in v0.40.0

func CheckAdminUrl()

func CurrentEnvironment

func CurrentEnvironment() (Id, Name, error)

func CurrentOrganization

func CurrentOrganization() (Id, Name, error)

func CurrentProject

func CurrentProject() (Id, Name, error)

func DeleteEnvironmentVariable added in v0.40.0

func DeleteEnvironmentVariable(application Id, key string) error

func DeleteFile

func DeleteFile(path string)

func DeleteFolder

func DeleteFolder(path string)

func DeleteSecret added in v0.40.0

func DeleteSecret(application Id, key string) error

func DryRunPrint added in v0.40.0

func DryRunPrint(dryRunDisabled bool)

func FindByApplicationName added in v0.47.0

func FindByApplicationName(applications []qovery.Application, name string) *qovery.Application

func FindByContainerName added in v0.47.0

func FindByContainerName(containers []qovery.ContainerResponse, name string) *qovery.ContainerResponse

func FindByDatabaseName added in v0.47.0

func FindByDatabaseName(databases []qovery.Database, name string) *qovery.Database

func FindByEnvironmentName added in v0.47.0

func FindByEnvironmentName(environments []qovery.Environment, name string) *qovery.Environment

func FindByJobName added in v0.47.0

func FindByJobName(jobs []qovery.JobResponse, name string) *qovery.JobResponse

func FindByOrganizationName added in v0.47.0

func FindByOrganizationName(organizations []qovery.Organization, name string) *qovery.Organization

func FindByProjectName added in v0.47.0

func FindByProjectName(projects []qovery.Project, name string) *qovery.Project

func GenerateExportEnvVarsScript

func GenerateExportEnvVarsScript(vars []Var, clusterId string)

func GetAccessToken

func GetAccessToken() (AccessTokenType, AccessToken, error)

func GetAccessTokenExpiration

func GetAccessTokenExpiration() (time.Time, error)

func GetAuthorizationHeaderValue added in v0.47.0

func GetAuthorizationHeaderValue(tokenType AccessTokenType, token AccessToken) string

func GetFullPath

func GetFullPath(clusterId string) string

func GetQoveryClient added in v0.47.0

func GetQoveryClient(tokenType AccessTokenType, token AccessToken) *qovery.APIClient

func GetStatus added in v0.47.0

func GetStatus(statuses []qovery.Status, serviceId string) string

func GetStatusTextWithColor added in v0.47.0

func GetStatusTextWithColor(s qovery.Status) string

func InitializeQoveryContext

func InitializeQoveryContext() error

func IsEnvironmentInATerminalState added in v0.47.1

func IsEnvironmentInATerminalState(envId string, client *qovery.APIClient) bool

func PrintTable added in v0.47.0

func PrintTable(headers []string, data [][]string) error

func Println added in v0.41.0

func Println(text string)

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 SetAccessToken

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

func SetEnvironment

func SetEnvironment(env *Environment) error

func SetOrganization

func SetOrganization(orga *Organization) error

func SetProject

func SetProject(project *Project) error

func SetRefreshToken

func SetRefreshToken(token RefreshToken) error

func SetService added in v0.45.0

func SetService(service *Service) error

func StoreContext

func StoreContext(context QoveryContext) error

func Validate added in v0.40.0

func Validate(actionType string) bool

func WatchApplication added in v0.47.0

func WatchApplication(applicationId string, envId string, client *qovery.APIClient)

func WatchContainer added in v0.47.0

func WatchContainer(containerId string, envId string, client *qovery.APIClient)

func WatchDatabase added in v0.47.0

func WatchDatabase(databaseId string, envId string, client *qovery.APIClient)

func WatchEnvironment added in v0.47.0

func WatchEnvironment(envId string, finalServiceState qovery.StateEnum, client *qovery.APIClient)

func WatchEnvironmentWithOptions added in v0.47.1

func WatchEnvironmentWithOptions(envId string, finalServiceState qovery.StateEnum, client *qovery.APIClient, displaySimpleText bool)

func WatchJob added in v0.47.0

func WatchJob(jobId string, envId string, client *qovery.APIClient)

func WriteInFile

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

Types

type AccessToken

type AccessToken string

type AccessTokenType added in v0.47.0

type AccessTokenType string

type Application added in v0.40.0

type Application struct {
	ID   Id
	Name Name
}

func GetApplicationById added in v0.41.6

func GetApplicationById(id string) (*Application, error)

type Container added in v0.45.0

type Container struct {
	ID   Id
	Name Name
}

func GetContainerById added in v0.45.0

func GetContainerById(id string) (*Container, error)

type Environment added in v0.40.0

type Environment struct {
	ID        Id
	ClusterID Id
	Name      Name
}

func GetEnvironmentById added in v0.41.6

func GetEnvironmentById(id string) (*Environment, error)

func SelectAndSetEnvironment added in v0.40.0

func SelectAndSetEnvironment(projectID Id) (*Environment, error)

func SelectEnvironment

func SelectEnvironment(projectID Id) (*Environment, error)

type Id

type Id string

type Name

type Name string

type Organization added in v0.40.0

type Organization struct {
	ID   Id
	Name Name
}

func GetOrganizationById added in v0.41.6

func GetOrganizationById(id string) (*Organization, error)

func SelectAndSetOrganization added in v0.40.0

func SelectAndSetOrganization() (*Organization, error)

func SelectOrganization

func SelectOrganization() (*Organization, error)

type Project added in v0.40.0

type Project struct {
	ID   Id
	Name Name
}

func GetProjectById added in v0.41.6

func GetProjectById(id string) (*Project, error)

func SelectAndSetProject added in v0.40.0

func SelectAndSetProject(organizationID Id) (*Project, error)

func SelectProject

func SelectProject(organizationID Id) (*Project, error)

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"`
	ServiceId             Id           `json:"service_id"`
	ServiceName           Name         `json:"service_name"`
	ServiceType           ServiceType  `json:"service_type"`
	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 Service added in v0.45.0

type Service struct {
	ID   Id
	Name Name
	Type ServiceType
}

func CurrentService added in v0.45.0

func CurrentService() (*Service, error)

func SelectAndSetService added in v0.45.0

func SelectAndSetService(environment Id) (*Service, error)

func SelectService added in v0.45.0

func SelectService(environment Id) (*Service, error)

type ServiceType added in v0.45.0

type ServiceType string
const (
	ApplicationType ServiceType = "application"
	ContainerType   ServiceType = "container"
	DatabaseType    ServiceType = "database"
	JobType         ServiceType = "job"
)

type Status added in v0.47.1

type Status int8
const (
	Continue Status = iota
	Stop
	Err
)

func WatchStatus added in v0.47.0

func WatchStatus(status *qovery.Status) Status

type TokenInformation added in v0.41.1

type TokenInformation struct {
	Organization *Organization
	Name         string
	Description  string
}

func SelectTokenInformation added in v0.41.1

func SelectTokenInformation() (*TokenInformation, 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