Documentation ¶
Index ¶
- Constants
- func GetClientSet(overrideHost string) (clientset kubernetes.Interface, err error)
- func StreamToLogsChannel(resp io.Reader, logs chan output.Output)
- type APIClient
- func (c APIClient) AbortExecution(testID, id string) error
- func (c APIClient) CreateExecutor(options CreateExecutorOptions) (executor testkube.ExecutorDetails, err error)
- func (c APIClient) CreateTest(options UpsertTestOptions) (test testkube.Test, err error)
- func (c APIClient) CreateTestSuite(options UpsertTestSuiteOptions) (testSuite testkube.TestSuite, err error)
- func (c APIClient) CreateWebhook(options CreateWebhookOptions) (executor testkube.Webhook, err error)
- func (c APIClient) DeleteExecutor(name, namespace string) (err error)
- func (c APIClient) DeleteTest(name string, namespace string) error
- func (c APIClient) DeleteTestSuite(name string, namespace string) error
- func (c APIClient) DeleteTestSuites(namespace string) error
- func (c APIClient) DeleteTests(namespace string) error
- func (c APIClient) DeleteWebhook(namespace, name string) (err error)
- func (c APIClient) DownloadFile(executionID, fileName, destination string) (artifact string, err error)
- func (c APIClient) ExecuteTest(id, namespace, executionName string, executionParams map[string]string, ...) (execution testkube.Execution, err error)
- func (c APIClient) ExecuteTestSuite(id, namespace, executionName string, executionParams map[string]string) (execution testkube.TestSuiteExecution, err error)
- func (c APIClient) GetExecution(executionID string) (execution testkube.Execution, err error)
- func (c APIClient) GetExecutionArtifacts(executionID string) (artifacts testkube.Artifacts, err error)
- func (c APIClient) GetExecutor(name, namespace string) (executor testkube.ExecutorDetails, err error)
- func (c APIClient) GetProxy(requestType string) *rest.Request
- func (c APIClient) GetServerInfo() (info testkube.ServerInfo, err error)
- func (c APIClient) GetTest(id, namespace string) (test testkube.Test, err error)
- func (c APIClient) GetTestSuite(id, namespace string) (test testkube.TestSuite, err error)
- func (c APIClient) GetTestSuiteExecution(executionID string) (execution testkube.TestSuiteExecution, err error)
- func (c APIClient) GetWebhook(namespace, name string) (webhook testkube.Webhook, err error)
- func (c APIClient) ListExecutions(id string, limit int, selector string) (executions testkube.ExecutionsResult, err error)
- func (c APIClient) ListExecutors(namespace string) (executors testkube.ExecutorsDetails, err error)
- func (c APIClient) ListTestSuiteExecutions(testID string, limit int, selector string) (executions testkube.TestSuiteExecutionsResult, err error)
- func (c APIClient) ListTestSuites(namespace string, selector string) (testSuites testkube.TestSuites, err error)
- func (c APIClient) ListTests(namespace string, selector string) (tests testkube.Tests, err error)
- func (c APIClient) ListWebhooks(namespace string) (webhooks testkube.Webhooks, err error)
- func (c APIClient) Logs(id string) (logs chan output.Output, err error)
- func (c APIClient) UpdateTest(options UpsertTestOptions) (test testkube.Test, err error)
- func (c APIClient) UpdateTestSuite(options UpsertTestSuiteOptions) (testSuite testkube.TestSuite, err error)
- func (c APIClient) WatchTestSuiteExecution(executionID string) (executionCh chan testkube.TestSuiteExecution, err error)
- type APIConfig
- type Client
- type ClientType
- type CreateExecutorOptions
- type CreateWebhookOptions
- type HTTPClient
- type UpsertTestOptions
- type UpsertTestSuiteOptions
Constants ¶
const TestkubeInstallationNamespace = "testkube"
TestkubeInstallationNamespace where Testkube is installed
const Version = "v1"
Version is client version literal
Variables ¶
This section is empty.
Functions ¶
func GetClientSet ¶
func GetClientSet(overrideHost string) (clientset kubernetes.Interface, err error)
GetClientSet configures Kube client set, can override host with local proxy
func StreamToLogsChannel ¶ added in v0.6.5
StreamToLogsChannel 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
}
APIClient struct managing API Client dependencies
func NewAPIClient ¶ added in v0.10.2
func NewAPIClient(client kubernetes.Interface, config APIConfig) APIClient
NewAPIClient returns
func (APIClient) AbortExecution ¶ added in v0.10.0
AbortExecution aborts execution by testId and id
func (APIClient) CreateExecutor ¶ added in v0.10.0
func (c APIClient) CreateExecutor(options CreateExecutorOptions) (executor testkube.ExecutorDetails, err error)
CreateExecutor creates new Executor Custom Resource
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 (APIClient) DeleteTest ¶ added in v0.10.0
DeleteTest deletes single test by name and namespace
func (APIClient) DeleteTestSuite ¶ added in v0.10.0
func (APIClient) DeleteTestSuites ¶ added in v0.10.0
func (APIClient) DeleteTests ¶ added in v0.10.0
DeleteTests deletes all tests in given namespace
func (APIClient) DeleteWebhook ¶ added in v0.10.0
func (APIClient) DownloadFile ¶ added in v0.10.0
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
GetExecution returns test execution by excution id
func (APIClient) GetExecutionArtifacts ¶ added in v0.10.0
func (APIClient) GetExecutor ¶ added in v0.10.0
func (c APIClient) GetExecutor(name, namespace string) (executor testkube.ExecutorDetails, err error)
GetExecutor by name and namespace
func (APIClient) GetServerInfo ¶ added in v0.10.0
func (c APIClient) GetServerInfo() (info testkube.ServerInfo, err error)
func (APIClient) GetTestSuite ¶ added in v0.10.0
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 (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(namespace string) (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 (APIClient) ListWebhooks ¶ added in v0.10.0
func (APIClient) Logs ¶ added in v0.10.0
Logs returns logs stream from job pods, based on job pods logs
func (APIClient) UpdateTest ¶ added in v0.10.0
func (c APIClient) UpdateTest(options UpsertTestOptions) (test testkube.Test, err error)
UpdateTest updates 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 APIConfig ¶ added in v0.10.2
type APIConfig struct { // Namespace where testkube is installed Namespace string // API Server service name ServiceName string // API Server service port ServicePort int }
func NewAPIConfig ¶ added in v0.10.2
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, namespace string) (executor testkube.ExecutorDetails, err error) ListExecutors(namespace string) (executors testkube.ExecutorsDetails, err error) DeleteExecutor(name string, namespace 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) }
Client is the Testkube API client abstraction
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 executor request
type CreateWebhookOptions ¶ added in v0.9.18
type CreateWebhookOptions testkube.WebhookCreateRequest
CreateExectorOptions - is mapping for now to OpenAPI schema for creating/changing webhook
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) }
HTTPClient abstracts http client methods
type UpsertTestOptions ¶ added in v0.7.6
type UpsertTestOptions testkube.TestUpsertRequest
UpsertTestOptions - is mapping for now to OpenAPI schema for creating/changing test if needed can beextended to custom struct
type UpsertTestSuiteOptions ¶ added in v0.9.5
type UpsertTestSuiteOptions testkube.TestSuiteUpsertRequest
UpsertTestSuiteOptions - mapping to OpenAPI schema for creating/changing testsuite