hermes

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

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

Go to latest
Published: Nov 3, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Cmd    *exec.Cmd
	Stdout *bytes.Buffer
	Stderr *bytes.Buffer
}

func NewCommand

func NewCommand(argv []string) *Command

func (*Command) Run

func (c *Command) Run(notifier Notifier) int

type Config

type Config map[interface{}]interface{}

func LoadConfig

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

func (Config) Get

func (c Config) Get(key string, defaultValue ...string) string

func (Config) GetConfig

func (c Config) GetConfig(key string) Config

type DesktopNotifier

type DesktopNotifier struct {
	// contains filtered or unexported fields
}

func (DesktopNotifier) Failure

func (d DesktopNotifier) Failure(cmd *Command, err error)

func (DesktopNotifier) Success

func (d DesktopNotifier) Success(cmd *Command)

type Notifier

type Notifier interface {
	Success(cmd *Command)
	Failure(cmd *Command, err error)
}

func GetNotifier

func GetNotifier(config *Config) Notifier

Creates a new Hermes notifier instance from the parsed configuration file. The configuration's YAML structure should look something like:

notifier:

type: <NOTIFIER_TYPE>
...notifier-specific configuration goes here...

func NewDesktopNotifier

func NewDesktopNotifier(config Config) Notifier

Creates a new desktop-based notification using any one of the available desktop notification libraries available for your system (e.g. Growl on Windows, notify-send on Linux, etc.). To configure this notifier, you should use the following configuration:

notifier:

type: desktop

func NewSlackNotifier

func NewSlackNotifier(config Config) Notifier

Creates a new Slack-enabled notifier. This expects a minimal Hermes configuration that looks like:

notifier:

type: slack
webHookUrl: <SLACK_WEB_HOOK_URL>
sender: <SLACK_SENDER_NAME>
recipient: <SLACK_RECIPIENT_NAME>

type Printer

type Printer struct{}

func (Printer) Write

func (_ Printer) Write(p []byte) (n int, err error)

type SlackNotifier

type SlackNotifier struct {
	// contains filtered or unexported fields
}

func (SlackNotifier) Failure

func (s SlackNotifier) Failure(cmd *Command, err error)

func (SlackNotifier) Success

func (s SlackNotifier) Success(cmd *Command)

Jump to

Keyboard shortcuts

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