worker

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = data.ModuleName + "-worker"

Variables

This section is empty.

Functions

func CtxWorkerInstance

func CtxWorkerInstance(entry interface{}, ctx context.Context) context.Context

func NewWorkerAsInterface

func NewWorkerAsInterface(cfg config.Config, ctx context.Context) interface{}

func RunWorkerAsInterface

func RunWorkerAsInterface(structure interface{}, ctx context.Context)

Types

type IWorker

type IWorker interface {
	Run(ctx context.Context)
	ProcessPermissions(ctx context.Context) error
	RefreshSubmodules(msg data.ModulePayload) error
	GetEstimatedTime() time.Duration
}

type Worker

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

func WorkerInstance

func WorkerInstance(ctx context.Context) *Worker

func (*Worker) GetEstimatedTime

func (w *Worker) GetEstimatedTime() time.Duration

func (*Worker) ProcessPermissions

func (w *Worker) ProcessPermissions(_ context.Context) error

ProcessPermissions .Wrap from return err was removed because errors must be human-readable from very low level to send them in FE in case if function was called from user request. Log must be put before every error to track it if any

func (*Worker) RefreshSubmodules

func (w *Worker) RefreshSubmodules(msg data.ModulePayload) error

RefreshSubmodules .Wrap from return err was removed because errors must be human-readable from very low level to send them in FE log must be put before every error to track it if any

func (*Worker) Run

func (w *Worker) Run(ctx context.Context)

Jump to

Keyboard shortcuts

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