web

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	DB  storage.DB
	Log logger.Logger

	RateLimitNew *netshare.RateLimitSystem
	RateLimitGet *netshare.RateLimitSystem

	Lexers      []string
	Locales     Locales
	LocalesList LocalesList
	Themes      Themes
	ThemesList  ThemesList

	StyleCSS       *textTemplate.Template
	ErrorPage      *template.Template
	Main           *template.Template
	MainJS         *[]byte
	HistoryJS      *textTemplate.Template
	CodeJS         *textTemplate.Template
	PastePage      *template.Template
	PasteJS        *textTemplate.Template
	PasteContinue  *template.Template
	Settings       *template.Template
	About          *template.Template
	TermsOfUse     *template.Template
	Authors        *template.Template
	License        *template.Template
	SourceCodePage *template.Template

	Docs        *template.Template
	DocsApiV1   *template.Template
	DocsApiLibs *template.Template

	EmbeddedPage     *template.Template
	EmbeddedHelpPage *template.Template

	Version string

	TitleMaxLen int
	BodyMaxLen  int
	MaxLifeTime int64

	ServerAbout      string
	ServerRules      string
	ServerTermsExist bool
	ServerTermsOfUse string

	AdminName string
	AdminMail string

	RobotsDisallow bool

	LenPasswdFile string

	UiDefaultLifeTime string
	UiDefaultTheme    string
}

func Load

func Load(db storage.DB, cfg config.Config) (*Data, error)

func (*Data) Handler

func (data *Data) Handler(rw http.ResponseWriter, req *http.Request)

type Locale

type Locale map[string]string

type Locales

type Locales map[string]Locale

type LocalesList

type LocalesList map[string]string

type Theme

type Theme map[string]string

type Themes

type Themes map[string]Theme

type ThemesList

type ThemesList map[string]ThemesListPart

type ThemesListPart

type ThemesListPart map[string]string

Jump to

Keyboard shortcuts

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