Documentation
¶
Overview ¶
Package server contains an HTTP server that installs the CDC listener.
Index ¶
- Variables
- func ProvideAuthenticator(ctx *stopper.Context, diags *diag.Diagnostics, config *Config, ...) (types.Authenticator, error)
- func ProvideListener(ctx *stopper.Context, config *Config, diags *diag.Diagnostics) (net.Listener, error)
- func ProvideMux(config *Config, handler *cdc.Handler, stagingPool *types.StagingPool, ...) *http.ServeMux
- func ProvideServer(ctx *stopper.Context, auth types.Authenticator, diags *diag.Diagnostics, ...) *stdserver.Server
- func ProvideTLSConfig(config *Config) (*tls.Config, error)
- type Config
- type EagerConfig
- type Server
Constants ¶
This section is empty.
Variables ¶
var Set = wire.NewSet( ProvideAuthenticator, ProvideEagerConfig, ProvideListener, ProvideMux, ProvideServer, ProvideTLSConfig, )
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.
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.
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.