config

package
v0.7.1-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

Init - Assign global config to decoded config struct

func ValidateConfig

func ValidateConfig(cfg *AppConfig) error

ValidateConfig is for custom validation rules for the configuration

Types

type AppConfig

type AppConfig struct {
	Server          ServerConfig          `koanf:"server"`
	Database        DatabaseConfig        `koanf:"database"`
	TritonServer    TritonServerConfig    `koanf:"tritonserver"`
	MgmtBackend     MgmtBackendConfig     `koanf:"mgmtbackend"`
	Cache           CacheConfig           `koanf:"cache"`
	UsageBackend    UsageBackendConfig    `koanf:"usagebackend"`
	PipelineBackend PipelineBackendConfig `koanf:"pipelinebackend"`
}

AppConfig defines

var Config AppConfig

Config - Global variable to export

type CacheConfig

type CacheConfig struct {
	Redis struct {
		RedisOptions redis.Options `koanf:"redisoptions"`
	}
}

CacheConfig related to Redis

type DatabaseConfig

type DatabaseConfig struct {
	Username string `koanf:"username"`
	Password string `koanf:"password"`
	Host     string `koanf:"host"`
	Port     int    `koanf:"port"`
	Name     string `koanf:"name"`
	Version  uint   `koanf:"version"`
	TimeZone string `koanf:"timezone"`
	Pool     struct {
		IdleConnections int           `koanf:"idleconnections"`
		MaxConnections  int           `koanf:"maxconnections"`
		ConnLifeTime    time.Duration `koanf:"connlifetime"`
	}
}

config related to database

type MgmtBackendConfig

type MgmtBackendConfig struct {
	Host  string `koanf:"host"`
	Port  int    `koanf:"port"`
	HTTPS struct {
		Cert string `koanf:"cert"`
		Key  string `koanf:"key"`
	}
}

MgmtBackendConfig related to mgmt-backend

type PipelineBackendConfig

type PipelineBackendConfig struct {
	Host  string `koanf:"host"`
	Port  int    `koanf:"port"`
	HTTPS struct {
		Cert string `koanf:"cert"`
		Key  string `koanf:"key"`
	}
}

type ServerConfig

type ServerConfig struct {
	Port  int `koanf:"port"`
	HTTPS struct {
		Cert string `koanf:"cert"`
		Key  string `koanf:"key"`
	}
	CORSOrigins  []string `koanf:"corsorigins"`
	Edition      string   `koanf:"edition"`
	DisableUsage bool     `koanf:"disableusage"`
	Debug        bool     `koanf:"debug"`
}

ServerConfig defines HTTP server configurations

type TritonServerConfig

type TritonServerConfig struct {
	GrpcUri    string `koanf:"grpcuri"`
	ModelStore string `koanf:"modelstore"`
}

type UsageBackendConfig

type UsageBackendConfig struct {
	TLSEnabled bool   `koanf:"tlsenabled"`
	Host       string `koanf:"host"`
	Port       int    `koanf:"port"`
}

Jump to

Keyboard shortcuts

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