web

package
v1.1.1 Latest Latest
Warning

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

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

	Lexers  *[]string
	Locales *Locales

	StyleCSS       *[]byte
	ErrorPage      *template.Template
	Main           *template.Template
	MainJS         *[]byte
	PastePage      *template.Template
	PasteJS        *[]byte
	PasteContinue  *template.Template
	Settings       *template.Template
	About          *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

	AdminName *string
	AdminMail *string

	RobotsDisallow *bool
}

func Load

func Load(cfg config.Config, webDir string) (Data, error)

func (Data) AboutHand

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

Pattern: /about

func (Data) DlHand

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

Pattern: /dl/

func (Data) DocsApiLibsHand

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

Pattern: /docs/api_libs

func (Data) DocsApiV1Hand

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

Pattern: /docs/apiv1

func (Data) DocsHand

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

Pattern: /docs

func (Data) EmbeddedHand

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

Pattern: /emb/

func (Data) EmbeddedHelpHand

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

Pattern: /emb_help/

func (Data) LicenseHand

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

Pattern: /about/license

func (Data) MainHand

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

Pattern: /

func (Data) MainJSHand

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

func (Data) PasteJSHand

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

func (Data) RobotsTxtHand

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

func (Data) SettingsHand

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

Pattern: /settings

func (Data) SitemapHand

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

func (Data) SourceCodePageHand

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

Pattern: /about/source_code

func (Data) StyleCSSHand

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

type Locale

type Locale map[string]string

type Locales

type Locales map[string]*Locale

Jump to

Keyboard shortcuts

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