web

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package web provides HTTP service, routing, and embedded resources for the Web interface.

Pholcus is a high-concurrency, distributed, heavyweight crawler written in pure Go. It supports standalone, server, and client modes with Web, GUI, and CLI interfaces. Web UI package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// LogSocketCtrl is the global LogSocketController for log streaming.
	LogSocketCtrl = new(LogSocketController)
)
View Source
var (

	// WSController is the global SocketController for WebSocket API connections.
	WSController = &SocketController{
		connPool:  make(map[string]*ws.Conn),
		wchanPool: make(map[string]*Wchan),
	}
)

Functions

func Flag

func Flag()

Flag parses command-line flags for the web server.

func Router

func Router()

Router registers HTTP and WebSocket routes.

func Run

func Run()

Run starts the web server and opens the default browser.

Types

type LogSocketController

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

LogSocketController manages WebSocket connections for log streaming.

func (*LogSocketController) Add

func (lsc *LogSocketController) Add(sessID string, conn *ws.Conn)

func (*LogSocketController) Remove

func (lsc *LogSocketController) Remove(sessID string)

func (*LogSocketController) Write

func (lsc *LogSocketController) Write(p []byte) (int, error)

type SocketController

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

SocketController manages WebSocket connections and message channels.

func (*SocketController) Add

func (sc *SocketController) Add(sessID string, conn *ws.Conn)

func (*SocketController) GetConn

func (sc *SocketController) GetConn(sessID string) *ws.Conn

func (*SocketController) GetWchan

func (sc *SocketController) GetWchan(sessID string) *Wchan

func (*SocketController) Remove

func (sc *SocketController) Remove(sessID string, conn *ws.Conn)

func (*SocketController) Write

func (sc *SocketController) Write(sessID string, void map[string]interface{}, to ...int)

type Wchan

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

Wchan is a channel for WebSocket message delivery.

Jump to

Keyboard shortcuts

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