pkg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 9 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 {
	JiraUsername string   `mapstructure:"jira_username"`
	JiraPassword string   `mapstructure:"jira_password"`
	JiraToken    string   `mapstructure:"jira_token"`
	JiraBaseUrl  string   `mapstructure:"jira_baseurl"`
	JiraEnabled  bool     `mapstructure:"jira_enabled"`
	JiraQuery    []string `mapstructure:"jira_query"`
}

func NewConfig

func NewConfig() (*Config, error)

type JiraWatcher

type JiraWatcher struct {
	JiraClient    *jira.Client
	JiraQuery     string
	LastQueryTime time.Time
	Logger        logrus.FieldLogger
}

func NewJiraWatchers

func NewJiraWatchers(ctx context.Context, config *Config, logger logrus.FieldLogger) ([]*JiraWatcher, error)

func (*JiraWatcher) Watch

func (jw *JiraWatcher) Watch(ctx context.Context) ([]*Notification, error)

type Notification

type Notification struct {
	Id   string
	Args []string
}

func (*Notification) ToCommand

func (n *Notification) ToCommand() *exec.Cmd

type Notifier

type Notifier struct {
	AppName string
	AppIcon string
	Logger  logrus.FieldLogger
}

func (*Notifier) Push

func (n *Notifier) Push(subtitle string, message string, open string)

func (*Notifier) PushError

func (n *Notifier) PushError(message string, err error)

type Watcher

type Watcher interface {
	Watch(ctx context.Context) (notifications []*Notification, err error)
}

Jump to

Keyboard shortcuts

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