config

package
v0.0.0-...-f5cdc36 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigPath

func GetConfigPath(configPath string) string

func LoadConfig

func LoadConfig(filename string) (*viper.Viper, error)

Load config file from given path

Types

type AWS

type AWS struct {
	S3Region         string
	S3EndPoint       string
	S3EndPointMinio  string
	DisableSSL       bool
	S3ForcePathStyle bool
}

type Config

type Config struct {
	HttpServer HttpServer
	Postgres   postgres.Config
	GRPC       GRPC
	RabbitMQ   rabbitmq.Config
	Metrics    Metrics
	Logger     logger.Config
	Redis      redis.Config
	AWS        AWS
	Jaeger     jaeger.Config
	GRPCServer GRPCServer
}

func GetConfig

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

Get config

func ParseConfig

func ParseConfig(v *viper.Viper) (*Config, error)

Parse config file

func (*Config) ProductionMode

func (c *Config) ProductionMode() bool

type GRPC

type GRPC struct {
	SessionServicePort  string
	UserServicePort     string
	HotelsServicePort   string
	CommentsServicePort string
	ImagesServicePort   string
}

type GRPCServer

type GRPCServer struct {
	SessionPrefix          string
	Port                   string
	SessionGrpcServicePort string
	AppVersion             string
	SessionID              string
	CSRFPrefix             string
	Mode                   string
	CsrfSalt               string
	CsrfExpire             int
	SessionExpire          int
	Timeout                time.Duration
	ReadTimeout            time.Duration
	WriteTimeout           time.Duration
	MaxConnectionIdle      time.Duration
	MaxConnectionAge       time.Duration
	CookieLifeTime         int
}

type HttpServer

type HttpServer struct {
	AppVersion        string
	Port              string
	PprofPort         string
	SessionCookieName string
	CSRFHeader        string
	Timeout           time.Duration
	ReadTimeout       time.Duration
	WriteTimeout      time.Duration
	CookieLifeTime    int
}

type Metrics

type Metrics struct {
	Port        string
	URL         string
	ServiceName string
}

Metrics config

Jump to

Keyboard shortcuts

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