handlers

package
v0.0.0-...-98b09d8 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(db repos.Db, title string, templates Templates) http.Handler

func Delete

func Delete(db repos.Db) http.Handler

func Edit

func Edit(db repos.Db, title string, templates Templates) http.Handler

Types

type BlobCtx

type BlobCtx struct {
	Title    string
	Url      string
	LoggedIn bool

	Name         string
	Web          string
	Description  string
	Path         string
	CloneUrl     string
	IsEmpty      bool
	IsPrivate    bool
	Dir          string
	DirParts     []PathPart
	ParentDir    string
	FileName     string
	FileContents template.HTML
	FileLang     string
}

type Ctx

type Ctx struct {
	Title    string
	Url      string
	Repos    []*repos.Repo
	LoggedIn bool
}

type ListHandler

type ListHandler struct {
	Public http.Handler
	All    http.Handler
}

func List

func List(db repos.Db, title, url string, templates Templates) ListHandler

type PathPart

type PathPart struct {
	Name string
	Path string
}

type Protect

type Protect func(handler, errHandler http.Handler) http.HandlerFunc

type RepoCtx

type RepoCtx struct {
	Title    string
	Url      string
	LoggedIn bool

	Name         string
	Web          string
	Description  string
	Path         string
	CloneUrl     string
	Files        []repos.File
	IsEmpty      bool
	IsPrivate    bool
	Dir          string
	DirParts     []PathPart
	ParentDir    string
	FileName     string
	FileContents template.HTML
}

type RepoHandler

type RepoHandler struct {
	Html http.Handler
	Git  http.Handler
}

func Repo

func Repo(db repos.Db, title, url string, protect Protect, templates Templates) RepoHandler

type Templates

type Templates interface {
	ExecuteTemplate(w io.Writer, name string, data interface{}) error
}

Jump to

Keyboard shortcuts

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