common

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDBEngine

func InitDBEngine(ctx context.Context) (err error)

InitDBEngine In case of problems connecting to DB, retry connection. Eg, PGSQL in Docker Container on Synology

func ProtocolMiddlewares

func ProtocolMiddlewares() (handlers []any)

ProtocolMiddlewares returns HTTP protocol related middlewares, and it provides a global panic recovery

func RenderMarkup

func RenderMarkup(ctx *context.Base, repo *context.Repository, mode, text, urlPrefix, filePath string, wiki bool)

RenderMarkup renders markup text for the /markup and /markdown endpoints

func RenderPanicErrorPage

func RenderPanicErrorPage(w http.ResponseWriter, req *http.Request, err any)

RenderPanicErrorPage renders a 500 page, and it never panics

func ServeBlob

func ServeBlob(ctx *context.Base, filePath string, blob *git.Blob, lastModified time.Time) error

ServeBlob download a git.Blob

func ServeContentByReadSeeker

func ServeContentByReadSeeker(ctx *context.Base, filePath string, modTime time.Time, reader io.ReadSeeker)

func ServeContentByReader

func ServeContentByReader(ctx *context.Base, filePath string, size int64, reader io.Reader)

func Sessioner

func Sessioner() func(next http.Handler) http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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