config

package
v0.0.0-...-5b17345 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key, fallback string) string

GetEnv - Allows us to supply a fallback option if nothing specified

Types

type AppConfig

type AppConfig interface {
	MetricsPath() string
	ListenPort() string
	LogLevel() string
	ApplicationName() string
}

type BaseConfig

type BaseConfig struct {
	// contains filtered or unexported fields
}

func InitBaseConfig

func InitBaseConfig() BaseConfig

func (BaseConfig) ApplicationName

func (c BaseConfig) ApplicationName() string

func (BaseConfig) ListenPort

func (c BaseConfig) ListenPort() string

func (BaseConfig) LogLevel

func (c BaseConfig) LogLevel() string

func (BaseConfig) MetricsPath

func (c BaseConfig) MetricsPath() string

type Config

type Config struct {
	*BaseConfig
	// contains filtered or unexported fields
}

Config struct holds all of the runtime confgiguration for the application

func Init

func Init() Config

Init populates the Config struct based on environmental runtime configuration

func (*Config) APIToken

func (c *Config) APIToken() string

Returns the oauth2 token for usage in http.request

func (*Config) APIURL

func (c *Config) APIURL() *url.URL

Returns the base APIURL

func (*Config) SetAPIToken

func (c *Config) SetAPIToken(token string)

SetAPIToken accepts a string oauth2 token for usage in http.request

func (*Config) SetAPITokenFromFile

func (c *Config) SetAPITokenFromFile(tokenFile string) error

SetAPITokenFromFile accepts a file containing an oauth2 token for usage in http.request

func (*Config) SetAPIURL

func (c *Config) SetAPIURL(u string) error

Sets the base API URL returning an error if the supplied string is not a valid URL

func (*Config) SetJiraUser

func (c *Config) SetJiraUser(u string)

Sets the base API URL returning an error if the supplied string is not a valid URL

func (*Config) SetProjects

func (c *Config) SetProjects(projects []string)

Overrides the entire list of projects

func (*Config) TargetURLs

func (c *Config) TargetURLs() []string

Returns a list of all object URLs to scrape

func (*Config) User

func (c *Config) User() string

Jump to

Keyboard shortcuts

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