Documentation
¶
Index ¶
- Constants
- func ExpandTilde(p string) string
- func Init()
- func RootPath() string
- func Validate() error
- type APIConfig
- type AllowConfig
- type AuthConfig
- type BeetleConfig
- type CentipedeConfig
- type DBConfig
- type EncryptionConfig
- type HoneybeeConfig
- type LogfileConfig
- type MigrationConfig
- type NodeConfig
- type SelfConfig
- type TumblebugConfig
Constants ¶
const ModuleName = "cm-centipede"
Variables ¶
This section is empty.
Functions ¶
func ExpandTilde ¶
ExpandTilde expands a leading "~/" to the current user's home directory. Go does not expand tilde automatically; paths from config/env must be processed through this function before being passed to os/filepath calls.
func Init ¶
func Init()
Init loads configuration from the YAML file and applies environment variable overrides.
Types ¶
type APIConfig ¶
type APIConfig struct {
Allow AllowConfig `mapstructure:"allow"`
Auth AuthConfig `mapstructure:"auth"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
RateLimit int `mapstructure:"rateLimit"`
}
type AllowConfig ¶
type AllowConfig struct {
Origins string `mapstructure:"origins"`
}
type AuthConfig ¶
type BeetleConfig ¶
type BeetleConfig struct {
Endpoint string `mapstructure:"endpoint"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
}
BeetleConfig holds the cm-beetle REST endpoint and Basic Auth credentials. cm-beetle is the only reference source for migration targets: node SSH access and object storage both resolve through it.
type CentipedeConfig ¶
type CentipedeConfig struct {
Self SelfConfig `mapstructure:"self"`
Honeybee HoneybeeConfig `mapstructure:"honeybee"`
Beetle BeetleConfig `mapstructure:"beetle"`
Tumblebug TumblebugConfig `mapstructure:"tumblebug"`
API APIConfig `mapstructure:"api"`
DB DBConfig `mapstructure:"db"`
Migration MigrationConfig `mapstructure:"migration"`
Encryption EncryptionConfig `mapstructure:"encryption"`
Logfile LogfileConfig `mapstructure:"logfile"`
Loglevel string `mapstructure:"loglevel"`
Logwriter string `mapstructure:"logwriter"`
Node NodeConfig `mapstructure:"node"`
}
var Conf CentipedeConfig
Conf is the global configuration instance.
type EncryptionConfig ¶
type EncryptionConfig struct {
SecretKey string `mapstructure:"secretKey"`
}
type HoneybeeConfig ¶
type LogfileConfig ¶
type MigrationConfig ¶
type MigrationConfig struct {
// StagingDir is the local staging root used when a migration request names
// none. Empty leaves the choice to data-mig: $TMPDIR/datamig-staging, or
// /tmp/datamig-staging when TMPDIR is unset. Init stores it as an absolute
// path.
StagingDir string `mapstructure:"stagingDir"`
// Concurrency is how many transfers each item runs at once when a migration
// request names none: 1 to 32, or 0 to leave data-mig's default (4).
Concurrency int `mapstructure:"concurrency"`
}
MigrationConfig holds server-wide defaults for migration execution.
type NodeConfig ¶
type NodeConfig struct {
Env string `mapstructure:"env"`
}
type SelfConfig ¶
type SelfConfig struct {
Endpoint string `mapstructure:"endpoint"`
}
type TumblebugConfig ¶
type TumblebugConfig struct {
Endpoint string `mapstructure:"endpoint"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
}
TumblebugConfig holds the cb-tumblebug REST endpoint used during object storage transfers only. data-mig reaches managed buckets through cb-tumblebug's ObjectStorage API, so the endpoint is still needed even though cb-tumblebug is not a selectable connection source.