endpoint

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 13 Imported by: 0

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