config

package
v0.0.0-...-03830f7 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLocalConfig

func GetLocalConfig(path string) (v *viper.Viper, err error)

GetLocalConfig gets viper

func LoadConfig

func LoadConfig(svc string) (v *viper.Viper, err error)

LoadConfig for service based on env Local: load a local yaml Dev or Prod: env variables

Types

type API

type API struct {
	SvcURL   string `json:"svcUrl"`
	RedisURL string `json:"redisUrl"`
}

API is what api.nycab need

func GetAPIConfig

func GetAPIConfig(v *viper.Viper) (*API, error)

GetAPIConfig ...

type Cli

type Cli struct {
	APIHost string `json:"apiHost"`
	APIPort string `json:"apiPort"`
}

Cli is waht cli.nycab need

func GetCliConfig

func GetCliConfig(v *viper.Viper) (*Cli, error)

GetCliConfig ...

type Service

type Service struct {
	DBHost   string `json:"dbHost"`
	DBPort   string `json:"dbPort"`
	UserName string `json:"userName"`
	Password string `json:"password"`
}

Service is what service.nycab need

func GetServiceConfig

func GetServiceConfig(v *viper.Viper) (*Service, error)

GetServiceConfig ...

Jump to

Keyboard shortcuts

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