config

package
v0.0.0-...-1e91676 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// Name is Application Name for this project
	Name string `json:"name"`
	// HTTPPort is TCP port to listen by HTTP/REST gateway
	HTTPPort string `json:"http_port"`
	// GRPCPort is TCP port to listen by gRPC server
	GRPCPort string `json:"grpc_port"`
	// LogLevel is global log level: Debug(-1), Info(0), Warn(1), Error(2), DPanic(3), Panic(4), Fatal(5)
	LogLevel int `json:"log_level"`
	// LogTimeFormat is print time format for logger e.g. 2006-01-02T15:04:05Z07:00
	LogTimeFormat string `json:"time_format"`
	// ContextTimeout is time limit on an event taking place
	ContextTimeout int `json:"context_timeout "`
	// JWTSecret is a private jwt secret key
	JWTSecret string `json:"jwt_secret"`
}

type Config

type Config struct {
	App App
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() Config

LoadConfiguration will initialize fixed value for config

func (Config) MongoConnect

func (cfg Config) MongoConnect() (*mongo.Database, error)

func (Config) MysqlConnect

func (cfg Config) MysqlConnect() (*sql.DB, error)

type Database

type Database struct {
	Name     string `json:"name"`
	Host     string `json:"host"`
	User     string `json:"user"`
	Port     string `json:"port"`
	Password string `json:"password"`
	Driver   string `json:"driver"`
}

Jump to

Keyboard shortcuts

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