config

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileName = "config.yaml"

	// 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"
)
View Source
const (
	DockerUsernameEnvVar = "DOCKER_USERNAME"
	DockerPasswordEnvVar = "DOCKER_PASSWORD"
)

Variables

View Source
var (
	ComputeExecutionsStorePath = filepath.Join(ComputeStorePath, "executions.db")
	OrchestratorJobStorePath   = filepath.Join(OrchestratorStorePath, "jobs.db")

	DecoderHook = viper.DecodeHook(mapstructure.TextUnmarshallerHookFunc())
)

Functions

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

func GetClientID(path string) (string, error)

func GetClientPrivateKey added in v1.0.4

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

func GetLibp2pPrivKey added in v1.0.4

func GetLibp2pPrivKey(path string) (libp2p_crypto.PrivKey, error)

func KeyAsEnvVar added in v1.0.4

func KeyAsEnvVar(key string) string

KeyAsEnvVar returns the environment variable corresponding to a config key

func New added in v1.3.2

func New(opts ...Option) *config

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 ShouldKeepStack

func ShouldKeepStack() bool

func WritePersistedConfigs added in v1.2.2

func WritePersistedConfigs(configFilePath string, cfg 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

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

type Option added in v1.1.5

type Option = func(s *config)

func WithDefaultConfig added in v1.1.5

func WithDefaultConfig(cfg types.BacalhauConfig) Option

func WithViper added in v1.3.2

func WithViper(v *viper.Viper) Option

type ReadWriter added in v1.3.2

type ReadWriter interface {
	Reader
	Writer
}

type Reader added in v1.3.2

type Reader interface {
	Current() (types.BacalhauConfig, error)
}

type Writer added in v1.3.2

type Writer interface {
	Load(path string) error
	Set(key string, value interface{})
	SetIfAbsent(key string, value interface{})
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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