cli

package
v1.0.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cli has a basic CLI interface for gostatic apps. Parses the flags and calls the appropriate functions of the given app.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultArgs

func DefaultArgs() []string

DefaultArgs returns the default Args for flag.FlagSet

func DefaultName

func DefaultName() string

DefaultName returns the name of the executable from the Args

func Run

func Run(name string, application App, args []string) error

Run takes the args and parses the flag to run the correct App function

func RunDefault

func RunDefault(application App) error

RunDefault runs the App with the default settings

Types

type App

type App interface {
	// RunFileServer runs the server to host the generated files of the static web page
	RunFileServer() error
	// Host runs a web application server that computes the route responses in real time
	Host() error
	// Generate generate the static web pages
	Generate() error

	// GeneratedPath returns the path of the generates files of the static web page
	GeneratedPath() string
	// FileServerPort returns the port of the file server
	FileServerPort() int
	// ServerPort returns the port of the web application server
	ServerPort() int
}

App has the high level commands that the CLI can work with

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL