Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MigrateOptions ¶ added in v0.1.12
type MigrateOptions struct {
Path string `arg:"required" help:"migration path"`
Label string `arg:"optional" help:"migration label"`
DryRun bool `default:"false" help:"print changes without applying"`
Extra []string `arg:"*" help:"additional migration inputs"`
}
MigrateOptions is a CLI-only subcommand fixture.
func RegisterMigrate ¶ added in v0.1.12
func RegisterMigrate() *MigrateOptions
RegisterMigrate returns migrate options only when that CLI branch is selected.
type RouteConfig ¶ added in v0.2.0
type RouteConfig struct {
Path string `help:"URL path prefix"`
Dir string `help:"directory served under the path"`
// Owner carries no sensitive key token, so only the tag can mask it. It is
// resolved by the element's path under the array key, which is stable even
// though the element's own key carries a run-time index.
Owner string `secret:"mask" help:"team that owns this route"`
Listing bool `default:"false" help:"allow directory listing"`
MaxAge time.Duration `default:"1h" help:"cache max age for this route"`
}
RouteConfig is one [[webserver.routes]] element.
type TLSConfig ¶
type TLSConfig struct {
Enabled bool `default:"false" help:"enable TLS"`
// The relative parent resolves to webserver.tls.enabled, the same key the
// absolute form named, and keeps working if this struct is embedded twice.
CertPath string `env:"TLS_CERT_FILE" dependon:".enabled" help:"TLS certificate path"`
}
TLSConfig is nested under webserver.tls.
type WebServerConfig ¶
type WebServerConfig struct {
Port int `default:"8080" help:"HTTP listen port" opt:"port,p"`
Host string `default:"localhost" help:"listen host"`
ReadTimeout time.Duration `default:"5s" help:"request read timeout"`
CorsOrigins []string `help:"CORS origins"`
// MaxRequestBody has no default, so it stays out of provenance until a
// source sets it. It is here to keep a sized integer in the compiled path.
MaxRequestBody int64 `help:"maximum request body in bytes"`
// AdminToken is set but never printed: secret hide drops it from provenance.
AdminToken string `default:"seed-token" secret:"hide" help:"admin API token"`
Tracing string `enum:"off,otlp,jaeger" falsy:"off" help:"tracing exporter"`
TracingURL string `dependon:"webserver.tracing" help:"tracing collector URL"`
TLS TLSConfig
Routes []RouteConfig `help:"static routes, one [[webserver.routes]] table each"`
}
WebServerConfig is a Bind-style config used by generator and load tests.
func Register ¶
func Register() *WebServerConfig
Register returns Bind handles for Load tests (discovered by tinybind-gen).
Click to show internal directories.
Click to hide internal directories.