tenv

package
v0.0.0-...-bc50060 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DirectoryMode = 0755
View Source
const FileMode = 0755

Variables

View Source
var SelectedVersionFile = path.Join(TeleportEnvHomeDirectory, "selected-version")
View Source
var TeleportBinaryNames = []string{"teleport", "tsh", "tctl", "tbot"}
View Source
var TeleportBinaryURLTemplate = template.Must(template.New("binary_url").Parse(
	"https://get.gravitational.com/teleport-v{{.Version}}-{{.OS}}-{{.Arch}}-bin.tar.gz",
))
View Source
var TeleportCurrentProfileFile = path.Join(TeleportHomeDirectory, "current-profile")
View Source
var TeleportEnvConfigFile = path.Join(TeleportEnvHomeDirectory, "config.yaml")
View Source
var TeleportEnvHomeDirectory = os.ExpandEnv("$HOME/.tenv")
View Source
var TeleportEnvVersionDirectory = path.Join(TeleportEnvHomeDirectory, "versions")
View Source
var TeleportHomeDirectory = os.ExpandEnv("$HOME/.tsh")
View Source
var TeleportOptionalBinaryNames = []string{"tbot"}

Functions

func BinDirectory

func BinDirectory(version string) string

func ContainsTeleportBinaries

func ContainsTeleportBinaries(dir string) bool
func CreateLinks(force bool) error
func CreateSymbolicLink(binaryName string) error

func Execute

func Execute(binaryName string, args ...string) error

func ExistsOnPath

func ExistsOnPath(binaryName string) (bool, error)

func FilterStringStartsWith

func FilterStringStartsWith(start string) func(string) bool

func GetInstalledVersions

func GetInstalledVersions() (versionList, error)

func GetSelectedVersion

func GetSelectedVersion() (string, error)

func GetValidProfileNames

func GetValidProfileNames() ([]string, error)

func InstallVersion

func InstallVersion(ctx context.Context, version string) error

func ListInstalledVersions

func ListInstalledVersions() error

func SelectProfile

func SelectProfile(profileName string) error

func StringSliceContains

func StringSliceContains(slice []string, item string) bool

func StringSliceFilter

func StringSliceFilter(slice []string, filter func(string) bool) []string

func UseTeleport

func UseTeleport(version string) error

Types

type Config

type Config struct {
	Rules []struct {
		Match []struct {
			CurrentDir     *string `yaml:"currentDir,omitempty"`
			CurrentProfile *string `yaml:"currentProfile,omitempty"`
		} `yaml:"match,omitempty"`
		Version string `yaml:"version,omitempty"`
	} `yaml:"rules,omitempty"`
}

func LoadConfig

func LoadConfig() (*Config, error)

Jump to

Keyboard shortcuts

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