env

package
v0.29.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	GrafanaResourceType               = "grafana"
	GrafanaContinuousLoadResourceType = "grafana/continuous-load"
)
View Source
const BastionSquidProxyPort = 3128
View Source
const DefaultInterfaceName = "nic0"
View Source
const DefaultZone = "europe-west2-a"
View Source
const KubeNamespace = "default"
View Source
const NoBackgroundEnvVar = "NO_BACKGROUND"
View Source
const PidFileDir = "/tmp/corectl"
View Source
const PortConnectMax = 40000
View Source
const PortConnectMin = 30000

Variables

View Source
var (
	ErrCloudPlatformNotSupported = errors.New("cloud platform is not supported")
	ErrInvalidEnvironment        = errors.New("environment is not valid")
)
View Source
var (
	ErrorUnknownResourceType = errors.New("unknown resource type")
)

Functions

func Connect

func Connect(opts EnvConnectOpts) error

Connect establishes a connection with a gke cluster via a bastion host

func ExistingPidForConnection added in v0.26.3

func ExistingPidForConnection(name string) int

func GenerateConnectPort added in v0.26.3

func GenerateConnectPort(name string) int

func GetProxyPIDs added in v0.26.3

func GetProxyPIDs(availableEnvironments []environment.Environment) (map[string]ProcessDetails, error)

func IsConnectChild added in v0.26.3

func IsConnectChild(opts EnvConnectOpts) bool

func IsConnectParent added in v0.26.3

func IsConnectParent(opts EnvConnectOpts) bool

func IsConnectStartup added in v0.26.3

func IsConnectStartup(opts EnvConnectOpts) bool

func KillProcess added in v0.26.3

func KillProcess(name string, pid int32, force bool) error

func Listen added in v0.26.3

func Listen(streams userio.IOStreams, opts EnvConnectOpts, ctx context.Context, listen string, dialOpts []iap.DialOption, execute func() error)

Listen starts a proxy server that listens on the given address and port.

func OpenResource

func OpenResource(resourceType ResourceType, env *environment.Environment) (string, error)

func ResourceStringList

func ResourceStringList() []string

func SetBackgroundEnv added in v0.26.3

func SetBackgroundEnv() string

func Validate

func Validate(ctx context.Context, env *environment.Environment, cmd command.Commander, client *gcp.Client) error

Validate checks if the required tools and configurations for the environment are installed and set up correctly.

func WritePidFile added in v0.26.3

func WritePidFile(name string, pid int)

Types

type EnvConnectOpts added in v0.26.0

type EnvConnectOpts struct {
	Port               int
	Environment        *environment.Environment
	RepositoryLocation string
	ProjectID          string
	Region             string
	Streams            userio.IOStreams
	SilentExec         Commander
	Exec               Commander
	GcpClient          *gcp.Client
	Command            []string
	SkipTunnel         bool
	Background         bool
	Force              bool
}

type ProcessDetails added in v0.26.3

type ProcessDetails struct {
	Pid  int32
	Port int32
}

type ResourceType

type ResourceType string

type TableEnv

type TableEnv struct {
	// contains filtered or unexported fields
}

func NewTable

func NewTable(streams userio.IOStreams, showProxy bool) TableEnv

func (TableEnv) AppendEnv

func (t TableEnv) AppendEnv(env environment.Environment, proxy string, pid string)

func (TableEnv) AppendRow

func (t TableEnv) AppendRow(name, id, platform, proxy, pid string)

func (TableEnv) Render

func (t TableEnv) Render() string

Jump to

Keyboard shortcuts

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