gorise

package
v0.0.0-...-72e33f6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package gorise is a minimal reimplementation of Apprise.

Index

Constants

This section is empty.

Variables

View Source
var Builders = map[string]func(cfg Config) (Sender, error){
	"console": BuildConsole,
	"tgram":   BuildTelegram,
	"ntfy":    BuildNtfy,
	"ntfys":   BuildNtfys,
}
View Source
var (
	ErrBuilderNotFound = fmt.Errorf("builder not found")
)

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Name string
	Mime string
	io.Reader
}

func (Attachment) IsImage

func (a Attachment) IsImage() bool

type Config

type Config string

func (Config) Paths

func (c Config) Paths() []string

type Console

type Console struct {
}

func NewConsole

func NewConsole() Console

func (Console) Send

func (Console) Send(ctx context.Context, msg Message) error

type Message

type Message struct {
	Title       string
	Body        string
	Attachments []Attachment
}

func (Message) Text

func (m Message) Text() string

Text returns the title and body combined.

type Ntfy

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

https://github.com/caronc/apprise/wiki/Notify_ntfy

func NewNtfy

func NewNtfy(url, topic string) Ntfy

func (Ntfy) Send

func (n Ntfy) Send(ctx context.Context, msg Message) error

type Sender

type Sender interface {
	Send(ctx context.Context, msg Message) error
}

func Build

func Build(urL string) (Sender, error)

func BuildConsole

func BuildConsole(cfg Config) (Sender, error)

func BuildNtfy

func BuildNtfy(cfg Config) (Sender, error)

func BuildNtfys

func BuildNtfys(cfg Config) (Sender, error)

func BuildTelegram

func BuildTelegram(cfg Config) (Sender, error)

type Telegram

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

https://github.com/caronc/apprise/wiki/Notify_telegram

func NewTelegram

func NewTelegram(token, chatID string) Telegram

func (Telegram) Send

func (t Telegram) Send(ctx context.Context, msg Message) error

type URL

type URL struct {
	Scheme string
	Config Config
}

func NewURL

func NewURL(urL string) (URL, error)

Jump to

Keyboard shortcuts

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