config

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 7 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 {
	Slack   SlackConfig
	Jira    JiraConfig
	Replies ReplyConfig
	Regex   RegexConfig
}

Config contains the full config structure of this bot

func LoadPattern

func LoadPattern(pattern string) (*Config, error)

LoadPattern loads config yaml file(s) by a glob pattern

type JiraConfig

type JiraConfig struct {
	Host         string
	Username     string
	Password     string
	Projects     []string `yaml:",flow"`
	Location     string
	Components   map[string]string   `yaml:",flow"`
	Statuses     map[string]string   `yaml:",flow"`
	Priorities   map[string]Priority `yaml:",flow"`
	FeatureTeams TeamConfig
	TimeFormat   string
	BugOverview  struct {
		ListAll []string `yaml:",flow"`
		All     string
		Medium  string
	}
	Sorting map[string]string `yaml:",flow"`
}

JiraConfig contains the credentials and configuration of the JIRA client

type Priority

type Priority struct {
	Value string
	Icon  string
}

Priority contains the mapping of JIRA priority to Slack emoji

type RegexConfig

type RegexConfig struct {
	JiraAssignee    string
	JiraCustom      string
	JiraIssueType   string
	JiraOption      string
	JiraPriority    string
	JiraProject     string
	JiraSorting     string
	JiraStatus      string
	JiraTime        string
	JiraOffsetTime  string
	JiraOffsetField string
	ReplyColor      string
	ReplyLayout     string
	ReplyList       string
	ReplyTitle      string
	CronCommand     string
	CronTime        string
}

RegexConfig contains the various regex expressions to parse Slack messages for commands

type ReplyConfig

type ReplyConfig struct {
	Jira map[string]struct {
		Title          string
		Text           string // use list for jira ticket list
		Parameter      string // amount/assignee can be replaced in title or text with %d/%s
		Color          string
		OptionalFields bool
	}
	BugThresholds map[string]struct {
		Danger  int
		Warning int
	}
	Colors struct {
		Red    string
		Yellow string
		Green  string
		Blue   string
		Grey   string
	}
}

ReplyConfig contains the configuration for replies via Slack

type SlackConfig

type SlackConfig struct {
	Token string
}

SlackConfig contains the credentials of the Slack client

type TeamConfig

type TeamConfig struct {
	Field    string
	Projects []string
	Default  string
	Teams    map[string]string `yaml:",flow"`
}

TeamConfig contains the configuration for Feature Teams in JIRA

Jump to

Keyboard shortcuts

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