config

package
v0.2.1-rc4 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version    string = "dev"
	CommitHash string = "-"
)

Build information -ldflags .

Functions

func ReadConfigYML

func ReadConfigYML(filename string, cfg interface{}) error

ReadConfigYML reads the config file into the config struct.

Types

type Config

type Config struct {
	Project  Project    `yaml:"project"`
	Database Database   `yaml:"database"`
	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"`
	Producer Producer   `yaml:"producer"`
}

Config contains all configuration parameters in the config package.

type Consume

type Consume struct {
	Topic   string   `yaml:"topic"`
	GroupID string   `yaml:"groupId"`
	Brokers []string `yaml:"brokers"`
}

The Kafka consume contains all parameters Consume information.

type Database

type Database struct {
	Host          string `yaml:"host"`
	Port          string `yaml:"port"`
	User          string `yaml:"user"`
	Password      string `yaml:"password"`
	Name          string `yaml:"name"`
	SslMode       string `yaml:"sslmode"`
	MigrationsDir string `yaml:"migrationsDir"`
	Driver        string `yaml:"driver"`
}

Database contains all parameters database connection.

func (*Database) String

func (db *Database) String() string

String returns a data source name.

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 {
	URL     string `yaml:"url"`
	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 Producer

type Producer struct {
	Capacity int      `yaml:"capacity"`
	Topic    string   `yaml:"topic"`
	Brokers  []string `yaml:"brokers"`
}

The Kafka producer contains all parameters Producer information.

type Project

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

Project contains all parameters project information.

type REST

type REST struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

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

Status contains all parameters status information.

Jump to

Keyboard shortcuts

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