config

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package config provides configurations for subcommands.

It consists of both configuration values shared by all microservices and values specific to this microservice.

Default values can be obtained from various sources (constants, environment variables, etc.) and then overridden by flags.

As configuration is global you can get it only once for safety: you can call only one of Get… functions and call it just once.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGoosePostgres added in v0.4.0

func GetGoosePostgres() (c *cobrax.GoosePostgresConfig, err error)

func Init

func Init(sharedCfg *SharedCfg, flagsets FlagSets) error

Init updates config defaults (from env) and setup subcommands flags.

Init must be called once before using this package.

Types

type FlagSets

type FlagSets struct {
	Serve         *pflag.FlagSet
	GoosePostgres *pflag.FlagSet
}

FlagSets for all CLI subcommands which use flags to set config values.

type ServeConfig

type ServeConfig struct {
	Postgres         *def.PostgresConfig
	GoosePostgresDir string
	AuthAddr         netx.Addr
	BindAddr         netx.Addr
	BindAddrInt      netx.Addr
	BindGRPCGWAddr   netx.Addr
	BindMetricsAddr  netx.Addr
	Secret           sensitive.Bytes
	TLSCACert        string
	TLSCert          string
	TLSCertInt       string
	TLSKey           string
	TLSKeyInt        string
}

ServeConfig contains configuration for subcommand.

func GetServe

func GetServe() (c *ServeConfig, err error)

GetServe validates and returns configuration for subcommand.

func MustGetServeTest

func MustGetServeTest() *ServeConfig

MustGetServeTest returns config suitable for use in tests.

type SharedCfg

type SharedCfg = config.Shared

Jump to

Keyboard shortcuts

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