Documentation
¶
Overview ¶
Package config provides configuration loading and persistence for MALT.
Index ¶
- func ConfigDir(configPath string) (string, error)
- func DefaultConfigPath() (string, error)
- func ExpandPath(path string) (string, error)
- func ResolveConfigPath(explicit string) (string, error)
- func WriteToFile(path string, cfg *Config) error
- type ArcTableConfig
- type CASConfig
- type ClientConfig
- type Config
- type KVStoreConfig
- type LoggingConfig
- type RPCConfig
- type StateConfig
- type StructureConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
DefaultConfigPath returns the canonical default config path.
func ExpandPath ¶
ExpandPath expands "~" prefixes and cleans the resulting path.
func ResolveConfigPath ¶
ResolveConfigPath returns the explicit path if provided, otherwise the default path.
func WriteToFile ¶
WriteToFile writes the config to the given path in pretty JSON format.
Types ¶
type ArcTableConfig ¶
type ArcTableConfig struct {
Type string `json:"type"`
}
ArcTableConfig configures the ArcTable implementation.
type CASConfig ¶
type CASConfig struct {
Mode string `json:"mode"`
BaseURL string `json:"base_url,omitempty"`
Timeout string `json:"timeout"`
}
CASConfig configures the immutable content backend.
type Config ¶
type Config struct {
RPC RPCConfig `json:"rpc"`
State StateConfig `json:"state"`
Structure StructureConfig `json:"structure"`
CAS CASConfig `json:"cas"`
Logging LoggingConfig `json:"logging"`
Client ClientConfig `json:"client"`
}
Config is the root configuration for the MALT runtime.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the runtime default configuration.
func Load ¶
Load loads configuration from the default config path if it exists, otherwise returns defaults.
func LoadFromFile ¶
LoadFromFile loads configuration from a specific file.
func (*Config) APIBaseURL ¶
APIBaseURL returns the daemon API base URL.
func (*Config) CASBaseURL ¶
CASBaseURL returns the active CAS HTTP endpoint.
func (*Config) CASTimeout ¶
CASTimeout parses and returns the CAS timeout.
func (*Config) KVStorePath ¶
KVStorePath returns the absolute KVStore path.
func (*Config) RPCBaseURL ¶
RPCBaseURL returns the daemon base URL.
type KVStoreConfig ¶
KVStoreConfig configures the local KV store.
type LoggingConfig ¶
LoggingConfig configures runtime logging.
type RPCConfig ¶
type RPCConfig struct {
Listen string `json:"listen"`
CORSAllowedOrigins []string `json:"cors_allowed_origins,omitempty"`
}
RPCConfig configures the local daemon HTTP endpoint.
type StateConfig ¶
type StateConfig struct {
RootDir string `json:"root_dir"`
KVStore KVStoreConfig `json:"kvstore"`
ArcTable ArcTableConfig `json:"arctable"`
}
StateConfig configures local durable runtime state.
type StructureConfig ¶
type StructureConfig struct {
DefaultBackend string `json:"default_backend"`
}
StructureConfig configures structure runtime defaults.