grpcobra

package
v0.0.0-...-cfaff8a Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

grpcobra contains code for using cobra with grpcli.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

Command wraps a *cobra.Command to match the grpcli.Command interface type.

func Wrap

func Wrap(cmd *cobra.Command) *Command

Wrap wraps a *cobra.Command to match the grpcli.Command interface.

func (*Command) AddCommand

func (c *Command) AddCommand(name, usage string) (grpcli.Command, error)

AddCommand adds a sub-command to c.

func (*Command) Flags

func (c *Command) Flags() grpcli.FlagSet

Flags returns a wrapped *pflag.FlagSet from the wrapped *cobra.Command.

func (*Command) SetRun

func (c *Command) SetRun(f func() error)

type FlagSet

type FlagSet struct {
	// contains filtered or unexported fields
}

FlagSet wraps a *(github.com/spf13/pflag).FlagSet to match the (..).FlagSet interface.

func (*FlagSet) Var

func (f *FlagSet) Var(v grpcli.Value, name, usage string) error

Var adds a variable to f.

Jump to

Keyboard shortcuts

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