sub

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound when form not found
	ErrNotFound = errors.New("form not found")
	// ErrSpam returned when submission is spam
	ErrSpam = errors.New("spam submission")
)

Functions

This section is empty.

Types

type EmailSender added in v1.1.0

type EmailSender interface {
	Send(context.Context, *postmark.Email) error
}

EmailSender interface

type Handler

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

Handler is an HTTP forms handler

func NewHandler

func NewHandler(forms map[string]*config.Form, vs map[string]common.Validator, pm EmailSender, sender Sender) *Handler

NewHandler creates new HTTP forms handler

func (*Handler) GET

func (h *Handler) GET(ctx context.Context, name string, _ *http.Request) (string, error)

GET request handler

func (*Handler) POST

func (h *Handler) POST(ctx context.Context, name string, r *http.Request) (string, error)

POST request handler

type Sender

type Sender interface {
	Send(context.Context, id.RoomID, string, map[string]any) id.EventID
	SendFile(context.Context, id.RoomID, *mautrix.ReqUploadMedia, ...*event.RelatesTo)
}

Sender interface to send messages

Directories

Path Synopsis
ext

Jump to

Keyboard shortcuts

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