handlers

package
v0.0.0-...-5fd8514 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2017 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checksum

func Checksum(w http.ResponseWriter, r *http.Request, c *config.Config, i *file.Info) (int, error)

Checksum calculates the hash of a file. Supports MD5, SHA1, SHA256 and SHA512.

func Command

func Command(w http.ResponseWriter, r *http.Request, c *config.Config, u *config.User) (int, error)

Command handles the requests for VCS related commands: git, svn and mercurial

func Download

func Download(w http.ResponseWriter, r *http.Request, c *config.Config, i *file.Info) (int, error)

Download creates an archive in one of the supported formats (zip, tar, tar.gz or tar.bz2) and sends it to be downloaded.

func ParseCompleteFile

func ParseCompleteFile(data map[string]interface{}, filename string, mark rune) ([]byte, error)

ParseCompleteFile parses a complete file

func ParseFrontMatter

func ParseFrontMatter(data interface{}, front string) ([]byte, error)

ParseFrontMatter is the frontmatter parser

func ParseFrontMatterOnlyFile

func ParseFrontMatterOnlyFile(data interface{}, filename string) ([]byte, error)

ParseFrontMatterOnlyFile parses a frontmatter only file

func PreProccessPUT

func PreProccessPUT(
	w http.ResponseWriter,
	r *http.Request,
	c *config.Config,
	u *config.User,
) (err error)

PreProccessPUT is used to update a file that was edited

func Search(w http.ResponseWriter, r *http.Request, c *config.Config, u *config.User) (int, error)

Search ...

func ServeListing

func ServeListing(w http.ResponseWriter, r *http.Request, c *config.Config, u *config.User, i *file.Info) (int, error)

ServeListing presents the user with a listage of a directory folder.

func ServeSingle

func ServeSingle(w http.ResponseWriter, r *http.Request, c *config.Config, u *config.User, i *file.Info) (int, error)

ServeSingle serves a single file in an editor (if it is editable), shows the plain file, or downloads it if it can't be shown.

Types

type Editor

type Editor struct {
	Class       string
	Mode        string
	Visual      bool
	Content     string
	FrontMatter struct {
		Content *frontmatter.Content
		Rune    rune
	}
}

Editor contains the information for the editor page

func GetEditor

func GetEditor(r *http.Request, i *file.Info) (*Editor, error)

GetEditor gets the editor based on a FileInfo struct

Jump to

Keyboard shortcuts

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