Documentation ¶
Index ¶
- Constants
- Variables
- func GetConfigValueAsBool(properties map[string]any, key string) (bool, error)
- func GetConfigValueAsInt(properties map[string]any, key string) (int64, error)
- func GetConfigValueAsString(properties map[string]any, key string) (string, error)
- func GetDefaultConfigFolder() (string, error)
- func GetDefaultConfigfile() (string, error)
- func Load() error
- func ReplaceConfigdir(s string) (string, error)
- type Authentication
- type CAService
- type Config
- type Engine
- type Extractor
- type HTTP
- type Metrics
- type OpenTracing
- type Service
- type Storage
- type Version
Constants ¶
const DoServiceConfig = "service_config"
DoServiceConfig the name of the injected config
const Servicename = "goblob-service"
Servicename the name of this service
Variables ¶
var DefaultConfig = Config{ Service: Service{ HTTP: HTTP{ Port: 8000, Sslport: 8443, ServiceURL: "https://127.0.0.1:8443", }, HealthSystem: health.Config{ Period: 30, StartDelay: 3, }, }, Apikey: true, SecretFile: "", Logging: logging.LoggingConfig{ Level: "INFO", Filename: "${configdir}/logging.log", }, Engine: Engine{ RetentionManager: "SingleRetention", Tenantautoadd: true, BackupSyncmode: false, Storage: Storage{ Storageclass: "SimpleFile", Properties: map[string]any{ "rootpath": "./blbstg", }, }, }, HeaderMapping: defaultHeaderMapping, }
DefaultConfig default configuration
var File = "${configdir}/service.yaml"
File the config file
Functions ¶
func GetConfigValueAsBool ¶
GetConfigValueAsBool getting a value as a bool, if possible
func GetConfigValueAsInt ¶
GetConfigValueAsInt getting a value as a int64, if possible
func GetConfigValueAsString ¶
GetConfigValueAsString getting a value as a string, if possible
func GetDefaultConfigFolder ¶
GetDefaultConfigFolder returning the default configuration folder of the system
func GetDefaultConfigfile ¶
GetDefaultConfigfile getting the default config file
func ReplaceConfigdir ¶
ReplaceConfigdir replace the configdir macro
Types ¶
type Authentication ¶
type Authentication struct { Type string `yaml:"type"` Properties map[string]any `yaml:"properties"` }
Authentication configuration
type CAService ¶
type CAService struct { UseCA bool `yaml:"useca"` URL string `yaml:"url"` AccessKey string `yaml:"accesskey"` Secret string `yaml:"secret"` }
CAService the micro-vault ca service config
type Config ¶
type Config struct { // all secrets will be stored in this file, same structure as the main config file SecretFile string `yaml:"secretfile"` Apikey bool `yaml:"apikey"` // all configuration of internal services can be stored here Service Service `yaml:"service"` // configure logging to gelf logging system Logging logging.LoggingConfig `yaml:"logging"` Auth Authentication `yaml:"auth"` Engine Engine `yaml:"engine"` HeaderMapping map[string]string `yaml:"headermapping"` OpenTracing OpenTracing `yaml:"opentracing"` Metrics Metrics `yaml:"metrics"` }
Config our service configuration
type Engine ¶
type Engine struct { RetentionManager string `yaml:"retentionManager"` Tenantautoadd bool `yaml:"tenantautoadd"` BackupSyncmode bool `yaml:"backupsyncmode"` AllowTntBackup bool `yaml:"allowtntbackup"` Storage Storage `yaml:"storage"` Backup Storage `yaml:"backup"` Cache Storage `yaml:"cache"` Index Storage `yaml:"index"` Extractor Extractor `yaml:"extractor"` }
Engine configuration
type Extractor ¶
type Extractor struct { Service string `yaml:"service"` Properties map[string]any `yaml:"properties"` }
Extractor defining config for full text extraction services
type HTTP ¶
type HTTP struct { // port of the http server Port int `yaml:"port"` // port of the https server Sslport int `yaml:"sslport"` // this is the url how to connect to this service from outside ServiceURL string `yaml:"serviceURL"` // other dns names (used for certificate) DNSNames []string `yaml:"dnss"` // other ips (used for certificate) IPAddresses []string `yaml:"ips"` }
HTTP configuration of the http service
type OpenTracing ¶
OpenTracing configuration
type Service ¶
type Service struct { HTTP HTTP `yaml:"http"` // special config for health checks HealthSystem health.Config `yaml:"healthcheck"` // CA service will be used, microvault CA CAService `yaml:"ca"` }
Service the configuration of services inside this ms
type Storage ¶
type Storage struct { Storageclass string `yaml:"storageclass"` Properties map[string]any `yaml:"properties"` }
Storage configuration
type Version ¶
Version version struct
func ParseVersion ¶
ParseVersion parse a string into a version object
func (*Version) IsGreaterThan ¶
IsGreaterThan validate if src version is greater than o
func (*Version) IsSmallerThan ¶
IsSmallerThan validate if src version is smaller than o