worker

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats added in v0.2.2

type Stats struct {
	Errors int

	Kinds     int
	Pages     int
	Resources int
	// contains filtered or unexported fields
}

Stats worker stats

func RunExport

func RunExport(ctx context.Context, workers []Worker, resources []*types.GroupResource) (*Stats, error)

RunExport run the export wit the given workers

func (*Stats) Add added in v0.2.2

func (s *Stats) Add(o *Stats)

Add stats

func (*Stats) HasErrors added in v0.2.2

func (s *Stats) HasErrors() bool

HasErrors true if errors >0

func (*Stats) Namespaces added in v0.2.2

func (s *Stats) Namespaces() int

Namespaces get the number of namespaces

type Worker

type Worker interface {
	GenerateWork(ctx context.Context, s *sync.WaitGroup, out chan *types.GroupResource) func(resource *types.GroupResource)
	Stop() Stats
}

Worker interface

func New

func New(id int, config *types.Config, ac *client.ApiClient, prog progress.Progress) Worker

New create a new worker

Jump to

Keyboard shortcuts

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