package
1.64.0-Personal
Repository: https://github.com/dceldran/rclone.git
Documentation: pkg.go.dev

# Packages

Package serve deals with serving objects over HTTP.

# Functions

AddAuthFlagsPrefix adds flags to the flag set for AuthConfig.
AddHTTPFlagsPrefix adds flags for the httplib.
AddTemplateFlagsPrefix for the templating functionality.
AfterEpoch returns the time since the epoch for the given time.
AuthHelp returns text describing the http authentication to add to the command help.
CtxGetAuth is a wrapper over the private Auth context key.
CtxGetUser is a wrapper over the private User context key.
CtxSetUser is a test helper that injects a User value into context.
DefaultAuthCfg returns a new config which can be customized by command line flags.
DefaultCfg is the default values used for Config.
DefaultTemplateCfg returns a new config which can be customized by command line flags.
GetTemplate returns the HTML template for serving directories via HTTP/WebDAV.
Help returns text describing the http server to add to the command help.
IsAuthenticated checks if this request was authenticated via a middleware.
IsUnixSocket checks if the request was received on a unix socket, used to skip auth & CORS.
MiddlewareAuthBasic instantiates middleware that authenticates for a single user.
MiddlewareAuthCertificateUser instantiates middleware that extracts the authenticated user via client certificate common name.
MiddlewareAuthCustom instantiates middleware that authenticates using a custom function.
MiddlewareAuthHtpasswd instantiates middleware that authenticates against the passed htpasswd file.
MiddlewareCORS instantiates middleware that handles basic CORS protections for rcd.
MiddlewareStripPrefix instantiates middleware that removes the BaseURL from the path.
NewBaseContext initializes the context for all requests, adding info for use in middleware and handlers.
NewLoggedBasicAuthenticator instantiates a new instance of LoggedBasicAuthenticator.
NewServer instantiates a new http server using provided listeners and options This function is provided if the default http server does not meet a services requirements and should not generally be used A http server can listen using multiple listeners.
PublicURL returns the URL defined in NewBaseContext, used for logging & CORS.
TemplateHelp returns a string that describes how to use a custom template.
WithAuth option initializes the appropriate auth middleware.
WithConfig option applies the Config to the server, overriding defaults.
WithTemplate option allows the parsing of a template.

# Variables

Assets holds the embedded filesystem for the default template go:embed templates.
ErrInvalidMinTLSVersion - hard coded errors, allowing for easier testing.
ErrTLSBodyMismatch - hard coded errors, allowing for easier testing.
ErrTLSFileMismatch - hard coded errors, allowing for easier testing.
ErrTLSParseCA - hard coded errors, allowing for easier testing.

# Structs

AuthConfig contains options for the http authentication.
Config contains options for the http Server.
LoggedBasicAuth simply wraps the goauth.BasicAuth struct.
Server contains info about the running http server.
TemplateConfig for the templating functionality.

# Type aliases

CustomAuthFn if used will be used to authenticate user, pass.
Middleware function signature required by chi.Router.Use().
Option allows customizing the server.