server

package
v0.0.0-...-38b3bfd Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrGotHelp returned after showing requested help
	ErrGotHelp = errors.New("help printed")
	// ErrBadArgs returned after showing command args error message
	ErrBadArgs = errors.New("option error printed")
)

Functions

func Run

func Run(version string, exitFunc func(code int))

код основной функции с поддержкой тестов

Types

type Config

type Config struct {
	Addr       string `long:"addr" default:"localhost:7070"  description:"Listen address"`
	MetricAddr string `long:"metric_addr"  default:"localhost:8080" description:"prometheus service host:port"`
	MetricURL  string `long:"metric_url"  default:"/metrics" description:"prometheus service URL"`
	LogLevel   string `long:"log_level" default:"debug" description:"Log level"`

	API api.Config `group:"API Options" namespace:"api"`
	DB  DBConfig   `group:"DB Options" namespace:"db"`
}

Config holds all config vars

type DBConfig

type DBConfig struct {
	Addr     string `long:"addr"  default:"localhost:5432" description:"host:port"`
	Driver   string `long:"driver" default:"postgres" description:"DB driver"`
	User     string `long:"user" description:"User name"`
	Password string `long:"password" description:"User password"`
	Database string `long:"name" description:"Database name"`
	Options  string `long:"opts" default:"sslmode=disable" description:"Database connect options"`
}

DBConfig holds cli part of pg.Options

Jump to

Keyboard shortcuts

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