config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Project Project    `yaml:"project"`
	Logger  zap.Config `yaml:"logger"`
	GRPC    GRPC       `yaml:"grpc"`
	REST    REST       `yaml:"rest"`
	Jaeger  Jaeger     `yaml:"jaeger"`
	Metrics Metrics    `yaml:"metrics"`
	Status  Status     `yaml:"status"`
}

Config contains all configuration parameters in the config package.

func NewConfigWithYAML

func NewConfigWithYAML(configYML string) (*Config, error)

NewConfigWithYAML loads config from yaml.

type GRPC

type GRPC struct {
	Host              string        `yaml:"host"`
	Port              int           `yaml:"port"`
	MaxConnectionIdle time.Duration `yaml:"maxConnectionIdle"`
	Timeout           time.Duration `yaml:"timeout"`
	MaxConnectionAge  time.Duration `yaml:"maxConnectionAge"`
}

GRPC contains all parameters of gRPC.

type Jaeger

type Jaeger struct {
	Host    string `yaml:"host"`
	Port    int    `yaml:"port"`
	Service string `yaml:"service"`
}

Jaeger contains all parameters tracer information.

type Metrics

type Metrics struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
	Path string `yaml:"path"`
}

Metrics contains all parameters metrics information.

type Project

type Project struct {
	Debug       bool   `yaml:"debug"`
	Name        string `yaml:"name"`
	Environment string `yaml:"environment"`
	Version     string
	CommitHash  string
}

Project contains all parameters project information.

type REST

type REST struct {
	Host           string   `yaml:"host"`
	Port           int      `yaml:"port"`
	AllowedOrigins []string `yaml:"allowedOrigins"`
	AllowedMethods []string `yaml:"allowedMethods"`
}

REST contains all parameters of REST.

type Status

type Status struct {
	Host          string `yaml:"host"`
	Port          int    `yaml:"port"`
	LivenessPath  string `yaml:"livenessPath"`
	ReadinessPath string `yaml:"readinessPath"`
	VersionPath   string `yaml:"versionPath"`
	LoggerPath    string `yaml:"loggerPath"`
	SwaggerDir    string `yaml:"swaggerDir"`
	SwaggerPath   string `yaml:"swaggerPath"`
}

Status contains all parameters status information.

Jump to

Keyboard shortcuts

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