web

package
v1.66.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const DarkstatAPISock = "/tmp/darkstat/api.sock"
View Source
const URLPing core_types.Url = "/ping"
View Source
const UrlStatic core_types.Url = "/"

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(next http.Handler) http.Handler

func CorsMiddleware

func CorsMiddleware(next http.Handler) http.Handler

func IsTempusValid

func IsTempusValid(encrypted string) bool

func NewEndpointPing

func NewEndpointPing(w *Web) *registry.Endpoint

func NewEndpointStatic

func NewEndpointStatic(w *Web) *registry.Endpoint

func NewTempusToken

func NewTempusToken() string

Types

type AuthPermission

type AuthPermission struct {
	ExpirationDate time.Time
	IsValid        bool
}

type Mutex

type Mutex interface {
	Lock()
	Unlock()
}

type ServerClose added in v1.63.0

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

func (ServerClose) Close added in v1.63.0

func (s ServerClose) Close()

type Web

type Web struct {
	AppDataMutex Mutex
	// contains filtered or unexported fields
}

func NewWeb

func NewWeb(filesystems []*builder.Filesystem, opts ...WebOpt) *Web

func (*Web) GetMux

func (w *Web) GetMux() *http.ServeMux

func (*Web) Serve

func (w *Web) Serve(opts WebServeOpts) ServerClose

type WebOpt

type WebOpt func(w *Web)

func WithMutexableData

func WithMutexableData(app_data_mutex Mutex) WebOpt

func WithSiteRoot

func WithSiteRoot(site_root string) WebOpt

type WebServeOpts

type WebServeOpts struct {
	Port        *int
	SockAddress string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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