config

package
v0.16.1-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 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"`
	UsageServer            UsageServerConfig     `koanf:"usageserver"`
	PipelineBackend        PipelineBackendConfig `koanf:"pipelinebackend"`
	MaxBatchSizeLimitation MaxBatchSizeConfig    `koanf:"maxbatchsizelimitation"`
	Temporal               TemporalConfig        `koanf:"temporal"`
	Controller             ControllerConfig      `koanf:"controller"`
	InitModel              InitModelConfig       `koanf:"initmodel"`
}

AppConfig defines

var Config AppConfig

Config - Global variable to export

type CacheConfig

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

CacheConfig related to Redis

type ControllerConfig

type ControllerConfig struct {
	Host        string `koanf:"host"`
	PrivatePort int    `koanf:"privateport"`
	HTTPS       struct {
		Cert string `koanf:"cert"`
		Key  string `koanf:"key"`
	}
}

ControllerConfig related to controller

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"`
	}
}

DatabaseConfig related to database

type InitModelConfig

type InitModelConfig struct {
	Path    string `koanf:"path"`
	Enabled bool   `koanf:"enabled"`
}

type MaxBatchSizeConfig

type MaxBatchSizeConfig struct {
	Unspecified          int `koanf:"unspecified"`
	Classification       int `koanf:"classification"`
	Detection            int `koanf:"detection"`
	Keypoint             int `koanf:"keypoint"`
	Ocr                  int `koanf:"ocr"`
	InstanceSegmentation int `koanf:"instancesegmentation"`
	SemanticSegmentation int `koanf:"semanticsegmentation"`
	TextGeneration       int `koanf:"textgeneration"`
}

MaxBatchSizeConfig defines the maximum size of the batch of a AI task

type MgmtBackendConfig

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

MgmtBackendConfig related to mgmt-backend

type PipelineBackendConfig

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

PipelineBackendConfig related to pipeline-backend

type ServerConfig

type ServerConfig struct {
	PrivatePort int `koanf:"privateport"`
	PublicPort  int `koanf:"publicport"`
	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"`
	ItMode       bool     `koanf:"itmode"`
	MaxDataSize  int      `koanf:"maxdatasize"`
}

ServerConfig defines HTTP server configurations

type TemporalConfig

type TemporalConfig struct {
	HostPort   string
	Namespace  string
	Ca         string
	Cert       string
	Key        string
	ServerName string
}

TemporalConfig related to Temporal

type TritonServerConfig

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

TritonServerConfig related to Triton server

type UsageServerConfig

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

UsageServerConfig related to usage-server

Jump to

Keyboard shortcuts

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