Documentation ¶
Overview ¶
Package stdlogical contains a template for building a standard logical-replication CLI command.
Index ¶
- Constants
- func AddHandlers(auth types.Authenticator, mux *http.ServeMux, diags *diag.Diagnostics)
- func MetricsServer(auth types.Authenticator, bindAddr string, diags *diag.Diagnostics) (func(), error)
- func New(t *Template) *cobra.Command
- type Config
- type HasAuthenticator
- type HasDiagnostics
- type HasServeMux
- type Template
Constants ¶
View Source
const MetricsAddrFlag = "metricsAddr"
MetricsAddrFlag is a global flag that will start an HTTP server.
Variables ¶
This section is empty.
Functions ¶
func AddHandlers ¶
func AddHandlers(auth types.Authenticator, mux *http.ServeMux, diags *diag.Diagnostics)
AddHandlers populates the ServeMux with diagnostic endpoints.
func MetricsServer ¶
func MetricsServer( auth types.Authenticator, bindAddr string, diags *diag.Diagnostics, ) (func(), error)
MetricsServer starts a trivial HTTP server which runs until canceled.
Types ¶
type HasAuthenticator ¶
type HasAuthenticator interface {
GetAuthenticator() types.Authenticator
}
HasAuthenticator allows the object to supply a types.Authenticator.
type HasDiagnostics ¶
type HasDiagnostics interface {
GetDiagnostics() *diag.Diagnostics
}
HasDiagnostics allows the object to supply a diag.Diagnostics.
type HasServeMux ¶
HasServeMux allows the object to provide a http.ServeMux to bind the endpoints to, if the MetricsAddrFlag is not set.
type Template ¶
type Template struct { // An optional object for CLI flag registration. Config Config // An optional default value for [MetricsAddrFlag]. Metrics string // Passed to [cobra.Command.Short]. Short string // Start should return an object that implements zero or more of the // capability interfaces in this package. Start func(ctx *stopper.Context, cmd *cobra.Command) (started any, err error) // Passed to [cobra.Command.Use]. Use string // contains filtered or unexported fields }
A Template contains the input for New.
Click to show internal directories.
Click to hide internal directories.