Documentation ¶
Overview ¶
Package stdserver contains a generic HTTP server that can be used by sources that receive http requests.
Index ¶
- func Authenticator(ctx *stopper.Context, diags *diag.Diagnostics, config *Config, ...) (types.Authenticator, error)
- func Listener(ctx *stopper.Context, config *Config, diags *diag.Diagnostics) (net.Listener, error)
- func Mux(cfg *Config, handler http.Handler, stagingPool *types.StagingPool, ...) *http.ServeMux
- type Config
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticator ¶
func Authenticator( ctx *stopper.Context, diags *diag.Diagnostics, config *Config, pool *types.StagingPool, stagingDB ident.StagingSchema, ) (types.Authenticator, error)
Authenticator constructs a JWT-based authenticator, or a no-op authenticator if Config.DisableAuth has been set.
Types ¶
type Config ¶
type Config struct { BindAddr string DisableAuth bool GenerateSelfSigned bool HealthCheckTimeout time.Duration TLSCertFile string TLSPrivateKey string }
Config contains the user-visible configuration for running an http server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
A Server receives incoming messages and applies them to a target cluster.
func New ¶
func New( ctx *stopper.Context, auth types.Authenticator, diags *diag.Diagnostics, listener net.Listener, mux *http.ServeMux, tlsConfig *tls.Config, ) *Server
New constructs the top-level network server. The server will execute the server on a background goroutine and will gracefully drain the server when the cancel function is called.
func (*Server) GetAuthenticator ¶
func (s *Server) GetAuthenticator() types.Authenticator
GetAuthenticator implements stdlogical.HasAuthenticator.
func (*Server) GetDiagnostics ¶
func (s *Server) GetDiagnostics() *diag.Diagnostics
GetDiagnostics implements stdlogical.HasDiagnostics.
func (*Server) GetListener ¶
GetListener returns the network listener for the HTTP server.
func (*Server) GetServeMux ¶
GetServeMux implements stdlogical.HasServeMux.