Documentation
¶
Overview ¶
Package flags provides the command line interface for the Defacto2 server application. With the configuration of the application done using the environment variables, the use of commands should be kept to a minimum.
Index ¶
- Constants
- Variables
- func Address(w io.Writer, c *config.Config) *cli.Command
- func App(w io.Writer, ver string, c *config.Config, routes ...RoutePrinter) *cli.App
- func Arch() string
- func Check(w io.Writer, c *config.Config) *cli.Command
- func Config(w io.Writer, c *config.Config) *cli.Command
- func Copyright() string
- func Fix(w io.Writer, c *config.Config) *cli.Command
- func Index(w io.Writer, c *config.Config) *cli.Command
- func OS() string
- func Routes(w io.Writer, fn RoutePrinter) *cli.Command
- func TempDir(w io.Writer, c *config.Config) *cli.Command
- func Version(s string) string
- func VersionCommit(ver string) string
- func VersionRelease(version string) string
- type ExitCode
- type RoutePrinter
Constants ¶
const ( Title = "Defacto2 web application" // Title of this program. Domain = "defacto2.net" // Domain of the website. Repository = "https://github.com/Defacto2/server" // Repository is the GitHub URL for this project. Program = "defacto2-server" // Program is the command line name of this program. Author = "Ben Garrett" // Author is the primary programmer of this program. Email = "contact@defacto2.net" // Email contact for public display. RecentYear = 2026 // Most recent year of compilation for this program. )
Variables ¶
var ( ErrNoConfig = errors.New("cannot run command as config is nil") ErrPrinter = errors.New("routes printer is not configured") )
Functions ¶
func App ¶
App returns the command line interface for this program. It uses the github.com/urfave.cli/v2 package.
func Copyright ¶
func Copyright() string
Copyright returns a "©" copyright symbol, the respective years and author of this program.
The most recent copyright year is generated from the last commit date.
func Routes ¶ added in v1.16.1
func Routes(w io.Writer, fn RoutePrinter) *cli.Command
Routes command lists the registered web server routes.
func TempDir ¶ added in v1.14.0
TempDir command removes all temporary directories created by this app.
func Version ¶
Version returns a formatted version string for this program including the VersionCommit, OS, CPU Arch, and Go runtime version.
func VersionCommit ¶ added in v1.14.0
VersionCommit returns a formatted release or git commit version for the repository.
func VersionRelease ¶ added in v1.14.0
VersionRelease returns a formatted release version. The version string is generated by GoReleaser.