extractor

package
v0.0.0-...-ada256f Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package extractor is grouped around the Extractor component, extracting metadata from an AnnotatedResource.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFileTooLarge is returned when the size of a file is larger than the configured `MaxFileSize`.
	ErrFileTooLarge = errors.New("file too large")
)

Functions

func ValidateMaxSize

func ValidateMaxSize(ctx context.Context, r *t.AnnotatedResource, maxSize datasize.ByteSize) error

ValidateMaxSize returns ErrFileTooLarge when the resource size is above maxSize.

Types

type Extractor

type Extractor interface {
	Extract(ctx context.Context, resource *t.AnnotatedResource, metadata interface{}) error
}

Extractor extracts metadata from an AnnotatedResource, updating the metadata interface or returning an error.

type Mock

type Mock struct {
	mock.Mock
}

Mock mocks the Extractor interface.

func (*Mock) Extract

func (m *Mock) Extract(ctx context.Context, r *t.AnnotatedResource, result interface{}) error

Extract implements the Extract method of the Extractor interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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