cobraserver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 13 Imported by: 0

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 PrintAny

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

func PrintJSON

func PrintJSON(w io.Writer, b []byte) error

func PrintJSONList

func PrintJSONList(w io.Writer, count int64, elements []forensicstore.JSONElement) error

func ServeCommand

func ServeCommand(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