notify

package module
v0.0.0-...-69faf11 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeOK = iota
	ExitCodeErr
)
View Source
const WidgetFileName = "natureremo.json"

Variables

This section is empty.

Functions

func NewCloudWatch

func NewCloudWatch(client cloudwatchiface.CloudWatchAPI) *cloudWatchImpl

func NewSSM

func NewSSM(client ssmiface.SSMAPI) *ssmImpl

func NewSlack

func NewSlack(client *slack.Client) *slackImpl

Types

type App

type App struct {
	CloudWatch CloudWatch
	ChannelID  string
	Config     *Config
	Slack      Slack
}

func New

func New(conf *Config) *App

func (*App) Handle

func (app *App) Handle(ctx context.Context) error

func (*App) Run

func (app *App) Run() error

func (*App) RunWithContext

func (app *App) RunWithContext(ctx context.Context) error

type Block

type Block struct {
	Type string `json:"type"`
	Text Text   `json:"text"`
}

type CloudWatch

type CloudWatch interface {
	GetMetricWidgetImage(ctx context.Context, widget string) ([]byte, error)
}

type Config

type Config struct {
	Region        string
	SlackTokenKey string
	ChannelIDKey  string
}

func NewConfig

func NewConfig(region, slackTokenKey, channelIDKey string) *Config

type Message

type Message struct {
	Blocks []Block `json:"blocks"`
}

type Option

type Option struct {
	Region        *string
	SlackTokenKey *string
	ChannelIDKey  *string
}

type SSM

type SSM interface {
	GetParameters(ctx context.Context, keys ...string) (map[string]string, error)
}

type Slack

type Slack interface {
	UploadImage(ctx context.Context, channelID string, image io.Reader) error
}

type Text

type Text struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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