internal

package
v0.0.0-...-3a545d7 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminConfig

type AdminConfig struct {
	Prefix   string `json:"prefix" usage:"configure the prefix to use for admin endpoints" default:"/_admin" hidden:"true"`
	Username string `json:"username" usage:"specify the username used to authenticate requests with the admin endpoints" default:"admin"`
	Password string `json:"password" usage:"specify the password used to authenticate requests with the admin endpoints"`
}

AdminConfig encapsulates configuration for the administrative endpoints.

type BindConfig

type BindConfig struct {
	Address string `json:"address" usage:"configure the bind address for the server"`
}

BindConfig defines the set of configuration options for setting up a server.

type Server

type Server struct {
	AdminMux   *mux.Router
	PublicMux  *mux.Router
	Public     *http.Server
	PrivateMux *mux.Router
	Private    *http.Server
}

Server hosts a Public and Private HTTP server.

func NewServer

func NewServer(ctx context.Context, config ServerConfig) (*Server, error)

NewServer constructs a Server from it's associated configuration.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe starts underlying Public and Private HTTP servers.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown closes the underlying Public and Private HTTP server.

type ServerConfig

type ServerConfig struct {
	Admin   AdminConfig    `json:"admin"`
	GeoIP   geoip.Config   `json:"geoip"`
	Session session.Config `json:"session"`
	TLS     livetls.Config `json:"tls"`
	Public  BindConfig     `json:"public"`
	Private BindConfig     `json:"private"`
}

ServerConfig defines configuration for a public and private interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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