web

package
v0.0.0-...-26b0df5 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAndAddToRoot

func LoadAndAddToRoot(funcMap template.FuncMap, rootTemplate *template.Template, embedFS embed.FS, pattern string) error

func LoadHTMLFromEmbedFS

func LoadHTMLFromEmbedFS(engine *gin.Engine, embedFS embed.FS, pattern string)

func StartServer

func StartServer()

Types

type PasteEntry

type PasteEntry struct {
	Id              string    `json:"id"`
	ExpirationHours int       `json:"expirationHours" form:"pasteExpirationHours"`
	Content         string    `json:"content" form:"pasteContent"`
	Password        string    `json:"password" form:"pastePassword"`
	DeleteOnRead    bool      `json:"deleteOnRead" form:"pasteDeleteOnRead"`
	Created         time.Time `json:"created"`
}

func NewPasteEntryFromDbItem

func NewPasteEntryFromDbItem(item db.Item) PasteEntry

type WebConfig

type WebConfig struct {
	Host string
	Port string
}

func GetWebConfig

func GetWebConfig() *WebConfig

func (*WebConfig) Address

func (wc *WebConfig) Address() string

type WebHandler

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

func NewWebHandler

func NewWebHandler(c *WebConfig, server *gin.Engine) *WebHandler

func (*WebHandler) Run

func (h *WebHandler) Run() error

Jump to

Keyboard shortcuts

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