worker

package
v2.38.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchOptions

type BatchOptions struct {
	StartIndex        int
	NumJobs           int
	TotalWorkers      int
	Delay             time.Duration
	DelayBefore       time.Duration
	AbortOnErrorCount int
	SemanticMethod    string

	PostActions []flags.Action

	InputData []string
	// contains filtered or unexported fields
}

func (*BatchOptions) GetItem

func (b *BatchOptions) GetItem() (string, error)

type RequestHandler

type RequestHandler func(requests []c8y.RequestOptions, input any, commonOptions config.CommonCommandOptions) (*c8y.Response, error)

type Worker

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

func NewWorker

func NewWorker(log *logger.Logger, cfg *config.Config, iostream *iostreams.IOStreams, client *c8y.Client, activityLog *activitylogger.ActivityLogger, reqHandlerFunc RequestHandler, checkError func(error) error) (*Worker, error)

func (*Worker) GetMaxJobs

func (w *Worker) GetMaxJobs() int64

GetMaxJob maximum number of jobs allowed

func (*Worker) GetMaxWorkers

func (w *Worker) GetMaxWorkers() int

GetMaxWorkers maximum number of workers

func (*Worker) ProcessRequestAndResponse

func (w *Worker) ProcessRequestAndResponse(cmd *cobra.Command, r *c8y.RequestOptions, inputIterators *flags.RequestInputIterators) error

Jump to

Keyboard shortcuts

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