package config

import "github.com/oslokommune/okctl/pkg/config"

Package config interacts with all configuration state

Index

Functions

func NoopDataLoader

func NoopDataLoader(_ *Config) error

NoopDataLoader does nothing

func SkipUnlessIntegration

func SkipUnlessIntegration(t *testing.T)

SkipUnlessIntegration skips a test when not running in a CI environment

Types

type Config

type Config struct {
	*context.Context

	UserDataLoader DataLoaderFn
	UserState      *state.User

	RepoDataLoader DataLoaderFn

	Declaration *v1alpha1.Cluster

	Destination   string
	ServerURL     string
	ServerBaseURL string
	// contains filtered or unexported fields
}

Config stores state for representing and interacting with okctl state

func New

func New() *Config

New Config initialises a default okctl configuration

func (*Config) EnableFileLog

func (c *Config) EnableFileLog() error

EnableFileLog for writing logs to a file

func (*Config) GetFullLogFilePath

func (c *Config) GetFullLogFilePath(logFileName string) (string, error)

GetFullLogFilePath returns the full path to a logfile

func (*Config) GetHomeDir

func (c *Config) GetHomeDir() (string, error)

GetHomeDir will return the value of OKCTL_HOME. Will default to the user's home directory. I.e.: /home/user/ in unix based systems

func (*Config) GetRepoApplicationsOutputDir

func (c *Config) GetRepoApplicationsOutputDir() (string, error)

GetRepoApplicationsOutputDir returns the directory where application resources are stored

func (*Config) GetRepoDir

func (c *Config) GetRepoDir() (string, error)

GetRepoDir will return the currently active repository directory

func (*Config) GetRepoOutputDir

func (c *Config) GetRepoOutputDir() (string, error)

GetRepoOutputDir return the repository output directory, where cloud formation stacks, etc., should be written

func (*Config) GetRepoStateDir

func (c *Config) GetRepoStateDir() (string, error)

GetRepoStateDir will return the directory where repo data should be read/written

func (*Config) GetRepoStatePath

func (c *Config) GetRepoStatePath() (string, error)

GetRepoStatePath will return the filename where repo data should be read/written

func (*Config) GetUserDataDir

func (c *Config) GetUserDataDir() (string, error)

GetUserDataDir will get the directory to where okctl application data should be written. I.e.: /home/user/.okctl in unix based systems

func (*Config) GetUserDataPath

func (c *Config) GetUserDataPath() (string, error)

GetUserDataPath returns the path to the okctl application config path. I.e.: /home/user/.okctl/conf.yml

func (*Config) LoadRepoData

func (c *Config) LoadRepoData() error

LoadRepoData will attempt to load repository data

func (*Config) LoadUserData

func (c *Config) LoadUserData() error

LoadUserData will attempt to load okctl application data

func (*Config) WriteCurrentUserData

func (c *Config) WriteCurrentUserData() error

WriteCurrentUserData writes the current app data state to disk

type DataLoaderFn

type DataLoaderFn func(*Config) error

DataLoaderFn is the type for loading configuration data

Source Files

config.go testing.go

Directories

PathSynopsis
pkg/config/constantPackage constant contains constants used throughout okctl
pkg/config/loadPackage load knows how to load application and repository data
pkg/config/statePackage state holds the config state
Version
v0.0.106 (latest)
Published
Oct 21, 2022
Platform
linux/amd64
Imports
16 packages
Last checked
10 hours ago

Tools for package owners.