config

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

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

Go to latest
Published: Apr 28, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveConfig

func SaveConfig(config Config) bool

SaveConfig takes a config and saves it to the local file, config.toml.

Types

type Config

type Config struct {
	Zendesk       Zendesk
	Slack         Slack
	LogLevel      string
	SLA           SLA
	UpdateFreq    Duration
	TriageEnabled bool
	Metadata      Metadata
	Port          int
	Plugins       plugins.Plugins
	Postgres      Postgres
}

Config maps the values of the configuration file to a struct usable by the rest of the app

func LoadConfig

func LoadConfig() (config Config)

LoadConfig grabs the command line argument for where the configuration file is located and loads that into memory.

type Duration

type Duration struct {
	time.Duration
}

Duration allows for configurations to contain "3h", "8m", etc.

type Level

type Level struct {
	Tag    string
	Low    Duration
	Normal Duration
	High   Duration
	Urgent Duration
	Notify bool
}

Level reflects the 4 priority levels Zendesk uses for SLA.

type Metadata

type Metadata struct {
	Server string
}

Metadata holds configuration related to the server metadata used in status calls

type Postgres

type Postgres struct {
	Host     string
	Port     int
	User     string
	Password string
	DBName   string
}

type SLA

type SLA struct {
	LevelOne   Level
	LevelTwo   Level
	LevelThree Level
	LevelFour  Level
}

SLA supports up to 4 levels of SLA in the configuration

type Slack

type Slack struct {
	APIKey    string
	ChannelID string
}

Slack API key and Channel ID tell SLAB where to post notifications

type Zendesk

type Zendesk struct {
	User           string
	APIKey         string
	URL            string
	PremiumUpdates bool
}

Zendesk contains configuration values specific to the Zendesk interactions

Jump to

Keyboard shortcuts

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