Documentation ¶
Index ¶
- Constants
- Variables
- func ClientAPIBase() string
- func ClientAPIHost() string
- func ClientAPIPort() uint16
- func ClientTLSConfig() types.ClientTLSConfig
- func DevstackEnvFile() string
- func DevstackGetShouldPrintInfo() bool
- func DevstackSetShouldPrintInfo()
- func ForEnvironment() types.BacalhauConfig
- func ForKey(key string, cfg interface{}) error
- func Get[T any](key string) (T, error)
- func GetAutoCertCachePath() string
- func GetBootstrapPeers() ([]multiaddr.Multiaddr, error)
- func GetClientID() (string, error)
- func GetClientPrivateKey() (*rsa.PrivateKey, error)
- func GetClientPublicKey() (*rsa.PublicKey, error)
- func GetClientPublicKeyString() (string, error)
- func GetConfig() (*types.BacalhauConfig, error)
- func GetDockerManifestCacheSettings() (*types.DockerCacheConfig, error)
- func GetDownloadURLRequestRetries() int
- func GetDownloadURLRequestTimeout() time.Duration
- func GetEventTracerPath() string
- func GetExecutorPluginsPath() string
- func GetInstallationUserID() (string, error)
- func GetLibp2pConfig() (types.Libp2pConfig, error)
- func GetLibp2pPrivKey() (libp2p_crypto.PrivKey, error)
- func GetLibp2pTracerPath() string
- func GetLogMode() logger.LogMode
- func GetRequesterCertificateSettings() (string, string)
- func GetRequesterSelfSign() bool
- func GetStoragePath() string
- func GetStringMapString(key string) map[string]string
- func GetUpdateCheckFrequency() time.Duration
- func GetVolumeSizeRequestTimeout() time.Duration
- func Getenv(key string) string
- func Init(path string) (types.BacalhauConfig, error)
- func KeyAsEnvVar(key string) string
- func Load(path string) (types.BacalhauConfig, error)
- func NoopConfigHandler(filename string) error
- func PreferredAddress() string
- func ReadConfigHandler(fileName string) error
- func Reset()
- func ServerAPIHost() string
- func ServerAPIPort() uint16
- func ServerAutoCertDomain() string
- func Set(config types.BacalhauConfig) error
- func SetDefault(config types.BacalhauConfig) error
- func SetIntallationID(path string)
- func SetUpdateCheckStatePath(path string)
- func SetValue(key string, value interface{})
- func SetVolumeSizeRequestTimeout(value time.Duration)
- func ShouldKeepStack() bool
- func WritePersistedConfigs(configFile string, resolvedCfg types.BacalhauConfig) error
- type DockerCredentials
- type Environment
- type Option
- type Params
Constants ¶
const ( // user key files Libp2pPrivateKeyFileName = "libp2p_private_key" UserPrivateKeyFileName = "user_id.pem" // compute paths ComputeStoragesPath = "executor_storages" ComputeStorePath = "compute_store" PluginsPath = "plugins" // orchestrator paths OrchestratorStorePath = "orchestrator_store" AutoCertCachePath = "autocert-cache" NetworkTransportStore = "nats-store" // update check paths UpdateCheckStatePath = "update.json" // auth paths TokensPath = "tokens.json" )
const ( ConfigFileName = "config.yaml" ConfigFileMode = 0666 )
const ( DockerUsernameEnvVar = "DOCKER_USERNAME" DockerPasswordEnvVar = "DOCKER_PASSWORD" )
Variables ¶
var ( ComputeExecutionsStorePath = filepath.Join(ComputeStorePath, "executions.db") OrchestratorJobStorePath = filepath.Join(OrchestratorStorePath, "jobs.db") )
var (
DecoderHook = viper.DecodeHook(mapstructure.TextUnmarshallerHookFunc())
)
Functions ¶
func ClientAPIBase ¶ added in v1.2.1
func ClientAPIBase() string
func ClientAPIHost ¶ added in v1.0.4
func ClientAPIHost() string
func ClientAPIPort ¶ added in v1.0.4
func ClientAPIPort() uint16
func ClientTLSConfig ¶ added in v1.2.1
func ClientTLSConfig() types.ClientTLSConfig
func DevstackEnvFile ¶
func DevstackEnvFile() string
func DevstackGetShouldPrintInfo ¶
func DevstackGetShouldPrintInfo() bool
func DevstackSetShouldPrintInfo ¶
func DevstackSetShouldPrintInfo()
func ForEnvironment ¶ added in v1.0.4
func ForEnvironment() types.BacalhauConfig
func ForKey ¶ added in v1.0.4
ForKey unmarshals configuration values associated with a given key into the provided cfg structure. It uses unmarshalCompositeKey internally to handle composite keys, ensuring values spread across nested sub-keys are correctly populated into the cfg structure.
Parameters:
- key: The configuration key to retrieve values for.
- cfg: The structure into which the configuration values will be unmarshaled.
Returns:
- An error if any occurred during unmarshaling; otherwise, nil.
func GetAutoCertCachePath ¶ added in v1.0.4
func GetAutoCertCachePath() string
func GetBootstrapPeers ¶ added in v1.0.4
func GetBootstrapPeers() ([]multiaddr.Multiaddr, error)
func GetClientID ¶ added in v1.0.4
func GetClientPrivateKey ¶ added in v1.0.4
func GetClientPrivateKey() (*rsa.PrivateKey, error)
func GetClientPublicKey ¶ added in v1.0.4
func GetClientPublicKeyString ¶ added in v1.0.4
GetClientPublicKeyString returns a base64-encoding of the user's public ID key: NOTE: must be called after InitConfig() or system will panic.
func GetConfig ¶ added in v1.2.2
func GetConfig() (*types.BacalhauConfig, error)
GetConfig returns the current resolved configuration from viper as a BacalhauConfig. This is the resolved configuration after all configuration sources have been merged, including the default configuration, the configuration file, environment variables, and flags.
func GetDockerManifestCacheSettings ¶ added in v1.2.1
func GetDockerManifestCacheSettings() (*types.DockerCacheConfig, error)
func GetDownloadURLRequestRetries ¶
func GetDownloadURLRequestRetries() int
func GetEventTracerPath ¶
func GetEventTracerPath() string
func GetExecutorPluginsPath ¶ added in v1.0.4
func GetExecutorPluginsPath() string
func GetInstallationUserID ¶ added in v1.1.3
func GetLibp2pConfig ¶ added in v1.0.4
func GetLibp2pConfig() (types.Libp2pConfig, error)
func GetLibp2pPrivKey ¶ added in v1.0.4
func GetLibp2pPrivKey() (libp2p_crypto.PrivKey, error)
func GetLibp2pTracerPath ¶
func GetLibp2pTracerPath() string
func GetLogMode ¶ added in v1.0.4
func GetRequesterCertificateSettings ¶ added in v1.1.0
func GetRequesterSelfSign ¶ added in v1.3.1
func GetRequesterSelfSign() bool
func GetStoragePath ¶
func GetStoragePath() string
func GetStringMapString ¶ added in v1.0.4
func GetUpdateCheckFrequency ¶ added in v1.1.2
func Getenv ¶ added in v1.0.4
Getenv wraps os.Getenv and retrieves the value of the environment variable named by the config key. It returns the value, which will be empty if the variable is not present.
func KeyAsEnvVar ¶ added in v1.0.4
KeyAsEnvVar returns the environment variable corresponding to a config key
func NoopConfigHandler ¶ added in v1.1.5
func PreferredAddress ¶ added in v1.0.2
func PreferredAddress() string
PreferredAddress will allow for the specifying of the preferred address to listen on for cases where it is not clear, or where the address does not appear when using 0.0.0.0
func ReadConfigHandler ¶ added in v1.1.5
func ServerAPIHost ¶ added in v1.0.4
func ServerAPIHost() string
func ServerAPIPort ¶ added in v1.0.4
func ServerAPIPort() uint16
func ServerAutoCertDomain ¶ added in v1.0.4
func ServerAutoCertDomain() string
func Set ¶ added in v1.0.4
func Set(config types.BacalhauConfig) error
Set sets the configuration value. Will be used instead of values obtained via flags, config file, ENV, default. Useful for testing.
func SetDefault ¶ added in v1.1.0
func SetDefault(config types.BacalhauConfig) error
SetDefault sets the default value for the configuration. Default only used when no value is provided by the user via an explicit call to Set, flag, config file or ENV.
func SetIntallationID ¶ added in v1.1.3
func SetIntallationID(path string)
func SetUpdateCheckStatePath ¶ added in v1.1.2
func SetUpdateCheckStatePath(path string)
func SetValue ¶ added in v1.2.2
func SetValue(key string, value interface{})
SetValue sets the configuration value. This value won't be persisted in the config file. Will be used instead of values obtained via flags, config file, ENV, default.
func ShouldKeepStack ¶
func ShouldKeepStack() bool
func WritePersistedConfigs ¶ added in v1.2.2
func WritePersistedConfigs(configFile string, resolvedCfg types.BacalhauConfig) error
WritePersistedConfigs will write certain values from the resolved config to the persisted config. These include fields for configurations that must not change between version updates, such as the execution store and job store paths, in case we change their default values in future updates.
Types ¶
type DockerCredentials ¶ added in v0.3.26
func GetDockerCredentials ¶ added in v0.3.26
func GetDockerCredentials() DockerCredentials
func (*DockerCredentials) IsValid ¶ added in v0.3.26
func (d *DockerCredentials) IsValid() bool
type Environment ¶ added in v1.0.4
type Environment string
const ( // Known environments that are configured in ops/terraform: EnvironmentStaging Environment = "staging" EnvironmentProd Environment = "production" EnvironmentDev Environment = "development" EnvironmentTest Environment = "test" EnvironmentLocal Environment = "local" )
func GetConfigEnvironment ¶ added in v1.0.4
func GetConfigEnvironment() Environment
func (Environment) IsKnown ¶ added in v1.0.4
func (e Environment) IsKnown() bool
func (Environment) String ¶ added in v1.0.4
func (e Environment) String() string
type Option ¶ added in v1.1.5
type Option func(options *Params)
func WithDefaultConfig ¶ added in v1.1.5
func WithDefaultConfig(cfg types.BacalhauConfig) Option