commands

package
v1.44.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TrimLeadingWhitespace

func TrimLeadingWhitespace(commandStr string) (newCommand string)

TrimLeadingWhitespace removes leading whitespace, so that Python code blocks that are embedded into Go code still could be interpreted properly.

Types

type Command

type Command struct {
	ID      string                 `json:"id,omitempty"`
	Status  string                 `json:"status,omitempty"`
	Results *common.CommandResults `json:"results,omitempty"`
}

Command is the struct that contains what the 1.2 api returns for the commands api

type CommandsAPI

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

CommandsAPI exposes the Context & Commands API

func NewCommandsAPI

func NewCommandsAPI(ctx context.Context, m any) CommandsAPI

NewCommandsAPI creates CommandsAPI instance from provider meta

func (CommandsAPI) Execute

func (a CommandsAPI) Execute(clusterID, language, commandStr string) common.CommandResults

Execute creates a spark context and executes a command and then closes context Any leading whitespace is trimmed

Jump to

Keyboard shortcuts

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