cobraserver

package module
v0.0.0-...-5472cd7 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 16 Imported by: 0

README

cobraserver

report doc

Cobraserver enables creation of Go binaries that provide a set of functions that can be run via an UI, a HTTP API or using command line.

Example

See example

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Application

func Application(name string, width, height int, staticPath pkger.Dir, uiRoot bool, commands ...*Command) *cobra.Command

func Commandline

func Commandline(commands ...*Command) (cobras []*cobra.Command)

func PrintJSON

func PrintJSON(w io.Writer, i interface{}) error

func ServeCommand

func ServeCommand(staticPath pkger.Dir, commands ...*Command) *cobra.Command

func UICommand

func UICommand(name string, width, height int, staticPath pkger.Dir, commands ...*Command) *cobra.Command

Types

type Command

type Command struct {
	Name       string
	Route      string
	Method     string
	SetupFlags func(f *pflag.FlagSet)
	Handler    func(io.Writer, io.Reader, *pflag.FlagSet) error
}

Jump to

Keyboard shortcuts

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