get

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Get is a reusable implementation of the Get command for the tink cli. The Get command lists and filters resources. It supports different kind of visualisation and it is designed to be extendible and usable across resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetCommand

func NewGetCommand(opt Options) *cobra.Command

Types

type Options

type Options struct {
	// Headers is the list of headers you want to print as part of the list
	Headers []string
	// RetrieveData reaches out to Tinkerbell and it gets the required data
	RetrieveData func(context.Context, *client.FullClient) ([]interface{}, error)
	// RetrieveByID is used when a get command has a list of arguments
	RetrieveByID func(context.Context, *client.FullClient, string) (interface{}, error)
	// RetrieveByName is used when a get command has a list of arguments
	RetrieveByName func(context.Context, *client.FullClient, string) (interface{}, error)
	// PopulateTable populates a table with the data retrieved with the RetrieveData function.
	PopulateTable func([]interface{}, table.Writer) error

	// Format specifies the format you want the list of resources printed
	// out. By default it is table but it can be JSON ar CSV.
	Format string
	// NoHeaders does not print the header line
	NoHeaders bool
}

Jump to

Keyboard shortcuts

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