Documentation ¶
Overview ¶
Package gobra is an HTML-based graphical user interface (GUI) for the cobra command line interface (CLI; github.com/spf13/cobra).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { // Root is the Cobra command tree root Root *cobra.Command // ServerAddress is the address that the front-end will communicate with. ServerAddress string // Allow Cross-Origin. If set to true, everyone can use the Gobra instance on client-side // Set this to true if you're planning to expose the API to public. AllowCORS bool // HTML is an HTML template. // If this is not nil, it will be served as an HTML front end. HTML *template.Template // FileUploadFunc is a function that stores uploaded files and returns the // stored location. The default FileUploadFunc saves files in a temporary // directory. FileUploadFunc func(data io.Reader, name string) (filename string, err error) // PreRun, if not nil, will be run before executing the given commands with // the given flags. PreRun func(commands *[]string, flags *url.Values) error // contains filtered or unexported fields }
Server struct/class that holds configuration for a Cobra back-end instance
func (*Server) MakeFlagUploadable ¶
MakeFlagUploadable registers the given flag name(s) as allowing file uploads. Once a flag is registered, a file input will appear next to it in the user interface, allowing the user to upload a file for the flag argument.
Click to show internal directories.
Click to hide internal directories.