webserver

package
v0.0.0-...-4c59792 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: BSD-3-Clause Imports: 30 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(pattern string, config *Config) http.Handler

func NewHandlerWithUnsecuredLocalAuthorization

func NewHandlerWithUnsecuredLocalAuthorization(pattern string, config *Config) http.Handler

NewHandlerWithUnsecuredLocalAuthorization processes requests with unsigned JWT tokens under the local principal's identity. Such tokens can be created by anyone without any secret knowledge.

Types

type Config

type Config struct {
	Server       api.Server
	Authority    string   // External domain name with optional port number.
	Origins      []string // Value "*" causes Origin header to be ignored.
	NonceChecker model.NonceChecker

	// StartSpan within request context, ending when endSpan is called.  See
	// gate.computer/gate/trace/tracelink.  The pattern string indicates the
	// matching HTTP route handler.
	//
	// TODO: is pattern redundant?
	StartSpan func(r *http.Request, pattern string) (ctx Context, endSpan func(Context))

	// AddEvent to the current trace span, or outside of trace but in relation
	// to span links.  See gate.computer/gate/trace/tracelink.
	AddEvent func(Context, *event.Event, error)

	// DetachTrace is invoked after a potentially long-running connection has
	// finished its setup.  It should end current trace and/or span if
	// possible, and prepare the context for linking to the ended span.  See
	// gate.computer/gate/trace/tracelink.
	DetachTrace func(Context) Context
	// contains filtered or unexported fields
}

Config for a web server.

func (*Config) Configured

func (c *Config) Configured() bool

func (*Config) SetIdentityKey

func (c *Config) SetIdentityKey(privateKey any) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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