webui

package
v1.4.0-1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: GPL-3.0 Imports: 29 Imported by: 13

Documentation

Overview

Code generated for package webui by go-bindata DO NOT EDIT. (@generated) sources: static/application-rtl.css static/application.css static/application.js static/bootstrap-rtl.min.css static/bootstrap.css static/dashboard.js static/img/apple-touch-icon.png static/img/favicon-16x16.png static/img/favicon-32x32.png static/img/favicon.ico static/img/favicon.svg static/img/status.png static/locales/ar.yml static/locales/cs.yml static/locales/da.yml static/locales/de.yml static/locales/el.yml static/locales/en.yml static/locales/es.yml static/locales/fa.yml static/locales/fr.yml static/locales/he.yml static/locales/hi.yml static/locales/it.yml static/locales/ja.yml static/locales/ko.yml static/locales/nb.yml static/locales/nl.yml static/locales/pl.yml static/locales/pt-br.yml static/locales/pt.yml static/locales/ru.yml static/locales/sv.yml static/locales/ta.yml static/locales/uk.yml static/locales/ur.yml static/locales/zh-cn.yml static/locales/zh-tw.yml

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultTabs = []Tab{
		{"Home", "/"},
		{"Busy", "/busy"},
		{"Queues", "/queues"},
		{"Retries", "/retries"},
		{"Scheduled", "/scheduled"},
		{"Dead", "/morgue"},
	}

	LicenseStatus = func(w io.Writer, req *http.Request) string {
		return ""
	}
)
View Source
var (
	AssetLookups = []assetLookup{Asset}
)
View Source
var (
	LAST_ELEMENT = regexp.MustCompile(`\/([^\/]+)\z`)
)

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetFile

func AssetFile() http.FileSystem

AssetFile return a http.FileSystem instance that data backend by asset

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func DebugLog

func DebugLog(ui *WebUI, pass http.HandlerFunc) http.HandlerFunc

The stats handler is hit a lot and adds much noise to the log, quiet it down.

func GetOnly

func GetOnly(h http.HandlerFunc) http.HandlerFunc

func Layout added in v1.5.0

func Layout(w io.Writer, req *http.Request, yield func())

func Log

func Log(ui *WebUI, pass http.HandlerFunc) http.HandlerFunc

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func PostOnly

func PostOnly(h http.HandlerFunc) http.HandlerFunc

func Proxy added in v1.5.0

func Proxy(ui *WebUI) http.HandlerFunc

func Redirect added in v1.5.0

func Redirect(w http.ResponseWriter, r *http.Request, path string, code int)

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func Timeago

func Timeago(t time.Time) string

Types

type Context

type Context interface {
	context.Context

	Request() string
	Response() string
}

type DefaultContext

type DefaultContext struct {
	context.Context

	Root string
	// contains filtered or unexported fields
}

func NewContext added in v1.5.0

func NewContext(ui *WebUI, req *http.Request, resp http.ResponseWriter) *DefaultContext

func (*DefaultContext) Locale

func (d *DefaultContext) Locale() string

func (*DefaultContext) Request

func (d *DefaultContext) Request() *http.Request

func (*DefaultContext) Response

func (d *DefaultContext) Response() http.ResponseWriter

func (*DefaultContext) Server added in v1.5.0

func (d *DefaultContext) Server() *server.Server

func (*DefaultContext) Store added in v1.5.0

func (d *DefaultContext) Store() storage.Store

func (*DefaultContext) Translation

func (d *DefaultContext) Translation(str string) string

func (*DefaultContext) UseCsrf added in v1.5.0

func (d *DefaultContext) UseCsrf() bool

type Lifecycle added in v1.5.0

type Lifecycle struct {
	WebUI *WebUI
	// contains filtered or unexported fields
}

func Subsystem added in v1.5.0

func Subsystem(binding string) *Lifecycle

func (*Lifecycle) Name added in v1.5.0

func (l *Lifecycle) Name() string

func (*Lifecycle) Reload added in v1.5.0

func (l *Lifecycle) Reload(s *server.Server) error

func (*Lifecycle) Shutdown added in v1.5.0

func (l *Lifecycle) Shutdown(s *server.Server) error

func (*Lifecycle) Start added in v1.5.0

func (l *Lifecycle) Start(s *server.Server) error

type Options added in v1.5.0

type Options struct {
	Binding    string
	Password   string
	EnableCSRF bool
}

type Queue

type Queue struct {
	Name string
	Size uint64
}

type Tab

type Tab struct {
	Name string
	Path string
}

type Translator added in v1.5.0

type Translator interface {
	Locale() string
	Translation(string) string
}

type WebUI added in v1.5.0

type WebUI struct {
	Options     Options
	Server      *server.Server
	App         *http.ServeMux
	Title       string
	ExtraCssUrl string
	// contains filtered or unexported fields
}

func (*WebUI) Run added in v1.5.0

func (ui *WebUI) Run() (func(), error)

Jump to

Keyboard shortcuts

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