client

package
v0.0.0-jobs1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientHTTPTimeout = time.Minute
)
View Source
const Version = "v1"

Variables

This section is empty.

Functions

func GetClientSet

func GetClientSet() (clientset kubernetes.Interface, err error)

Types

type Client

type Client interface {
	GetScript(id string) (script testkube.Script, err error)
	GetExecution(scriptID, executionID string) (execution testkube.Execution, err error)
	ListExecutions(scriptID string) (executions testkube.ExecutionsResult, err error)
	AbortExecution(script string, id string) error
	CreateScript(options CreateScriptOptions) (script testkube.Script, err error)
	ExecuteScript(id, namespace, executionName string, executionParams map[string]string) (execution testkube.Execution, err error)
	ListScripts(namespace string) (scripts testkube.Scripts, err error)
	GetServerInfo() (scripts testkube.ServerInfo, err error)

	CreateExecutor(executor CreateExecutorOptions) (err error)
	GetExecutor(name string) (executor testkube.ExecutorDetails, err error)
	ListExecutors() (executors []testkube.ExecutorDetails, err error)
	DeleteExecutor(name string) (err error)
}

func GetClient

func GetClient(clientType ClientType, namespace string) (client Client, err error)

type ClientType

type ClientType string
const (
	ClientDirect ClientType = "direct"
	ClientProxy  ClientType = "proxy"
)

type Config

type Config struct {
	URI string `default:"http://localhost:8088"`
}

type CreateExecutorOptions added in v0.6.4

type CreateExecutorOptions testkube.ExecutorCreateRequest

CreateExectorOptions - is mapping for now to OpenAPI schema for creating request

type CreateScriptOptions

type CreateScriptOptions testkube.ScriptCreateRequest

CreateScriptOptions - is mapping for now to OpenAPI schema for creating request if needed can beextended to custom struct

type DirectScriptsAPI

type DirectScriptsAPI struct {
	URI string
	// contains filtered or unexported fields
}

func NewDefaultDirectScriptsAPI

func NewDefaultDirectScriptsAPI() DirectScriptsAPI

func NewDirectScriptsAPI

func NewDirectScriptsAPI(uri string) DirectScriptsAPI

func (DirectScriptsAPI) AbortExecution

func (c DirectScriptsAPI) AbortExecution(scriptID, id string) error

func (DirectScriptsAPI) CreateExecutor added in v0.6.4

func (c DirectScriptsAPI) CreateExecutor(options CreateExecutorOptions) (err error)

func (DirectScriptsAPI) CreateScript

func (c DirectScriptsAPI) CreateScript(options CreateScriptOptions) (script testkube.Script, err error)

CreateScript creates new Script Custom Resource

func (DirectScriptsAPI) DeleteExecutor added in v0.6.4

func (c DirectScriptsAPI) DeleteExecutor(name string) (err error)

func (DirectScriptsAPI) ExecuteScript

func (c DirectScriptsAPI) ExecuteScript(id, namespace, executionName string, executionParams map[string]string) (execution testkube.Execution, err error)

ExecuteScript starts new external script execution, reads data and returns ID Execution is started asynchronously client can check later for results

func (DirectScriptsAPI) GetExecution

func (c DirectScriptsAPI) GetExecution(scriptID, executionID string) (execution testkube.Execution, err error)

func (DirectScriptsAPI) GetExecutor added in v0.6.4

func (c DirectScriptsAPI) GetExecutor(name string) (executor testkube.ExecutorDetails, err error)

func (DirectScriptsAPI) GetScript

func (c DirectScriptsAPI) GetScript(id string) (script testkube.Script, err error)

func (DirectScriptsAPI) GetServerInfo added in v0.6.2

func (c DirectScriptsAPI) GetServerInfo() (info testkube.ServerInfo, err error)

func (DirectScriptsAPI) ListExecutions

func (c DirectScriptsAPI) ListExecutions(scriptID string) (executions testkube.ExecutionsResult, err error)

ListExecutions list all executions for given script name

func (DirectScriptsAPI) ListExecutors added in v0.6.4

func (c DirectScriptsAPI) ListExecutors() (executors []testkube.ExecutorDetails, err error)

func (DirectScriptsAPI) ListScripts

func (c DirectScriptsAPI) ListScripts(namespace string) (scripts testkube.Scripts, err error)

ListScripts list all scripts in given namespace

type HTTPClient

type HTTPClient interface {
	Post(url, contentType string, body io.Reader) (resp *http.Response, err error)
	Get(url string) (resp *http.Response, err error)
	Do(req *http.Request) (resp *http.Response, err error)
}

type ProxyConfig

type ProxyConfig struct {
	// Namespace where testkube is installed
	Namespace string
	// API Server service name
	ServiceName string
	// API Server service port
	ServicePort int
}

func NewProxyConfig

func NewProxyConfig(namespace string) ProxyConfig

type ProxyScriptsAPI

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

func NewProxyScriptsAPI

func NewProxyScriptsAPI(client kubernetes.Interface, config ProxyConfig) ProxyScriptsAPI

func (ProxyScriptsAPI) AbortExecution

func (c ProxyScriptsAPI) AbortExecution(scriptID, id string) error

GetExecutions list all executions in given script

func (ProxyScriptsAPI) CreateExecutor added in v0.6.4

func (c ProxyScriptsAPI) CreateExecutor(executor CreateExecutorOptions) (err error)

func (ProxyScriptsAPI) CreateScript

func (c ProxyScriptsAPI) CreateScript(options CreateScriptOptions) (script testkube.Script, err error)

CreateScript creates new Script Custom Resource

func (ProxyScriptsAPI) DeleteExecutor added in v0.6.4

func (c ProxyScriptsAPI) DeleteExecutor(name string) (err error)

func (ProxyScriptsAPI) ExecuteScript

func (c ProxyScriptsAPI) ExecuteScript(id, namespace, executionName string, executionParams map[string]string) (execution testkube.Execution, err error)

ExecuteScript starts new external script execution, reads data and returns ID Execution is started asynchronously client can check later for results

func (ProxyScriptsAPI) GetExecution

func (c ProxyScriptsAPI) GetExecution(scriptID, executionID string) (execution testkube.Execution, err error)

func (ProxyScriptsAPI) GetExecutor added in v0.6.4

func (c ProxyScriptsAPI) GetExecutor(name string) (executor testkube.ExecutorDetails, err error)

func (ProxyScriptsAPI) GetProxy

func (c ProxyScriptsAPI) GetProxy(requestType string) *rest.Request

func (ProxyScriptsAPI) GetScript

func (c ProxyScriptsAPI) GetScript(id string) (script testkube.Script, err error)

func (ProxyScriptsAPI) GetServerInfo added in v0.6.2

func (c ProxyScriptsAPI) GetServerInfo() (info testkube.ServerInfo, err error)

func (ProxyScriptsAPI) ListExecutions

func (c ProxyScriptsAPI) ListExecutions(scriptID string) (executions testkube.ExecutionsResult, err error)

ListExecutions list all executions for given script name

func (ProxyScriptsAPI) ListExecutors added in v0.6.4

func (c ProxyScriptsAPI) ListExecutors() (executor []testkube.ExecutorDetails, err error)

func (ProxyScriptsAPI) ListScripts

func (c ProxyScriptsAPI) ListScripts(namespace string) (scripts testkube.Scripts, err error)

GetExecutions list all executions in given script

Jump to

Keyboard shortcuts

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