common

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddVerbCommands

func AddVerbCommands(parentCmd *cobra.Command, serviceName string, groupID string) error

AddVerbCommands adds subcommands for each verb to the parent command

func BuildVerbResourceMap

func BuildVerbResourceMap(serviceName string) (map[string][]string, error)

BuildVerbResourceMap builds a mapping from verbs to resources for a given service

func CustomParentHelpFunc

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

CustomParentHelpFunc customizes the help output for the parent command

func CustomVerbHelpFunc

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

CustomVerbHelpFunc customizes the help output for verb commands

func FetchApiResourcesCmd

func FetchApiResourcesCmd(serviceName string) *cobra.Command

FetchApiResourcesCmd provides api-resources command for the given service

func FetchService

func FetchService(serviceName string, verb string, resourceName string, options *FetchOptions) (map[string]interface{}, error)

FetchService handles the execution of gRPC commands for all services

func ListAPIResources

func ListAPIResources(serviceName string) error

func PrintAvailableVerbs

func PrintAvailableVerbs(cmd *cobra.Command)

PrintAvailableVerbs prints the available verbs along with both usage patterns

Types

type Config

type Config struct {
	Environment  string                 `yaml:"environment"`
	Environments map[string]Environment `yaml:"environments"`
}

Config structure to parse environment files

type Environment

type Environment struct {
	Endpoint string `yaml:"endpoint"`
	Proxy    string `yaml:"proxy"`
	Token    string `yaml:"token"`
}

type FetchOptions

type FetchOptions struct {
	Parameters      []string
	JSONParameter   string
	FileParameter   string
	APIVersion      string
	OutputFormat    string
	CopyToClipboard bool
}

FetchOptions holds the flag values for a command

Jump to

Keyboard shortcuts

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