plugins

package
v0.0.0-...-18cc6e6 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 17 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 {
	Plugins         Plugin `yaml:"plugins"`
	RescheduleEvery int    `yaml:"reschedule_seconds" validate:"min=60,max=1200"`
	Database        string `yaml:"database"`
	Size            int64  `yaml:"num_notifications" validate:"min=5,max=60"`
}

representing the configuration file

func NewConfigFromBytes

func NewConfigFromBytes(b []byte) (*Config, error)

NewConfigFromBytes returns a Config object, read from the YAML byte stream

func (*Config) ProcessPlugins

func (c *Config) ProcessPlugins()

processPlugins runs through the plugins, storing outputs in the database

type GitHubConfig

type GitHubConfig struct {
	Token         string             `yaml:"token" validate:"required"`
	Subscriptions GitHubSubscription `yaml:"subscriptions" validate:"required"`
}

type GitHubSubscription

type GitHubSubscription struct {
	Issues       []githubIssueConfig   `yaml:"issues,omitempty"`
	PullRequests []githubPRConfig      `yaml:"pullrequests,omitempty"`
	Actions      []githubActionConfig  `yaml:"actions,omitempty"`
	Releases     []githubReleaseConfig `yaml:"releases,omitempty"`
}

type JiraConfig

type JiraConfig struct {
	Username string      `yaml:"username"`
	Token    string      `yaml:"token"`
	Endpoint string      `yaml:"endpoint"`
	Issues   []JiraIssue `yaml:"issues"`
}

type JiraIssue

type JiraIssue struct {
	Query string `yaml:"query"`
	PluginBase
}

func (*JiraIssue) Gather

func (j *JiraIssue) Gather(ctx context.Context, user string, pass string, endpoint string, since time.Time) []*comms.Message

type Plugin

type Plugin struct {
	GitHub GitHubConfig `yaml:"github,omitempty"`
	URLs   []URLConfig  `yaml:"webpages,omitempty"`
	Jira   JiraConfig   `yaml:"jira,omitempty"`
}

plugins

type PluginBase

type PluginBase struct {
	Name string `yaml:"name" validate:"required"`
}

type URLConfig

type URLConfig struct {
	URLs     []string `yaml:"urls" validate:"required"`
	Username string   `yaml:"username"`
	Password string   `yaml:"password"`
	PluginBase
}

func (*URLConfig) Gather

func (u *URLConfig) Gather(ctx context.Context, since time.Time) []*comms.Message

Jump to

Keyboard shortcuts

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