service

package
v2.0.0-...-95e9935 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClient   = ServiceError{/* contains filtered or unexported fields */}
	ErrNotFound = ServiceError{/* contains filtered or unexported fields */}
)

Sentinel errors.

Functions

This section is empty.

Types

type ServiceError

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

ServiceError has detailed information about errors from the service package.

func (ServiceError) Error

func (se ServiceError) Error() string

Error is used to output the error message.

func (ServiceError) Is

func (se ServiceError) Is(target error) bool

Is checks if the given error and the current ServiceError are the same.

type Worker

type Worker struct {
	HTTPClient          *http.Client
	URLSigningSecret    string
	Logger              zerolog.Logger
	TraceExtractor      func(context.Context, zerolog.Logger) (zerolog.Logger, error)
	StorageBucketRegion map[string]string
	// contains filtered or unexported fields
}

Worker used to fetch and process PDF files.

func (*Worker) Init

func (w *Worker) Init() error

Init worker internal state.

func (*Worker) Metadata

func (w *Worker) Metadata(ctx context.Context, url, path string) (_ string, _ int, err error)

Metadata is used to fetch the document metadata.

func (*Worker) Process

func (w *Worker) Process(
	ctx context.Context, url, path string, page int, width int, scale float32, output io.Writer,
) (err error)

Jump to

Keyboard shortcuts

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