Documentation
¶
Overview ¶
Package cmd 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(c *config.Config) *cli.Command
- func App(ver string, c *config.Config) *cli.App
- func Arch() string
- func Commit(ver string) string
- func Config(c *config.Config) *cli.Command
- func Copyright() string
- func LastCommit() string
- func OS() string
- func Vers(version string) string
- func Version(s string) string
- type ExitCode
Constants ¶
View Source
const ( Title = "Defacto2 web application" // Title of this program. Domain = "defacto2.net" // Domain of the website. Program = "df2-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. )
Variables ¶
View Source
var ErrCmd = errors.New("cannot run command as config is nil")
Functions ¶
func App ¶
App returns the command line interface for this program. It uses the github.com/urfave.cli package.
func Commit ¶
Commit returns a formatted, git commit description for the repository, including tag version and date.
func Copyright ¶
func Copyright() string
Copyright returns the © symbol, years and author of this program. The final year is generated from the last commit date.
func LastCommit ¶
func LastCommit() string
LastCommit returns the date of the last repository commit.
func Vers ¶
Vers returns a formatted version. The version string is generated by GoReleaser.
Types ¶
type ExitCode ¶
type ExitCode int // ExitCode is the exit code for this program.
const ( Continue ExitCode = iota - 1 // Continue is a special case to indicate the program should not exit. ExitOK // ExitOK is the exit code for a successful run. GenericError // GenericError is the exit code for a generic error. UsageError // UsageError is the exit code for an incorrect command line argument or usage. )
Click to show internal directories.
Click to hide internal directories.