Documentation
¶
Overview ¶
package gather provides methods for compiling (gathering) a list of images to be processed.
Index ¶
- func CrawlImages(ctx context.Context, bucket *blob.Bucket, rsp_ch chan *GatherImagesResponse) error
- func GatherImages(ctx context.Context, bucket *blob.Bucket, cb GatherImageCallbackFunc) error
- func GatherImagesWithOptions(ctx context.Context, bucket *blob.Bucket, 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
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, bucket *blob.Bucket, 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 {
// 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
HashImages bool
}
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
}
type GatherImagesResponse provides a struct containing basic information about a file.
func GatherImageResponseWithPath ¶ added in v0.0.14
func GatherImageResponseWithPath(ctx context.Context, bucket *blob.Bucket, path string) (*GatherImagesResponse, error)
GatherImageResponseWithPath will generate a single GatherImagesResponse response for `path` (contained in `bucket`).