signotify

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(path string) bool

Exists checks if the config file exists in the given path

func GetConfDir

func GetConfDir() (string, error)

GetConfDir gets the config directory for a user

Types

type Configuration

type Configuration struct {
	Version   string `yaml:"version"`
	Platforms struct {
		Slack struct {
			Use        bool   `yaml:"use"`
			WebHookURL string `yaml:"webhook_url"`
		} `yaml:"slack"`
	} `yaml:"platforms"`
}

Configuration is a

func UnmarshalRead

func UnmarshalRead(file string) (Configuration, error)

UnmarshalRead reads the unmarshalled config yaml file from disk

func (*Configuration) MarshalWrite

func (c *Configuration) MarshalWrite(file string) error

MarshalWrite writes the marshaled yaml config to disk

type Notify

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

Notify handles the notification engine

func New

func New(options *Options) (*Notify, error)

New notify instance

func (*Notify) SendNotification

func (n *Notify) SendNotification(message string) error

SendNotification to registered webhooks

type Options

type Options struct {
	Configuration   string
	ExcludeSources  string
	UseSources      string
	SlackWebHookURL string
	Text            string
	YAMLConfig      Configuration
}

Options is the structure of the options expected

func ParseOptions

func ParseOptions(options *Options) (*Options, error)

ParseOptions is a

type Slack

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

Slack is a

Jump to

Keyboard shortcuts

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