commands

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package commands handle the commands

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Prepare

func Prepare(root *cobra.Command)

Prepare is the setup.

Types

type Run

type Run struct{}

Run is the runtime.

func (*Run) GetArgs

func (*Run) GetArgs() cobra.PositionalArgs

GetArgs return the args.

func (*Run) GetDescription

func (*Run) GetDescription() string

GetDescription returns the command description.

func (*Run) GetLongDescription

func (*Run) GetLongDescription() string

GetLongDescription returns the command long description.

func (*Run) GetRequiredFlags

func (*Run) GetRequiredFlags() []string

GetRequiredFlags returns the server required flags.

func (*Run) Info

func (*Run) Info() string

Info returns the command name.

func (*Run) Run

func (*Run) Run() RunCmd

Run executes the script associated to the command.

func (*Run) SetFlags

func (*Run) SetFlags(flags *pflag.FlagSet)

SetFlags set the available flags.

type RunCmd

type RunCmd func(cmd *cobra.Command, args []string)

RunCmd is the command to run.

type Server

type Server struct{}

Server helper.

func (*Server) GetArgs

func (*Server) GetArgs() cobra.PositionalArgs

GetArgs return the args.

func (*Server) GetDescription

func (*Server) GetDescription() string

GetDescription returns the command description.

func (*Server) GetLongDescription

func (*Server) GetLongDescription() string

GetLongDescription returns the command long description.

func (*Server) GetRequiredFlags

func (*Server) GetRequiredFlags() []string

GetRequiredFlags returns the server required flags.

func (*Server) Info

func (*Server) Info() string

Info returns the command name.

func (*Server) Run

func (s *Server) Run() RunCmd

Run executes the script associated to the command.

func (*Server) ServeHTTP

func (*Server) ServeHTTP(rw http.ResponseWriter, _ *http.Request)

ServeHTTP handle any request.

func (*Server) SetFlags

func (*Server) SetFlags(_ *pflag.FlagSet)

SetFlags set the available flags.

Jump to

Keyboard shortcuts

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