endpoint

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBodyTemplate = "{{ .Message.Text }}"
View Source
const DefaultTitleTemplate = "{{ .Message.Subject }}"

Variables

This section is empty.

Functions

func New

func NewFuncMap

func NewFuncMap(r CreateFuncMap) template.FuncMap

func NewInternal

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

Types

type CreateEndpoint

type CreateEndpoint struct {
	Name              string
	AttachmentDisable bool
	TextDisable       bool
	TitleTemplate     string
	BodyTemplate      string
	Kind              string
	Config            models.EndpointConfig
}

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, 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