webui

package
v0.0.0-...-e97d6fb Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2017 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Overview

Copyright (c) 2016 Justin Campbell

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"},
	}
)
View Source
var (
	LAST_ELEMENT = regexp.MustCompile(`\/([^\/]+)\z`)
)
View Source
var (
	Password = ""
)

Functions

func BasicAuth

func BasicAuth(pass http.HandlerFunc) http.HandlerFunc

func Cache

func Cache(h http.Handler) http.HandlerFunc

func DebugLog

func DebugLog(pass http.HandlerFunc) http.HandlerFunc

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

func FireItUp

func FireItUp(svr *server.Server) error

func GetOnly

func GetOnly(h http.HandlerFunc) http.HandlerFunc

func InitialSetup

func InitialSetup(pwd string)

func Log

func Log(pass http.HandlerFunc) http.HandlerFunc

func PostOnly

func PostOnly(h http.HandlerFunc) http.HandlerFunc

func Setup

func Setup(pass http.HandlerFunc, debug bool) http.HandlerFunc

func Timeago

func Timeago(t time.Time) string

Types

type AssetDirectory

type AssetDirectory struct {
	AssetFile
	ChildrenRead int
	Children     []os.FileInfo
}

func NewAssetDirectory

func NewAssetDirectory(name string, children []string, fs *AssetFS) *AssetDirectory

func (*AssetDirectory) Readdir

func (f *AssetDirectory) Readdir(count int) ([]os.FileInfo, error)

func (*AssetDirectory) Stat

func (f *AssetDirectory) Stat() (os.FileInfo, error)

type AssetFS

type AssetFS struct {
	Asset    func(path string) ([]byte, error)
	AssetDir func(path string) ([]string, error)
	Prefix   string
}

func (*AssetFS) Open

func (fs *AssetFS) Open(name string) (http.File, error)

type AssetFile

type AssetFile struct {
	*bytes.Reader
	io.Closer
	*DummyFile
}

func NewAssetFile

func NewAssetFile(name string, content []byte) *AssetFile

func (*AssetFile) Readdir

func (f *AssetFile) Readdir(count int) ([]os.FileInfo, error)

func (*AssetFile) Size

func (f *AssetFile) Size() int64

func (*AssetFile) Stat

func (f *AssetFile) Stat() (os.FileInfo, error)

type Context

type Context interface {
	context.Context

	Request() string
	Response() string
}

type DefaultContext

type DefaultContext struct {
	context.Context
	// contains filtered or unexported fields
}

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) Translation

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

type DummyFile

type DummyFile struct {
	Path string
	Dir  bool
	Len  int64
}

func (*DummyFile) IsDir

func (f *DummyFile) IsDir() bool

func (*DummyFile) ModTime

func (f *DummyFile) ModTime() time.Time

func (*DummyFile) Mode

func (f *DummyFile) Mode() os.FileMode

func (*DummyFile) Name

func (f *DummyFile) Name() string

func (*DummyFile) Size

func (f *DummyFile) Size() int64

func (*DummyFile) Sys

func (f *DummyFile) Sys() interface{}

type Queue

type Queue struct {
	Name string
	Size uint64
}

type Tab

type Tab struct {
	Name string
	Path string
}

type Translator

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

Jump to

Keyboard shortcuts

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