line

package
v0.0.0-...-be61d61 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: AGPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const FullValidConfigForTesting = `{
	"token": "test", 
	"title": "test-title", 
	"description": "test-description" 
}`

FullValidConfigForTesting is a string representation of a JSON object that contains all fields supported by the notifier Config. It can be used without secrets.

View Source
const FullValidSecretsForTesting = `{
	"token": "test-secret-token"
}`

FullValidSecretsForTesting is a string representation of JSON object that contains all fields that can be overridden from secrets

Variables

View Source
var (
	// APIURL of where the notification payload is sent. It is public to be overridable in integration tests.
	// API document link: https://notify-bot.line.me/doc/en/
	APIURL = "https://notify-api.line.me/api/notify"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Token       string `json:"token,omitempty" yaml:"token,omitempty"`
	Title       string `json:"title,omitempty" yaml:"title,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
}

func NewConfig

func NewConfig(jsonData json.RawMessage, decryptFn receivers.DecryptFunc) (Config, error)

type Notifier

type Notifier struct {
	*receivers.Base
	// contains filtered or unexported fields
}

Notifier is responsible for sending alert notifications to LINE.

func New

func New(cfg Config, meta receivers.Metadata, template *templates.Template, sender receivers.WebhookSender, logger logging.Logger) *Notifier

func (*Notifier) Notify

func (ln *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)

Notify send an alert notification to LINE

func (*Notifier) SendResolved

func (ln *Notifier) SendResolved() bool

Jump to

Keyboard shortcuts

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