config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConfig

func ValidateConfig(cfg *Config) error

Types

type Config

type Config struct {
	GRPC            GRPC
	REST            REST
	Logger          Logger
	Monitor         Monitor
	ExtraAttributes ExtraAttributes
	Filter          Filter
	Preprocessor    Preprocessor
	ModelAttributes ModelAttributes
}

Config is configuration for Server

func RunConfig

func RunConfig() (*Config, error)

func RunConfigWithConfigFile

func RunConfigWithConfigFile(configPath string) (*Config, error)

RunConfig calls the LoadConfig function & returns errors if any

func (*Config) LoadConfig

func (config *Config) LoadConfig(path string) error

LoadConfig Loads a TOML file from the path into this Config object

type ExtraAttributes

type ExtraAttributes struct {
	MonitorMode string `toml:"monitorMode"`
}

type Filter

type Filter struct {
	AllowList map[string]string `toml:"allowList"`
	DenyList  map[string]string `toml:"denyList"`
}

type GRPC

type GRPC struct {
	Port string `toml:"port"`
}

GRPC contains the gRPC-specific configuration options

type Logger

type Logger struct {
	Level  string `toml:"level"`
	Output string `toml:"output"`
	Format string `toml:"format"`
}

Logger contains the logging-specific configuration options

type ModelAttributes

type ModelAttributes struct {
	ModelPath string `toml:"modelPath"`
}

type Monitor

type Monitor struct {
	Address string `toml:"address"`
}

Monitor contains the monitoring-specific configuration options

type Preprocessor

type Preprocessor struct {
	SocketPath string `toml:"socketPath" default:"/tmp/spamcheck/preprocessor.sock"`
}

type REST

type REST struct {
	ExternalPort string `toml:"externalPort"`
}

REST contains the REST-specific configuration options

Jump to

Keyboard shortcuts

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