client

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const TestkubeInstallationNamespace = "testkube"
View Source
const Version = "v1"

Variables

This section is empty.

Functions

func GetClientSet

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

func StreamToLogsChannel added in v0.6.5

func StreamToLogsChannel(resp io.Reader, logs chan output.Output)

Converts io.Reader with SSE data like `data: {"type": "event", "message":"something"}` to channel of output.Output objects, helps with logs streaming from SSE endpoint (passed from job executor)

Types

type APIClient added in v0.10.0

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

func NewProxyAPIClient added in v0.9.5

func NewProxyAPIClient(client kubernetes.Interface, config ProxyConfig) APIClient

func (APIClient) AbortExecution added in v0.10.0

func (c APIClient) AbortExecution(testID, id string) error

GetExecutions list all executions in given test

func (APIClient) CreateExecutor added in v0.10.0

func (c APIClient) CreateExecutor(options CreateExecutorOptions) (executor testkube.ExecutorDetails, err error)

func (APIClient) CreateTest added in v0.10.0

func (c APIClient) CreateTest(options UpsertTestOptions) (test testkube.Test, err error)

CreateTest creates new Test Custom Resource

func (APIClient) CreateTestSuite added in v0.10.0

func (c APIClient) CreateTestSuite(options UpsertTestSuiteOptions) (testSuite testkube.TestSuite, err error)

CreateTestSuite creates new TestSuite Custom Resource

func (APIClient) CreateWebhook added in v0.10.0

func (c APIClient) CreateWebhook(options CreateWebhookOptions) (executor testkube.Webhook, err error)

func (APIClient) DeleteExecutor added in v0.10.0

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

func (APIClient) DeleteTest added in v0.10.0

func (c APIClient) DeleteTest(name string, namespace string) error

func (APIClient) DeleteTestSuite added in v0.10.0

func (c APIClient) DeleteTestSuite(name string, namespace string) error

func (APIClient) DeleteTestSuites added in v0.10.0

func (c APIClient) DeleteTestSuites(namespace string) error

func (APIClient) DeleteTests added in v0.10.0

func (c APIClient) DeleteTests(namespace string) error

func (APIClient) DeleteWebhook added in v0.10.0

func (c APIClient) DeleteWebhook(namespace, name string) (err error)

func (APIClient) DownloadFile added in v0.10.0

func (c APIClient) DownloadFile(executionID, fileName, destination string) (artifact string, err error)

func (APIClient) ExecuteTest added in v0.10.0

func (c APIClient) ExecuteTest(id, namespace, executionName string, executionParams map[string]string, executionParamsFileContent string, args []string) (execution testkube.Execution, err error)

ExecuteTest starts test execution, reads data and returns ID Execution is started asynchronously client can check later for results

func (APIClient) ExecuteTestSuite added in v0.10.0

func (c APIClient) ExecuteTestSuite(id, namespace, executionName string, executionParams map[string]string) (execution testkube.TestSuiteExecution, err error)

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

func (APIClient) GetExecution added in v0.10.0

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

func (APIClient) GetExecutionArtifacts added in v0.10.0

func (c APIClient) GetExecutionArtifacts(executionID string) (artifacts testkube.Artifacts, err error)

func (APIClient) GetExecutor added in v0.10.0

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

func (APIClient) GetProxy added in v0.10.0

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

func (APIClient) GetServerInfo added in v0.10.0

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

func (APIClient) GetTest added in v0.10.0

func (c APIClient) GetTest(id, namespace string) (test testkube.Test, err error)

func (APIClient) GetTestSuite added in v0.10.0

func (c APIClient) GetTestSuite(id, namespace string) (test testkube.TestSuite, err error)

func (APIClient) GetTestSuiteExecution added in v0.10.0

func (c APIClient) GetTestSuiteExecution(executionID string) (execution testkube.TestSuiteExecution, err error)

func (APIClient) GetWebhook added in v0.10.0

func (c APIClient) GetWebhook(namespace, name string) (webhook testkube.Webhook, err error)

func (APIClient) ListExecutions added in v0.10.0

func (c APIClient) ListExecutions(id string, limit int, selector string) (executions testkube.ExecutionsResult, err error)

ListExecutions list all executions for given test name

func (APIClient) ListExecutors added in v0.10.0

func (c APIClient) ListExecutors() (executors testkube.ExecutorsDetails, err error)

func (APIClient) ListTestSuiteExecutions added in v0.10.0

func (c APIClient) ListTestSuiteExecutions(testID string, limit int, selector string) (executions testkube.TestSuiteExecutionsResult, err error)

ListExecutions list all executions for given test suite

func (APIClient) ListTestSuites added in v0.10.0

func (c APIClient) ListTestSuites(namespace string, selector string) (testSuites testkube.TestSuites, err error)

func (APIClient) ListTests added in v0.10.0

func (c APIClient) ListTests(namespace string, selector string) (tests testkube.Tests, err error)

GetExecutions list all executions in given test

func (APIClient) ListWebhooks added in v0.10.0

func (c APIClient) ListWebhooks(namespace string) (webhooks testkube.Webhooks, err error)

func (APIClient) Logs added in v0.10.0

func (c APIClient) Logs(id string) (logs chan output.Output, err error)

func (APIClient) UpdateTest added in v0.10.0

func (c APIClient) UpdateTest(options UpsertTestOptions) (test testkube.Test, err error)

UpdateTest Test Custom Resource

func (APIClient) UpdateTestSuite added in v0.10.0

func (c APIClient) UpdateTestSuite(options UpsertTestSuiteOptions) (testSuite testkube.TestSuite, err error)

UpdateTestSuite creates new TestSuite Custom Resource

func (APIClient) WatchTestSuiteExecution added in v0.10.0

func (c APIClient) WatchTestSuiteExecution(executionID string) (executionCh chan testkube.TestSuiteExecution, err error)

WatchTestSuiteExecution watches for changes in channels of test suite executions steps

type Client

type Client interface {
	GetExecution(executionID string) (execution testkube.Execution, err error)
	ListExecutions(id string, limit int, selector string) (executions testkube.ExecutionsResult, err error)
	AbortExecution(test string, id string) error

	GetTest(id, namespace string) (test testkube.Test, err error)
	CreateTest(options UpsertTestOptions) (test testkube.Test, err error)
	UpdateTest(options UpsertTestOptions) (test testkube.Test, err error)
	DeleteTest(name string, namespace string) error
	DeleteTests(namespace string) error
	ListTests(namespace string, selector string) (tests testkube.Tests, err error)
	ExecuteTest(id, namespace, executionName string, executionParams map[string]string, executionParamsFileContent string, args []string) (execution testkube.Execution, err error)
	Logs(id string) (logs chan output.Output, err error)

	CreateExecutor(options CreateExecutorOptions) (executor testkube.ExecutorDetails, err error)
	GetExecutor(name string) (executor testkube.ExecutorDetails, err error)
	ListExecutors() (executors testkube.ExecutorsDetails, err error)
	DeleteExecutor(name string) (err error)

	CreateWebhook(options CreateWebhookOptions) (webhook testkube.Webhook, err error)
	GetWebhook(namespace, name string) (webhook testkube.Webhook, err error)
	ListWebhooks(namespace string) (executors testkube.Webhooks, err error)
	DeleteWebhook(namespace, name string) (err error)

	GetExecutionArtifacts(executionID string) (artifacts testkube.Artifacts, err error)
	DownloadFile(executionID, fileName, destination string) (artifact string, err error)

	CreateTestSuite(options UpsertTestSuiteOptions) (testSuite testkube.TestSuite, err error)
	UpdateTestSuite(options UpsertTestSuiteOptions) (testSuite testkube.TestSuite, err error)
	GetTestSuite(id string, namespace string) (testSuite testkube.TestSuite, err error)
	ListTestSuites(namespace string, selector string) (testSuites testkube.TestSuites, err error)
	DeleteTestSuite(name string, namespace string) error
	DeleteTestSuites(namespace string) error
	ExecuteTestSuite(id, namespace, executionName string, executionParams map[string]string) (execution testkube.TestSuiteExecution, err error)

	GetTestSuiteExecution(executionID string) (execution testkube.TestSuiteExecution, err error)
	ListTestSuiteExecutions(test string, limit int, selector string) (executions testkube.TestSuiteExecutionsResult, err error)
	WatchTestSuiteExecution(executionID string) (execution chan testkube.TestSuiteExecution, err error)

	GetServerInfo() (info testkube.ServerInfo, 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 CreateExecutorOptions added in v0.6.4

type CreateExecutorOptions testkube.ExecutorCreateRequest

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

type CreateWebhookOptions added in v0.9.18

type CreateWebhookOptions testkube.WebhookCreateRequest

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

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 UpsertTestOptions added in v0.7.6

type UpsertTestOptions testkube.TestUpsertRequest

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

type UpsertTestSuiteOptions added in v0.9.5

type UpsertTestSuiteOptions testkube.TestSuiteUpsertRequest

Jump to

Keyboard shortcuts

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