config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Listen     string `envconfig:"HTTP_PORT" default:":8080"`
	LogLevel   string `envconfig:"LOG_LEVEL" default:"debug"`
	OriginHost string `envconfig:"ORIGIN_HOST"`
	Hostname   string `envconfig:"HOSTNAME"  default:"localhost"`
	Client     HTTPClient
	Propeller
}

Config holds all the configuration for this service

func LoadConfig

func LoadConfig() (Config, error)

LoadConfig loads the configuration with environment variables injected

func (Config) GetLogger

func (c Config) GetLogger() *logrus.Logger

GetLogger generates a logger

func (Config) IsLocalHost

func (c Config) IsLocalHost() bool

IsLocalHost returns true if env is localhost

type HTTPClient

type HTTPClient struct {
	Timeout time.Duration `envconfig:"CLIENT_TIMEOUT" default:"5s"`
}

HTTPClient will issue requests to the manifest

func (HTTPClient) New

func (h HTTPClient) New() *http.Client

New creates a new instance of the HTTP Client

type Propeller

type Propeller struct {
	Host   string `envconfig:"PROPELLER_HOST"`
	Creds  string `envconfig:"PROPELLER_CREDS"`
	Client *propeller.Client
}

Propeller holds the client ands its associated credentials

Jump to

Keyboard shortcuts

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