registry

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright © 2022 Roberto Hidalgo <chinampa@un.rob.mx> SPDX-License-Identifier: Apache-2.0

Copyright © 2022 Roberto Hidalgo <chinampa@un.rob.mx> SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const ContextKeyRuntimeIndex = "x-chinampa-runtime-index" // nolint:gosec

ContextKeyRuntimeIndex is the string key used to store context in a cobra Command.

Variables

View Source
var ErrorHandler = errors.HandleCobraExit

Functions

func CommandList

func CommandList() []*command.Command

func Execute

func Execute(version string) error

func FromCobra

func FromCobra(cc *cobra.Command) *command.Command

func Get

func Get(id string) *command.Command

func Register

func Register(cmd *command.Command)

func ToCobra

func ToCobra(cmd *command.Command, globalOptions command.Options, parent *cobra.Command) *cobra.Command

Types

type ByPath

type ByPath []*command.Command

func (ByPath) Len

func (cmds ByPath) Len() int

func (ByPath) Less

func (cmds ByPath) Less(i, j int) bool

func (ByPath) Swap

func (cmds ByPath) Swap(i, j int)

type CommandRegistry

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

Jump to

Keyboard shortcuts

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