executor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPSPrefix = "https://"
	HTTPPrefix  = "http://"
)

HTTPSPrefix and HTTPPrefix are prefixes for HTTP and HTTPS protocols

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	Execute(ctx context.Context, job *model.Job) error
}

func WithRetry

func WithRetry(executor Executor) Executor

WithRetry wraps an executor with a retry mechanism

type Factory

type Factory interface {
	NewExecutor(job *model.Job, options ...Option) (Executor, error)
}

func NewFactory

func NewFactory(client HttpClient) Factory

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HttpClient interface

type Option

type Option func(executor Executor) Executor

Option is a function that modifies an executor before it is returned (e.g. WithRetry)

Jump to

Keyboard shortcuts

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