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 Config
- type Metrics
- type OpenTracing
- type Profiling
- type Version
Constants ¶
const Servicename = "go-micro"
Servicename the name of this service
Variables ¶
var DefaultConfig = Config{ HTTP: shttp.Config{ Servicename: "go-micro", Port: 8000, Sslport: 8443, ServiceURL: "https://127.0.0.1:8443", }, HealthSystem: health.Config{ Period: 30, StartDelay: 3, }, SecretFile: "", Logging: logging.Config{ Level: "INFO", Filename: "${configdir}/logging.log", }, }
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 Config ¶
type Config struct { // all secrets will be stored in this file, same structure as the main config file SecretFile string `yaml:"secretfile"` // configure logging to gelf logging system Logging logging.Config `yaml:"logging"` // use authentication via jwt Auth Authentication `yaml:"auth"` // opentelemtrie tracer can be configured here OpenTracing OpenTracing `yaml:"opentracing"` // and some metrics Metrics Metrics `yaml:"metrics"` // HTTP REST Service HTTP shttp.Config `yaml:"http"` // special config for health checks HealthSystem health.Config `yaml:"healthcheck"` // CA service will be used, microvault CA caservice.Config `yaml:"ca"` // Enable Profiling option Profiling Profiling `yaml:"profiling"` // This is the demo address storage config AddressStorage adrsvc.Config `yaml:"addressstorage"` }
Config our service configuration
type OpenTracing ¶
OpenTracing 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