cmd

package
v0.0.0-...-9dcaf83 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:              "hioctl",
	Short:            "hive fabric rest api client",
	Version:          fmt.Sprintf("%s ", version),
	PersistentPreRun: connectRest,
	TraverseChildren: true,
}

RootCmd root command for hioctl

View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "hioctl version information",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Printf("version: %s\n", version)
		if commit != "" {
			fmt.Printf("commit: %s\n", commit)
		}
		if date != "" {
			fmt.Printf("commit date: %s\n", date)
		}
		if info, ok := debug.ReadBuildInfo(); ok && info.Main.Sum != "" {
			fmt.Printf("module version: %s, checksum: %s\n", info.Main.Version, info.Main.Sum)
		}
		fmt.Printf("https://github.com/hive-io/hive-go-client\n")
	},
}

Functions

func Execute

func Execute()

Execute run root command

Types

type ExportData

type ExportData struct {
	Clusters     []rest.Cluster
	Hosts        []rest.Host
	Realms       []rest.Realm
	Profiles     []rest.Profile
	StoragePools []rest.StoragePool
	Templates    []rest.Template
	Pools        []rest.Pool
	Guests       []rest.Guest
	Broker       rest.Broker
	Users        []rest.User
}

func CreateExport

func CreateExport() (ExportData, error)

func ReadFile

func ReadFile(file *os.File) (ExportData, error)

func (ExportData) WriteFile

func (export ExportData) WriteFile(file *os.File) error

type ExportWriter

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

func NewExportWriter

func NewExportWriter(file io.Writer) ExportWriter

func (*ExportWriter) AddFile

func (t *ExportWriter) AddFile(filePath string, obj interface{}) error

func (*ExportWriter) Close

func (t *ExportWriter) Close() error

Jump to

Keyboard shortcuts

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