common

package
v0.0.0-...-d549e8d Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LastIP = iota
	FirstIP
)

Variables

This section is empty.

Functions

func IpFromRequest

func IpFromRequest(r *http.Request, trustProxy bool, position int) net.IP

func QrCode

func QrCode(bridgeLines []string) ([]byte, error)

func StartEmail

func StartEmail(emailCfg *internal.EmailConfig, distCfg *internal.Config,
	dist distributors.Distributor, incomingHandler IncomingEmailHandler)

func StartWebServer

func StartWebServer(apiCfg *internal.WebApiConfig, distCfg *internal.Config,
	dist distributors.Distributor, handlers map[string]http.HandlerFunc)

StartWebServer helps distributor frontends start a Web server and configure handlers. This function does not return until it receives a SIGINT or SIGTERM. When that happens, the function calls the distributor's Shutdown method and shuts down the Web server.

Types

type Attachment

type Attachment struct {
	FileName    string
	ContentType string
	Data        []byte
}

type IncomingEmailHandler

type IncomingEmailHandler func(msg *mail.Message, send SendFunction) error

type SendFunction

type SendFunction func(subject, body string, attachments ...*Attachment) error

Jump to

Keyboard shortcuts

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