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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址