worker

package
v0.0.0-...-7345e3a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleReadExperiments

func HandleReadExperiments(client worker.JobClient, job entities.Job)

func HandleZbChaosJob

func HandleZbChaosJob(client worker.JobClient, job entities.Job, commandRunner CommandRunner)

Types

type AuthenticationProvider

type AuthenticationProvider struct {
	Audience         string
	AuthorizationUrl string
	ClientId         string
	ClientSecret     string
	ContactPoint     string
}

type ChaosProvider

type ChaosProvider struct {
	// the path will always be zbchaos
	Path string
	// the arguments for zbchaos, like sub-commands and parameters
	Arguments []string
	// the timeout for the command
	Timeout int64
}

type CommandRunner

type CommandRunner func([]string, context.Context) error

type FakeCompleteClient

type FakeCompleteClient struct {
	commands.CompleteJobCommandStep1
	commands.CompleteJobCommandStep2

	JobClient *FakeJobClient
}

func (*FakeCompleteClient) JobKey

func (*FakeCompleteClient) Send

func (*FakeCompleteClient) VariablesFromObject

func (f *FakeCompleteClient) VariablesFromObject(v interface{}) (commands.DispatchCompleteJobCommand, error)

type FakeFailClient

func (*FakeFailClient) ErrorMessage

func (f *FakeFailClient) ErrorMessage(errorMsg string) commands.FailJobCommandStep3

func (*FakeFailClient) JobKey

func (*FakeFailClient) Retries

func (f *FakeFailClient) Retries(retries int32) commands.FailJobCommandStep3

func (*FakeFailClient) RetryBackoff

func (f *FakeFailClient) RetryBackoff(retryBackoff time.Duration) commands.FailJobCommandStep3

func (*FakeFailClient) Send

type FakeJobClient

type FakeJobClient struct {
	worker.JobClient

	Key          int
	RetriesVal   int
	RetryBackoff time.Duration
	ErrorMsg     string
	Failed       bool
	Succeeded    bool
	Variables    interface{}
}

func (*FakeJobClient) NewCompleteJobCommand

func (f *FakeJobClient) NewCompleteJobCommand() commands.CompleteJobCommandStep1

func (*FakeJobClient) NewFailJobCommand

func (f *FakeJobClient) NewFailJobCommand() commands.FailJobCommandStep1

type ZbChaosVariables

type ZbChaosVariables struct {
	// title of the current chaos experiment
	Title *string
	// the current cluster plan we run against the chaos experiment
	ClusterPlan *string
	// the target cluster for our chaos experiment
	ClusterId *string
	// the zeebe docker image used for the chaos experiment
	// used later for workers and starter to use the right client versions
	ZeebeImage string
	// the chaos provider, which contain details to the chaos experiment
	Provider ChaosProvider
}

Jump to

Keyboard shortcuts

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