datum

package
v0.0.0-...-404019e Latest Latest
Warning

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

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

Documentation

Overview

Package datum is our cobra/viper cli implementation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RootHost contains the root url for the Datum API
	RootHost string
	// GraphAPIHost contains the url for the Datum graph api
	GraphAPIHost string
)
View Source
var (
	Logger *zap.SugaredLogger
)
View Source
var RootCmd = &cobra.Command{
	Use:   appName,
	Short: fmt.Sprintf("a %s cli", appName),
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func JSONPrint

func JSONPrint(s []byte) error

func ViperBindFlag

func ViperBindFlag(name string, flag *pflag.Flag)

ViperBindFlag provides a wrapper around the viper bindings that panics if an error occurs

Types

type CLI

type CLI struct {
	Interceptor clientv2.RequestInterceptor
	AccessToken string
}

type RequiredFieldMissingError

type RequiredFieldMissingError struct {
	// Field contains the required field that was missing from the input
	Field string
}

RequiredFieldMissingError is returned when a field is required but not provided

func NewRequiredFieldMissingError

func NewRequiredFieldMissingError(f string) *RequiredFieldMissingError

NewRequiredFieldMissingError returns an error for a missing required field

func (*RequiredFieldMissingError) Error

func (e *RequiredFieldMissingError) Error() string

Error returns the RequiredFieldMissingError in string format

Directories

Path Synopsis
Package version contains the version information for the CLI
Package version contains the version information for the CLI

Jump to

Keyboard shortcuts

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