endpoint

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Schema models.EndpointSchema = models.EndpointSchema{
	{
		Name: "Console",
		Kind: "console",
	},
	{
		Name: "Telegram",
		Kind: "telegram",
		Fields: []models.EndpointSchemaField{
			{
				Key:         "token",
				Name:        "Token",
				Description: "Bot token from BotFather.",
				Example:     "0123456789:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
			},
			{
				Key:         "chat_id",
				Name:        "Chat ID",
				Description: "Channel/chat/group ID.",
				Example:     "1000000000",
			},
		},
	},
	{
		Name: "Shoutrrr",
		Kind: "shoutrrr",
		Fields: []models.EndpointSchemaField{
			{
				Key:         "urls",
				Name:        "URLs",
				Description: "List of Shoutrrr URLs.",
				Example:     "telegram://token@telegram?chats=channel-1[,chat-id-1,...]",
				Multiline:   true,
			},
		},
	},
	{
		Name: "Apprise",
		Kind: "apprise",
		Fields: []models.EndpointSchemaField{
			{
				Name:        "URLs",
				Key:         "urls",
				Description: "List of Apprise URLs.",
				Example:     "tgram://bottoken/ChatID",
				Multiline:   true,
			},
		},
	},
	{
		Name: "Script",
		Kind: "script",
		Fields: []models.EndpointSchemaField{
			{
				Key:         "file",
				Name:        "File",
				Description: "Name of script file located in the script directory.",
				Example:     "my-script.py",
			},
		},
	},
}

Functions

func Delete added in v0.14.0

func Delete(r models.Endpoint) error

func NewFuncMap

func NewFuncMap(r CreateFuncMap) template.FuncMap

func NewInternal

func NewInternal(f Factory, r models.DTOEndpointCreate, internalID string) (models.Endpoint, error)

func Update added in v0.14.0

Types

type CreateFuncMap

type CreateFuncMap struct {
	URL string
}

type Endpoint

type Endpoint struct {
	ID int64
	// contains filtered or unexported fields
}

func (Endpoint) Send

func (e Endpoint) Send(ctx context.Context, fileStore FileStore, env models.Envelope) error

type Factory

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

func NewFactory

func NewFactory(pythonExecutable string, appriseScriptPath string, scriptDirectory string, funcMap template.FuncMap) Factory

func (Factory) Build

func (s Factory) Build(e models.Endpoint) (Endpoint, error)

type FileStore

type FileStore interface {
	Reader(ctx context.Context, att models.Attachment) (io.ReadCloser, error)
	Path(ctx context.Context, att models.Attachment) (string, error)
}

type Sender

type Sender interface {
	Send(ctx context.Context, env models.Envelope, tr senders.Transformer) error
}

Jump to

Keyboard shortcuts

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