www

package
v0.0.0-...-3b5ec37 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(w http.ResponseWriter, r *http.Request) *git.Client

func LogoffHandler

func LogoffHandler(c *Context) error

func Render

func Render(w http.ResponseWriter, r *http.Request, tmpl string, data interface{}) error

func RunWebServer

func RunWebServer(bind string) error

func ToGithubHandler

func ToGithubHandler(c *Context) error

func WebCommand

func WebCommand() *commander.Command

func WebError

func WebError(w http.ResponseWriter, r *http.Request, err error)

Types

type Context

type Context struct {
	R       *http.Request
	W       http.ResponseWriter
	Vars    map[string]string
	D       map[string]interface{}
	Client  *git.Client
	Session *sessions.Session
	Defers  []func()
	Log     *logrus.Entry
}

func (*Context) AddDefer

func (c *Context) AddDefer(f func())

func (*Context) Context

func (c *Context) Context() context.Context

func (*Context) Decode

func (c *Context) Decode(i interface{}) error

Decode does a gorilla schema decode of the incoming form values against the given interface.

func (*Context) Flash

func (c *Context) Flash(css, title, content string, args map[string]interface{}) error

func (*Context) FlashError

func (c *Context) FlashError(title, content string, args map[string]interface{}) error

func (*Context) FlashInfo

func (c *Context) FlashInfo(title, content string, args map[string]interface{}) error

func (*Context) FlashSuccess

func (c *Context) FlashSuccess(title, content string, args map[string]interface{}) error

func (*Context) Flashes

func (c *Context) Flashes() ([]interface{}, error)

func (*Context) P

func (c *Context) P(k string) string

func (*Context) PI

func (c *Context) PI(k string) int64

func (*Context) Redirect

func (c *Context) Redirect(f string, args ...interface{}) error

func (*Context) Render

func (c *Context) Render(templ string, data map[string]interface{}) error

func (*Context) Repo

func (c *Context) Repo() (*git.Repo, error)

Repo returns the git.Repo for the current request's repository. The called does not need to call .Free(), since it is added to the Context's .Defers

func (*Context) SaveSession

func (c *Context) SaveSession() error

func (*Context) WebError

func (c *Context) WebError(err error)

type FlashMessage

type FlashMessage struct {
	CSS     string        `json:"css"`
	Title   template.HTML `json:"title"`
	Content template.HTML `json:"html"`
}

type OSFileSystem

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

func NewOSFileSystem

func NewOSFileSystem(root string) *OSFileSystem

func (*OSFileSystem) Mkdir

func (o *OSFileSystem) Mkdir(name string, perm os.FileMode) error

func (*OSFileSystem) OpenFile

func (o *OSFileSystem) OpenFile(name string, flag int, perm os.FileMode) (webdav.File, error)

func (*OSFileSystem) RemoveAll

func (o *OSFileSystem) RemoveAll(name string) error

func (*OSFileSystem) Rename

func (o *OSFileSystem) Rename(oldName, newName string) error

func (*OSFileSystem) Stat

func (o *OSFileSystem) Stat(name string) (os.FileInfo, error)

type WebHandler

type WebHandler func(c *Context) error

func (WebHandler) ServeHTTP

func (f WebHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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