search

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package search provides offline caption search over the personal library and installed pack manifests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID          string   `json:"id"`
	MD5         string   `json:"md5"`
	SHA256      string   `json:"sha256"`
	Filename    string   `json:"filename"`
	Format      string   `json:"format"`
	Size        int64    `json:"size"`
	Caption     string   `json:"caption"`
	Path        string   `json:"path"`
	Favorite    bool     `json:"favorite"`
	Packs       []string `json:"packs"`
	PreviewPath string   `json:"preview_path,omitempty"`
}

Item is the metadata returned for a searchable image. Search deliberately does not read image bytes; get performs the complete integrity check.

func Find

func Find(ctx context.Context, home, id string) (Item, error)

Find locates one item across the personal manifest and installed pack manifests. It reads metadata only; callers must verify the returned path before using it.

type Options

type Options struct {
	Home      string
	Query     string
	Pack      string
	Favorites bool
	Limit     int
	Offset    int
}

Options controls one offline search.

type Result

type Result struct {
	Items         []Item `json:"items"`
	Total         int    `json:"total"`
	NextOffset    int    `json:"next_offset"`
	HasMore       bool   `json:"has_more"`
	SetupRequired bool   `json:"setup_required,omitempty"`
}

Result is the bounded, resumable search response.

func Execute

func Execute(ctx context.Context, options Options) (Result, error)

Execute searches only local manifests. It performs no network access and does not validate image contents, so a later get can report a missing or damaged image without making search expensive for large collections.

Jump to

Keyboard shortcuts

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