usecase

package
v0.0.0-...-d386c04 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateRetryEndeavorInAttempt

func ValidateRetryEndeavorInAttempt(prefix string, attempt *entities.Attempt) error

func ValidateRetrySelectAttemptTrigger

func ValidateRetrySelectAttemptTrigger(prefix string, attempt *entities.AttemptTrigger) error

func ValidateScannerExecuteAttemptTask

func ValidateScannerExecuteAttemptTask(prefix string, attempt *entities.AttemptTask) error

Types

type Attempt

type Attempt interface {
	Scanner() Scanner
	Retry() Retry
}

func New

func New(
	conf *config.Config,
	logger logging.Logger,
	infra *infrastructure.Infrastructure,
	repositories repositories.Repositories,
) Attempt

type Retry

type Retry interface {
	Trigger(ctx context.Context, in *RetryTriggerIn) (*RetryTriggerOut, error)
	Select(ctx context.Context, in *RetrySelectIn) (*RetrySelectOut, error)
	Endeavor(ctx context.Context, in *RetryEndeavorIn) (*RetryEndeavorOut, error)
}

type RetryEndeavorIn

type RetryEndeavorIn struct {
	Concurrency int
	Attempts    map[string]*entities.Attempt
}

func (*RetryEndeavorIn) Validate

func (in *RetryEndeavorIn) Validate() error

type RetryEndeavorOut

type RetryEndeavorOut struct {
	Success []string
	Error   map[string]error
}

type RetrySelectIn

type RetrySelectIn struct {
	BatchSize int
	Counter   int
	Triggers  map[string]*entities.AttemptTrigger
}

func (*RetrySelectIn) Validate

func (in *RetrySelectIn) Validate() error

type RetrySelectOut

type RetrySelectOut struct {
	Success []string
	Error   map[string]error
}

type RetryTriggerIn

type RetryTriggerIn struct {
	Buckets []config.AttemptBucket
}

func (*RetryTriggerIn) Validate

func (in *RetryTriggerIn) Validate() error

type RetryTriggerOut

type RetryTriggerOut struct {
	Success []string
	Error   map[string]error
}

type Scanner

type Scanner interface {
	Schedule(ctx context.Context, in *ScannerScheduleIn) (*ScannerScheduleOut, error)
	Execute(ctx context.Context, in *ScannerExecuteIn) (*ScannerExecuteOut, error)
}

type ScannerExecuteIn

type ScannerExecuteIn struct {
	BatchSize int
	Tasks     map[string]*entities.AttemptTask
}

func (*ScannerExecuteIn) Validate

func (in *ScannerExecuteIn) Validate() error

type ScannerExecuteOut

type ScannerExecuteOut struct {
	Success []string
	Error   map[string]error
}

type ScannerScheduleIn

type ScannerScheduleIn struct {
	BatchSize int
	Buckets   []config.AttemptBucket
}

func (*ScannerScheduleIn) Validate

func (in *ScannerScheduleIn) Validate() error

type ScannerScheduleOut

type ScannerScheduleOut struct {
	Success []string
	Error   map[string]error
}

Jump to

Keyboard shortcuts

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