ntfy

package module
v2.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoConfig = fmt.Errorf("no notify config")

Functions

func Notify

func Notify(ctx context.Context, text string) (err error)

Types

type Config

type Config struct {
	DingtalkConfig `yaml:",squash"`
	TelegramConfig `yaml:",squash"`
}

func C

func C() Config

type DingtalkConfig

type DingtalkConfig struct {
	Token  *string `json:"ntfy.dingtalk.token"  yaml:"ntfy.dingtalk.token"`
	Secret string  `json:"ntfy.dingtalk.secret" yaml:"ntfy.dingtalk.secret"`
}

func (DingtalkConfig) Name

func (DingtalkConfig) Name() string

func (DingtalkConfig) Notify

func (c DingtalkConfig) Notify(_ context.Context, text string) error

func (DingtalkConfig) Sign

func (c DingtalkConfig) Sign() (string, string)

type Interface

type Interface interface {
	Name() string
	Notify(ctx context.Context, text string) error
}

type TelegramConfig

type TelegramConfig struct {
	Token  *string `json:"ntfy.telegram.token"   yaml:"ntfy.telegram.token"`
	ChatId string  `json:"ntfy.telegram.chat_id" yaml:"ntfy.telegram.chat_id"`
}

func (TelegramConfig) Name

func (TelegramConfig) Name() string

func (TelegramConfig) Notify

func (c TelegramConfig) Notify(_ context.Context, text string) error

Jump to

Keyboard shortcuts

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