ui

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StaticSetting

func StaticSetting[T any](input T) func() T

Types

type APIUI

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

func New

func New(opt *Options) (http.Handler, APIUI)

func (APIUI) CSS

func (a APIUI) CSS() writer.StringGetter

func (APIUI) JS

func (a APIUI) JS() writer.StringGetter

type BoolSetting

type BoolSetting func() bool

type Handler

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

func NewUIHandler

func NewUIHandler(opts *Options) *Handler

func (*Handler) IndexFile

func (h *Handler) IndexFile() http.Handler

func (*Handler) ServeAssets

func (h *Handler) ServeAssets(next http.Handler) http.Handler

func (*Handler) ServeFaviconDashboard

func (h *Handler) ServeFaviconDashboard() http.Handler

type Options

type Options struct {
	// The location on disk of the UI files
	Path StringSetting
	// The HTTP URL of the index file to download
	Index StringSetting
	// Whether or not to run the UI offline, should return true/false/dynamic/embed
	Offline StringSetting
	// Whether or not is it release, if true UI will run offline if set to dynamic
	ReleaseSetting BoolSetting
}

type RoundTripFunc

type RoundTripFunc func(*http.Request) (*http.Response, error)

func (RoundTripFunc) RoundTrip

func (r RoundTripFunc) RoundTrip(req *http.Request) (*http.Response, error)

type StringSetting

type StringSetting func() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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