Documentation ¶
Index ¶
- Constants
- Variables
- func AppName() string
- func ValidateClientConfig(conf *ClientConfig) error
- func ValidateServerConfig(_ *ServerConfig) error
- type ClientConfig
- func (c *ClientConfig) GetAllNamespaceNames() []string
- func (c *ClientConfig) GetNamespaceByName(name string) (*Namespace, error)
- func (c *ClientConfig) GetSelectedNamespaces(namespaceNames ...string) ([]*Namespace, error)
- func (c *ClientConfig) ValidateNamespaceNames(namespaceNames ...string) error
- type Config
- type DBConfig
- type Datastore
- type Job
- type LogConfig
- type LogLevel
- type Namespace
- type Optimus
- type PluginConfig
- type Project
- type ResourceManager
- type ResourceManagerConfigOptimus
- type SchedulerConfig
- type Serve
- type ServerConfig
- type TelemetryConfig
- type Version
Constants ¶
View Source
const ( ServerName = "optimus" ClientName = "optimus-cli" )
View Source
const ( DefaultFilename = "optimus.yaml" DefaultConfigFilename = "config.yaml" // default file name for server config DefaultFileExtension = "yaml" DefaultEnvPrefix = "OPTIMUS" EmptyPath = "" )
Variables ¶
View Source
var ( // overridden by the build system BuildVersion = "dev" BuildCommit = "" BuildDate = "" )
View Source
var (
FS = afero.NewReadOnlyFs(afero.NewOsFs())
)
Functions ¶
func ValidateClientConfig ¶
func ValidateClientConfig(conf *ClientConfig) error
func ValidateServerConfig ¶
func ValidateServerConfig(_ *ServerConfig) error
Types ¶
type ClientConfig ¶
type ClientConfig struct { Version Version `mapstructure:"version"` Log LogConfig `mapstructure:"log"` Host string `mapstructure:"host"` // optimus server host Project Project `mapstructure:"project"` Namespaces []*Namespace `mapstructure:"namespaces"` // contains filtered or unexported fields }
func LoadClientConfig ¶
func LoadClientConfig(filePath string) (*ClientConfig, error)
LoadClientConfig load the project specific config from these locations: 1. filepath. ./optimus <client_command> -c "path/to/config/optimus.yaml" 2. current dir. Optimus will look at current directory if there's optimus.yaml there, use it
func (*ClientConfig) GetAllNamespaceNames ¶
func (c *ClientConfig) GetAllNamespaceNames() []string
func (*ClientConfig) GetNamespaceByName ¶
func (c *ClientConfig) GetNamespaceByName(name string) (*Namespace, error)
func (*ClientConfig) GetSelectedNamespaces ¶
func (c *ClientConfig) GetSelectedNamespaces(namespaceNames ...string) ([]*Namespace, error)
func (*ClientConfig) ValidateNamespaceNames ¶
func (c *ClientConfig) ValidateNamespaceNames(namespaceNames ...string) error
type DBConfig ¶
type DBConfig struct { DSN string `mapstructure:"dsn"` // data source name e.g.: postgres://user:password@host:123/database?sslmode=disable MinOpenConnection int `mapstructure:"min_open_connection" default:"5"` // minimum open DB connections MaxOpenConnection int `mapstructure:"max_open_connection" default:"20"` // maximum allowed open DB connections }
type Job ¶
type Job struct {
Path string `mapstructure:"path"` // directory to find specifications
}
type Optimus ¶
type Optimus struct { // configuration version Version int `mapstructure:"version"` // optimus server host Host string `mapstructure:"host"` Project Project `mapstructure:"project"` Namespaces []*Namespace `mapstructure:"namespaces"` Server Serve `mapstructure:"serve"` Log LogConfig `mapstructure:"log"` Scheduler SchedulerConfig `mapstructure:"scheduler"` Telemetry TelemetryConfig `mapstructure:"telemetry"` // contains filtered or unexported fields }
func (*Optimus) GetNamespaceByName ¶
func (*Optimus) GetVersion ¶
type PluginConfig ¶
type PluginConfig struct {
Artifacts []string `mapstructure:"artifacts"`
}
type ResourceManager ¶
type SchedulerConfig ¶
type Serve ¶
type Serve struct { Port int `mapstructure:"port" default:"9100"` // port to listen on Host string `mapstructure:"host" default:"0.0.0.0"` // the network interface to listen on IngressHost string `mapstructure:"ingress_host"` // service ingress host for jobs to communicate back to optimus AppKey string `mapstructure:"app_key"` // random 32 character hash used for encrypting secrets DB DBConfig `mapstructure:"db"` }
type ServerConfig ¶
type ServerConfig struct { Version Version `mapstructure:"version"` Log LogConfig `mapstructure:"log"` Serve Serve `mapstructure:"serve"` Scheduler SchedulerConfig `mapstructure:"scheduler"` Telemetry TelemetryConfig `mapstructure:"telemetry"` ResourceManagers []ResourceManager `mapstructure:"resource_managers"` Plugin PluginConfig `mapstructure:"plugin"` }
func LoadServerConfig ¶
func LoadServerConfig(filePath string) (*ServerConfig, error)
LoadServerConfig load the server specific config from these locations: 1. filepath. ./optimus <server_command> -c "path/to/config.yaml" 2. env var. eg. OPTIMUS_SERVE_PORT, etc 3. executable binary location
type TelemetryConfig ¶
Click to show internal directories.
Click to hide internal directories.