server

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidProxyRoute  = errors.New("proxy.route.invalid")
	ErrInvalidProxyRoutes = errors.New("proxy.routes.invalid")
)
View Source
var ErrInvalidProxyStreamingPolicy = errors.New("proxy.streaming.policy.invalid")
View Source
var ErrInvalidRouteResponsePolicy = errors.New("route.response.policy.invalid")

Functions

This section is empty.

Types

type FileServer

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

FileServer serves files over HTTP or HTTPS.

func NewFileServer

func NewFileServer(loggingService *logging.Service, servingAddressFormatter serverdetails.ServingAddressFormatter) FileServer

NewFileServer constructs a FileServer.

func (FileServer) Serve

func (fileServer FileServer) Serve(ctx context.Context, configuration FileServerConfiguration) error

Serve runs the HTTP server until the context is cancelled or an error occurs.

type FileServerConfiguration

type FileServerConfiguration struct {
	BindAddress             string
	Port                    string
	DirectoryPath           string
	ProtocolVersion         string
	DisableDirectoryListing bool
	EnableMarkdown          bool
	BrowseDirectories       bool
	InitialFileRelativePath string
	LoggingType             string
	TLS                     *TLSConfiguration
	ProxyRoutes             ProxyRoutes
	RouteResponsePolicies   RouteResponsePolicies
	ProxyStreamingPolicies  ProxyStreamingPolicies
}

type ProxyRoutes added in v0.4.0

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

func NewProxyRoutes added in v0.4.0

func NewProxyRoutes(routeMappings []string) (ProxyRoutes, error)

func NewProxyRoutesFromLegacy added in v0.4.0

func NewProxyRoutesFromLegacy(pathPrefix string, backendURL string) (ProxyRoutes, error)

func (ProxyRoutes) IsEmpty added in v0.4.0

func (routes ProxyRoutes) IsEmpty() bool

type ProxyStreamingPolicies added in v0.5.1

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

func NewProxyStreamingPolicies added in v0.5.1

func NewProxyStreamingPolicies(mappings []string) (ProxyStreamingPolicies, error)

func (ProxyStreamingPolicies) IsUnbuffered added in v0.5.1

func (policies ProxyStreamingPolicies) IsUnbuffered(requestPath string) bool

type RouteResponsePolicies added in v0.5.1

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

func NewRouteResponsePolicies added in v0.5.1

func NewRouteResponsePolicies(mappings []string) (RouteResponsePolicies, error)

func (RouteResponsePolicies) HeadersForPath added in v0.5.1

func (policies RouteResponsePolicies) HeadersForPath(requestPath string) map[string]string

func (RouteResponsePolicies) IsEmpty added in v0.5.1

func (policies RouteResponsePolicies) IsEmpty() bool

type TLSConfiguration

type TLSConfiguration struct {
	CertificatePath   string
	PrivateKeyPath    string
	LoadedCertificate *tls.Certificate
}

TLSConfiguration describes transport layer security configuration.

Jump to

Keyboard shortcuts

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