Documentation ¶
Overview ¶
package gather provides methods for compiling (gathering) a list of images to be processed.
Index ¶
- func CrawlImages(ctx context.Context, opts *GatherImagesOptions, ...) error
- func GatherImages(ctx context.Context, bucket *blob.Bucket, cb GatherImageCallbackFunc) error
- func GatherImagesWithOptions(ctx context.Context, opts *GatherImagesOptions) error
- type GatherImageCallbackFunc
- type GatherImagesOptions
- type GatherImagesResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CrawlImages ¶ added in v0.0.8
func CrawlImages(ctx context.Context, opts *GatherImagesOptions, rsp_ch chan *GatherImagesResponse) error
Iterate through all the items stored in a blob.Bucket instance, generate a GatherImagesResponse for things that are images and dispatch that response to a user-defined channel.
func GatherImages ¶ added in v0.0.8
GatherImages will gather images from bucket enabling image hashing by default.
func GatherImagesWithOptions ¶ added in v0.0.8
func GatherImagesWithOptions(ctx context.Context, opts *GatherImagesOptions) error
GatherImages will gather images from bucket with custom configuration options.
Types ¶
type GatherImageCallbackFunc ¶ added in v0.0.8
type GatherImageCallbackFunc func(*GatherImagesResponse) error
type GatherImageCallbackFunc provides a function signature for custom callbacks applied to gathered images.
type GatherImagesOptions ¶ added in v0.0.8
type GatherImagesOptions struct { Bucket *blob.Bucket // A custom callback function to be applied to each image that is gathered Callback GatherImageCallbackFunc // A boolean flag indicating whether image hashes should be calculated for gathered images EmbossImages bool // A valid sfomuseum/go-text-emboss.Embosser instance used to extract text from gathered images Embosser emboss.Embosser }
type GatherImagesOptions provides configuration options for gathering images
type GatherImagesResponse ¶ added in v0.0.8
type GatherImagesResponse struct { // The path to the image file being gathered Path string // The SHA-1 hash of the file (defined in Path) Fingerprint string // The mimetype of the image file being gathered MimeType string // The set of image hashes for the image file being gathered ImageHashes []*common.ImageHashRsp // Text extracted from the image using the `sfomuseum/go-text-emboss` package. ImageText []byte }
type GatherImagesResponse provides a struct containing basic information about a file.
func GatherImageResponseWithPath ¶ added in v0.0.14
func GatherImageResponseWithPath(ctx context.Context, opts *GatherImagesOptions, path string) (*GatherImagesResponse, error)
GatherImageResponseWithPath will generate a single GatherImagesResponse response for `path` (contained in `bucket`).