server

package
v0.0.0-...-9e054ec Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package server contains an HTTP server that installs the CDC listener.

Index

Constants

This section is empty.

Variables

Set is used by Wire.

Functions

func NewServer

func NewServer(ctx *stopper.Context, config *Config) (*stdserver.Server, error)

func ProvideAuthenticator

func ProvideAuthenticator(
	ctx *stopper.Context,
	diags *diag.Diagnostics,
	config *Config,
	pool *types.StagingPool,
	stagingDB ident.StagingSchema,
) (types.Authenticator, error)

ProvideAuthenticator is called by Wire to construct a JWT-based authenticator, or a no-op authenticator if Config.DisableAuth has been set.

func ProvideListener

func ProvideListener(
	ctx *stopper.Context, config *Config, diags *diag.Diagnostics,
) (net.Listener, error)

ProvideListener is called by Wire to construct the incoming network socket for the server.

func ProvideMux

func ProvideMux(
	handler *cdc.Handler, stagingPool *types.StagingPool, targetPool *types.TargetPool,
) *http.ServeMux

ProvideMux is called by Wire to construct the http.ServeMux that routes requests.

func ProvideServer

func ProvideServer(
	ctx *stopper.Context,
	auth types.Authenticator,
	diags *diag.Diagnostics,
	listener net.Listener,
	mux *http.ServeMux,
	tlsConfig *tls.Config,
) *stdserver.Server

ProvideServer is called by Wire to construct the top-level network server. This provider will execute the server on a background goroutine and will gracefully drain the server when the cancel function is called.

func ProvideTLSConfig

func ProvideTLSConfig(config *Config) (*tls.Config, error)

ProvideTLSConfig is called by Wire to load the certificate and key from disk, to generate a self-signed localhost certificate, or to return nil if TLS has been disabled.

Types

type Config

type Config struct {
	CDC     cdc.Config
	HTTP    stdserver.Config
	Staging stagingProd.StagingConfig
	Target  stagingProd.TargetConfig
}

Config contains the user-visible configuration for running a CDC changefeed server.

func (*Config) Bind

func (c *Config) Bind(flags *pflag.FlagSet)

Bind registers flags.

func (*Config) Preflight

func (c *Config) Preflight() error

Preflight implements logical.Config.

type EagerConfig

type EagerConfig Config

EagerConfig is a hack to force Wire to build the script loader first. This allows the userscript to modify all CLI options.

func ProvideEagerConfig

func ProvideEagerConfig(cfg *Config, _ *script.Loader) (*EagerConfig, error)

ProvideEagerConfig makes the configuration objects depend upon the script loader and preflights the configuration.

Jump to

Keyboard shortcuts

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