Documentation
¶
Index ¶
Constants ¶
View Source
const CacheControlFlagName = "cache-control"
CacheControlFlagName is the CLI flag name for setting the Cache-Control max-age TTL.
View Source
const HealthChecksFlagName = "health-checks"
HealthChecksFlagName is the CLI flag name for enabling health-check endpoints.
View Source
const HostFlagName = "host"
HostFlagName is the CLI flag name for setting the HTTP bind address.
View Source
const InputPostsDirArgName = "input-posts"
InputPostsDirArgName is the CLI argument name for the input posts directory.
View Source
const PortFlagName = "port"
PortFlagName is the CLI flag name for setting the HTTP listen port.
View Source
const WatchFlagName = "watch"
WatchFlagName is the CLI flag name for enabling filesystem watching.
Variables ¶
View Source
var ServeCommand cli.Command = cli.Command{ Name: "serve", Aliases: []string{"s"}, Usage: "serve a blog from markdown posts over HTTP", Action: NewServeCommand, UseShortOptionHandling: true, Arguments: []cli.Argument{ &cli.StringArg{ Name: InputPostsDirArgName, UsageText: "<input directory>", }, }, Flags: []cli.Flag{ &cli.IntFlag{ Name: PortFlagName, Aliases: []string{"P"}, Usage: "port to listen on", Value: 8080, }, &cli.StringFlag{ Name: HostFlagName, Aliases: []string{"H"}, Usage: "host address to bind to", }, &cli.BoolFlag{ Name: WatchFlagName, Aliases: []string{"w"}, Usage: "watch the posts directory and regenerate the blog on changes", Value: false, }, &cli.DurationFlag{ Name: CacheControlFlagName, Usage: "max-age TTL for the Cache-Control header (0 disables the header)", Value: time.Hour, }, &cli.BoolFlag{ Name: HealthChecksFlagName, Usage: "expose /healthz/live, /healthz/ready, and /healthz/startup endpoints (no auth required); the server binds before loading content so probes observe startup state", Value: false, }, }, }
ServeCommand is the main entry point for the GoBlog serve CLI tool. This command sets up all the flags, usage info, and action for serve.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.