helper

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestToContext

func RequestToContext(r *http.Request) context.Context

func TLSConfig

func TLSConfig(cmd *cobra.Command) (*tls.Config, error)

func UnexpectedCommand

func UnexpectedCommand(cmd *cobra.Command) error

func UnexpectedSubcommand

func UnexpectedSubcommand(cmd *cobra.Command) error

UnexpectedSubcommand checks for erroneous subcommands and prints help and returns error

Types

type Args added in v1.4.20

type Args interface {
	// Get returns the nth argument, or else a blank string
	Get(n int) string
	// First returns the first argument, or else a blank string
	First() string
	// Tail returns the rest of the arguments (not the first one)
	// or else an empty string slice
	Tail() []string
	// Len returns the length of the wrapped slice
	Len() int
	// Present checks if there are any arguments present
	Present() bool
	// Slice returns a copy of the internal slice
	Slice() []string
}

func NewArgs added in v1.4.20

func NewArgs(ar []string) Args

Jump to

Keyboard shortcuts

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