command

package
v0.0.0-...-3febccf Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: Apache-2.0 Imports: 32 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunBackup

func RunBackup(backup *backupservice.Backupresult) error

RunBackup executs a backup job

func StartRestore

func StartRestore(restore *restoreservice.Restoreresult, logger *log.Logger) error

StartRestore command is the invoked to start restoring from backup

Types

type APIClient

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

func NewAPIClient

func NewAPIClient() (*APIClient, error)

NewAPIClient allow users to get a way to interact with Openshift

func (*APIClient) Client

func (r *APIClient) Client() *kubernetes.Clientset

Client returns the kubernetes clientsets

func (*APIClient) Config

func (r *APIClient) Config() *rest.Config

Config returns the kubernetes rest config

func (*APIClient) GetPod

func (r *APIClient) GetPod(ctx context.Context, pod types.NamespacedName) (*corev1.Pod, error)

type Builder

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

Builder is used to convert a command of type vstring of slice into a string to send over a REST API

func Marshal

func Marshal(command []string) *Builder

Marshal takes as a slice of type string and returns a pointer of tu

func (*Builder) String

func (r *Builder) String() string

String returns a base64 encoded command

func (*Builder) Unmarshal

func (r *Builder) Unmarshal() ([]string, error)

Unmarshal reverts the command to its initial form

type ExecOptions

type ExecOptions struct {
	Pod       string
	Container string
	Namespace string
	Command   []string
}

ExecOptions provides options to be used when executing commands in poda

type ExecResponse

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

ExecResponse provides a mechanism for an executed command to return output following the completion of a command

func ExecuteCommand

func ExecuteCommand(options ExecOptions) (*ExecResponse, error)

ExecuteCommand takes a command and runs it on a specific pod

func (*ExecResponse) Error

func (r *ExecResponse) Error() string

Error method returns error in string format

func (*ExecResponse) Output

func (r *ExecResponse) Output() string

Output returns the command output in string format

Jump to

Keyboard shortcuts

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