lib

package
v1.1.6-nightly Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKLCacheDir

func CreateKLCacheDir(klfile string) (cacheDir string, err error)

func GenHash

func GenHash(args GenHashArgs) string

func NixShell

func NixShell(ctx context.Context, args ShellArgs) error

func ParseEnvVarsAndMounts

func ParseEnvVarsAndMounts(cfg *KLConfig) (envVars []string, mounts map[string][]byte, err error)

func ParsePackage

func ParsePackage(pkg string) (*parsedPackage, error)

func PreCommand

func PreCommand() (*KLConfig, *ParsedKLConfig, error)

Types

type EnvType

type EnvType struct {
	Key       string  `json:"key" yaml:"key"`
	Value     *string `json:"value,omitempty" yaml:"value,omitempty"`
	ConfigRef *string `json:"configRef,omitempty" yaml:"configRef,omitempty"`
	SecretRef *string `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
	MresRef   *string `json:"mresRef,omitempty" yaml:"mresRef,omitempty"`
}

type EnvVars

type EnvVars []EnvType

type GenHashArgs

type GenHashArgs struct {
	EnvVars   []string
	Mounts    map[string][]byte
	Packages  []string
	Libraries []string
}

type KLConfig

type KLConfig struct {
	ConfigFile string `json:"-"`

	Version    string `json:"version" yaml:"version"`
	DefaultEnv string `json:"defaultEnv,omitempty" yaml:"defaultEnv,omitempty"`
	TeamName   string `json:"teamName,omitempty" yaml:"teamName,omitempty"`

	Packages  []string `json:"packages" yaml:"packages"`
	Libraries []string `json:"libraries" yaml:"libraries"`

	EnvVars EnvVars `json:"envVars" yaml:"envVars"`
	Mounts  Mounts  `json:"mounts" yaml:"mounts"`
	Ports   []int   `json:"ports" yaml:"ports"`
	// contains filtered or unexported fields
}

func FindKLFile

func FindKLFile() (*KLConfig, error)

func (*KLConfig) AddEnvVar

func (klc *KLConfig) AddEnvVar(v EnvType) error

func (*KLConfig) AddLibrary

func (klc *KLConfig) AddLibrary(v ...string) error

func (*KLConfig) AddMount

func (klc *KLConfig) AddMount(v Mount) error

func (*KLConfig) AddPackage

func (klc *KLConfig) AddPackage(v ...string) error

func (*KLConfig) RemoveLibrary

func (klc *KLConfig) RemoveLibrary(v ...string) error

func (*KLConfig) RemovePackage

func (klc *KLConfig) RemovePackage(v ...string) error

type Mount

type Mount struct {
	Path      string  `json:"path"`
	ConfigRef *string `json:"configRef,omitempty" yaml:"configRef,omitempty"`
	SecretRef *string `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
}

type Mounts

type Mounts []Mount

type ParsedKLConfig

type ParsedKLConfig struct {
	ConfigFile string `json:"configFile"`

	CacheFile string `json:"cacheFile"`
	CacheDir  string `json:"cacheDir"`

	Packages  []string `json:"packages"`
	Libraries []string `json:"libraries"`

	EnvVars []string          `json:"envVars"`
	Mounts  map[string][]byte `json:"mounts"`

	Hash string `json:"hash"`
}

func PullVariables

func PullVariables(klc *KLConfig, cacheDir string) (*ParsedKLConfig, error)

func PullVariablesFromAPI

func PullVariablesFromAPI(klc *KLConfig, cacheDir string) (*ParsedKLConfig, error)

type ShellArgs

type ShellArgs struct {
	Shell     string
	EnvVars   []string
	Packages  []string
	Libraries []string
}

Jump to

Keyboard shortcuts

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