config

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DIR_NAME   = ".cedana"
	FILE_NAME  = "cli-config"
	FILE_TYPE  = "json"
	DIR_PERM   = 0o755
	FILE_PERM  = 0o644
	ENV_PREFIX = "CEDANA_CLI"

	DEFAULT_SOCK_PERMS = 0o666

	DEFAULT_LOG_LEVEL = "info"
)

Variables

This section is empty.

Functions

func Init

func Init(args InitArgs) error

Types

type Config

type Config struct {
	// LogLevel is the default log level used by the server
	LogLevel string `json:"log_level" key:"log_level" yaml:"log_level" mapstructure:"log_level"`
	// Connection settings
	Connection Connection `json:"connection" key:"connection" yaml:"connection" mapstructure:"connection"`
}

Cedana configuration. Each of the below fields can also be set through an environment variable with the same name, prefixed, and in uppercase. E.g. `Metrics.ASR` can be set with `CEDANA_METRICS_ASR`. The `env_aliases` tag below specifies alternative (alias) environment variable names (comma-separated).

var Global Config = Config{

	Connection: Connection{
		URL:       "",
		AuthToken: "",
	},
}

The default global config. This will get overwritten by the config file or env vars during startup, if they exist.

type Connection

type Connection struct {
	// URL is your unique Cedana endpoint URL
	URL string `json:"url" key:"url" yaml:"url" mapstructure:"url" env_aliases:"CEDANA_URL"`
	// AuthToken is your authentication token for the Cedana endpoint
	AuthToken string `json:"auth_token" key:"auth_token" yaml:"auth_token" mapstructure:"auth_token" env_aliases:"CEDANA_AUTH_TOKEN"`
}

type InitArgs

type InitArgs struct {
	Config    string
	ConfigDir string
}

Jump to

Keyboard shortcuts

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