web

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package web handles web communication with AK and its modules.

Index

Constants

View Source
const (
	// EnvLocalContentPath specifies an env var. If this env var is set it is
	// assumed to be a path to serve core web content from instead of the embedded
	// zip. This makes developing it much easier
	EnvLocalContentPath = "AK_CONTENT_WEB"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type WS

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

WS manages websockets

func (*WS) ServeHTTP

func (ws *WS) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles websocket requests

type Web

type Web struct {
	http.Handler
	// contains filtered or unexported fields
}

Web handles web communication

func New

func New(basePattern string, deps *modutil.Deps) *Web

New creates a new Web with basePattern as the basis for all URL paths and using the provided deps.

func (*Web) Handle

func (w *Web) Handle(path string, handler http.Handler)

Handle paths on the internal mux

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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