Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package server implements acurl serve: a local web UI and JSON API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckRequest

type CheckRequest struct {
	URL        string   `json:"url"`
	Categories []string `json:"categories,omitempty"`
	Agents     []string `json:"agents,omitempty"`
	Render     bool     `json:"render,omitempty"`
}

CheckRequest is the body of POST /api/check.

type Options

type Options struct {
	// Base options for every check. Profiles are filtered per request.
	Check acurl.Options
	// MaxConcurrent limits simultaneous checks. Default 4.
	MaxConcurrent int
	Version       string
}

Options configures the server.

type Server

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

Server serves the UI and API.

func New

func New(opts Options) (*Server, error)

New returns a Server. Callers should set Check.BlockPrivate unless the server is only reachable by trusted users.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler with basic security headers.

Jump to

Keyboard shortcuts

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