server

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 31 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 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(
	config *Config,
	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
	Stage   stage.Config           // Staging table configuration.
	Staging sinkprod.StagingConfig // Staging database configuration.
	Target  sinkprod.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.

type Server

type Server struct {
	*stdserver.Server
	Checkpoints   *checkpoint.Checkpoints
	StagingSchema ident.StagingSchema
	StagingPool   *types.StagingPool
	TargetPool    *types.TargetPool
}

Server is returned from NewServer. It exposes some implementation details to aid in embedding cases.

func NewServer

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

Jump to

Keyboard shortcuts

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