config

package
v1.1.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientAPIHost added in v1.0.4

func ClientAPIHost() string

func ClientAPIPort added in v1.0.4

func ClientAPIPort() uint16

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

func ForKey(key string, cfg interface{}) error

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 Get added in v1.0.4

func Get[T any](key string) (T, error)

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 GetClientID() (string, error)

func GetClientPrivateKey added in v1.0.4

func GetClientPrivateKey() (*rsa.PrivateKey, error)

func GetClientPublicKey added in v1.0.4

func GetClientPublicKey() (*rsa.PublicKey, error)

func GetClientPublicKeyString added in v1.0.4

func GetClientPublicKeyString() (string, error)

GetClientPublicKeyString returns a base64-encoding of the user's public ID key: NOTE: must be called after InitConfig() or system will panic.

func GetDownloadURLRequestRetries

func GetDownloadURLRequestRetries() int

func GetDownloadURLRequestTimeout

func GetDownloadURLRequestTimeout() time.Duration

func GetEventTracerPath

func GetEventTracerPath() string

func GetExecutorPluginsPath added in v1.0.4

func GetExecutorPluginsPath() string

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 GetLogMode() logger.LogMode

func GetRequesterCertificateSettings added in v1.1.0

func GetRequesterCertificateSettings() (string, string)

func GetStoragePath

func GetStoragePath() string

func GetStringMapString added in v1.0.4

func GetStringMapString(key string) map[string]string

func GetUpdateCheckFrequency added in v1.1.2

func GetUpdateCheckFrequency() time.Duration

func GetVolumeSizeRequestTimeout

func GetVolumeSizeRequestTimeout() time.Duration

func Getenv added in v1.0.4

func Getenv(key string) string

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 Init added in v1.0.4

func Init(defaultConfig types.BacalhauConfig, path string, fileName, fileType string) (types.BacalhauConfig, error)

func KeyAsEnvVar added in v1.0.4

func KeyAsEnvVar(key string) string

KeyAsEnvVar returns the environment variable corresponding to a config key

func Load added in v1.0.4

func Load(path string, fileName, fileType string) (types.BacalhauConfig, error)

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 ReadConfig added in v1.0.4

func ReadConfig(fileName string) error

func Reset added in v1.0.4

func Reset()

Reset clears all configuration, useful for testing.

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 SetAutoCertCachePath added in v1.0.4

func SetAutoCertCachePath(path string)

func SetComputeStoragesPath added in v1.0.4

func SetComputeStoragesPath(path string)

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 SetExecutorPluginPath added in v1.0.4

func SetExecutorPluginPath(path string)

func SetLibp2pKey added in v1.0.4

func SetLibp2pKey(path string)

func SetUpdateCheckStatePath added in v1.1.2

func SetUpdateCheckStatePath(path string)

func SetUserKey added in v1.0.4

func SetUserKey(path string)

func SetVolumeSizeRequestTimeout

func SetVolumeSizeRequestTimeout(value time.Duration)

func ShouldKeepStack

func ShouldKeepStack() bool

func WriteConfig added in v1.0.4

func WriteConfig(fileName string) error

Types

type DockerCredentials added in v0.3.26

type DockerCredentials struct {
	Username string
	Password string
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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