endpoints

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterImagesOnly

func FilterImagesOnly(atts []*envelope.Attachment) []*envelope.Attachment

func GetAttachments

func GetAttachments(env envelope.Envelope, config Config) []*envelope.Attachment

func GetBody

func GetBody(env envelope.Envelope, config Config) (string, error)

func GetTitle

func GetTitle(env envelope.Envelope, config Config) string

Types

type Config

type Config struct {
	AttachmentsDisable bool
	TextDisable        bool
	BodyTemplate       *template.Template
}

type Console

type Console struct{}

func NewConsole

func NewConsole() Console

func (Console) Send

func (c Console) Send(cc core.Context, env envelope.Envelope, config Config) error

type CreateEndpoint

type CreateEndpoint struct {
	Internal          bool
	InternalID        string
	Name              string
	AttachmentDisable bool
	TextDisable       bool
	BodyTemplate      string
	Kind              string
	Config            map[string]string
}

type Endpoint

type Endpoint struct {
	ID                int64 `bun:"id,pk,autoincrement"`
	Internal          bool
	InternalID        string
	Name              string
	AttachmentDisable bool
	TextDisable       bool
	BodyTemplate      string
	Kind              string
	Config            map[string]string
}

func New

func New(r CreateEndpoint) (Endpoint, error)

func (Endpoint) Parse

func (e Endpoint) Parse() (ParsedEndpoint, error)

type ParsedEndpoint

type ParsedEndpoint struct {
	ID     int64
	Config Config
	Sender Sender
}

func (ParsedEndpoint) Send

func (pe ParsedEndpoint) Send(cc core.Context, env envelope.Envelope) error

type Sender

type Sender interface {
	Send(cc core.Context, env envelope.Envelope, config Config) error
}

func SenderFactory

func SenderFactory(kind string, config map[string]string) (Sender, error)

type Shoutrrr

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

func NewShoutrrr

func NewShoutrrr(router *router.ServiceRouter) Shoutrrr

func (Shoutrrr) Send

func (s Shoutrrr) Send(cc core.Context, env envelope.Envelope, config Config) error

type Telegram

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

func NewTelegram

func NewTelegram(token, chatID string) *Telegram

func (*Telegram) Send

func (t *Telegram) Send(cc core.Context, env envelope.Envelope, config Config) error

Jump to

Keyboard shortcuts

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