config

package
v0.0.0-...-1db89c0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAPIKeys

func GetAPIKeys() (pdAPIKey, slackAPIKey string, err error)

GetAPIKeys retrieves the API key from environment variables

func GetConfigPath

func GetConfigPath() string

GetConfigPath retrieves the config.yml file

func IsExternalTrigger

func IsExternalTrigger() bool

IsExternalTrigger retrieves if the Slackduty is triggered from external trigger or not. If it is configured to `true`, the Slackduty process will exits once it updates the Slack usergroup. It will ignore the `group[].schedule`.

If `false`, Slackduty will run kind of like a daemon and runs by schedule specified.

Types

type Config

type Config struct {
	Groups []Group `yaml:"groups"`
}

Config is the CLI configuration kept in SLACKDUTY_CONFIG(default value is )

func Load

func Load(path string) (*Config, error)

Load loads the config.yml from the filepath given.

type Group

type Group struct {
	Name       string   `yaml:"name"`
	Exclude    []string `yaml:"exclude"`
	Members    *Members `yaml:"members"`
	Schedule   string   `yaml:"schedule"`
	Usergroups []string `yaml:"usergroups"`
}

Group represents one single rule for syncronizing. A group will syncronize with the same fetch schedule.

type Members

type Members struct {
	Slack     *Slack     `yaml:"slack"`
	Pagerduty *Pagerduty `yaml:"pagerduty"`
}

Members represents the Slack or Pagerduty user which belongs to the handle(s) defined in the same group.

type Pagerduty

type Pagerduty struct {
	Schedules []string `yaml:"schedules"`
	Services  []string `yaml:"services"`
	Teams     []string `yaml:"teams"`
	Users     []string `yaml:"users"`
}

Pagerduty ...

type Slack

type Slack []string

Slack ...

Jump to

Keyboard shortcuts

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