sub

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: AGPL-3.0 Imports: 21 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

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, rdm *redmine.Redmine) *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

func (*Handler) SetSender

func (h *Handler) SetSender(sender Sender)

SetSender sets sender

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