workspace

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CueLoader

func CueLoader(c *Config) (err error)

func DefaultConfigStore

func DefaultConfigStore(env string) (store *config.FileStore, err error)

func DetermineRoot

func DetermineRoot(params DetermineRootParams) (found string, err error)

DetermineRoot recursively searches the current directory and all its parents for DetermineRootParams.SearchSuffix

func DetermineRootFromCWD

func DetermineRootFromCWD(searchSuffix string) (string, error)

DetermineRootFromCWD determine the workspace root from the current working directory

func DetermineRootFromGitExec

func DetermineRootFromGitExec() (string, error)

func DetermineRootWithFallback

func DetermineRootWithFallback(params DetermineRootParams) (string, error)

func IsNoRootFound

func IsNoRootFound(err error) bool

func JSONLoader

func JSONLoader(c *Config) error

func NewEnvScopedFileStore

func NewEnvScopedFileStore(ctx context.Context, ws *Config, env string) (*config.FileStore, error)

func NewFileStore

func NewFileStore(ctx context.Context, ws *Config) (*config.FileStore, error)

func StorePathWithEnv

func StorePathWithEnv(ws *Config, env string) string

func StoreRoot

func StoreRoot(ws *Config) string

Types

type CodeGenSettings

type CodeGenSettings struct {
	OutputDir string `json:"output_dir"`
}

type Config

type Config struct {
	ConfigStore          ConfigStoreSettings `json:"config_store"`
	FileSystem           FileSystemSettings  `json:"file_system"`
	RemoteCache          RemoteCacheSettings `json:"remote_cache"`
	CodeGen              CodeGenSettings     `json:"code_gen"`
	VersionCheckDisabled bool                `json:"version_check_disabled"`
	// contains filtered or unexported fields
}

Config holds data for configuring a workspace

func LoadConfig

func LoadConfig(params LoadConfigParams) (c *Config, err error)

LoadConfig reads the bytes out of json settings and unmarshalls them into a Config object

func LoadConfigFromCWD

func LoadConfigFromCWD(params LoadConfigParams) (*Config, error)

LoadConfigFromCWD reads the bytes out of json settings and unmarshalls them into a Config object from the CWD

func NewWorkspaceConfig

func NewWorkspaceConfig() (*Config, error)

func (Config) ConfigRoot

func (c Config) ConfigRoot() string

func (Config) File

func (c Config) File() string

func (Config) Root

func (c Config) Root() string

type ConfigStoreSettings

type ConfigStoreSettings struct {
	EncryptionKeys []config.EncryptionKey `json:"encryption_keys"`
}

ConfigStoreSettings allows user to set Vault address that's not reliant on an env var

func (ConfigStoreSettings) KeyByEnv

type DetermineRootParams

type DetermineRootParams struct {
	StartDir     string
	SearchSuffix string
}

type FileSystemSettings

type FileSystemSettings struct {
	Ignore []string
}

FileSystemSettings configures the workspace file system observer

type LoadConfigParams

type LoadConfigParams struct {
	DetermineRootParams
	LoaderFunc func(*Config) error
}

type RemoteCacheSettings

type RemoteCacheSettings struct {
	URL string
}

RemoteCacheSettings configures the workspace remote cache location

Jump to

Keyboard shortcuts

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