faktoryui

package
v0.0.0-...-21abf39 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: AGPL-3.0 Imports: 25 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 (
	AssetLookups = []assetLookup{
		localeFiles.ReadFile,
	}
)
View Source
var (
	DefaultTabs = []Tab{
		{"Home", "/"},
		{"Busy", "/busy"},
		{"Queues", "/queues"},
		{"Retries", "/retries"},
		{"Scheduled", "/scheduled"},
		{"Dead", "/morgue"},
	}
)

Functions

func DebugOnlyLog

func DebugOnlyLog(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

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

func Log

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

func PostOnly

func PostOnly(h http.HandlerFunc) http.HandlerFunc

func Redirect

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

func Timeago

func Timeago(t time.Time) string

Types

type Context

type Context interface {
	context.Context
}

type DefaultContext

type DefaultContext struct {
	context.Context

	Root string
	// contains filtered or unexported fields
}

func NewContext

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

func (*DefaultContext) Locale

func (d *DefaultContext) Locale() string

func (*DefaultContext) Manager

func (d *DefaultContext) Manager() manager.Manager

func (*DefaultContext) Request

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

func (*DefaultContext) Response

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

func (*DefaultContext) Server

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

func (*DefaultContext) Store

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

func (*DefaultContext) Translation

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

func (*DefaultContext) UseCsrf

func (d *DefaultContext) UseCsrf() bool

type Queue

type Queue struct {
	Name     string
	Size     uint64
	IsPaused bool
}

type Tab

type Tab struct {
	Name string
	Path string
}

type Translator

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

type WebUI

type WebUI struct {
	Server    *faktory.Server
	Title     string
	StartedAt time.Time
	Binding   string
	// contains filtered or unexported fields
}

func NewWeb

func NewWeb(s *faktory.Server, binding string) *WebUI

func (*WebUI) Embed

func (ui *WebUI) Embed(root *mux.Router, prefix string) *mux.Router

Jump to

Keyboard shortcuts

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