Documentation ¶
Index ¶
- Variables
- func BuildQuery(nameTag, advanced string) bleve.Query
- func DocumentToImage(h *search.DocumentMatch) *dim.IndexImage
- func Parse(name string, img *dim.RegistryImage) *dim.IndexImage
- type Config
- type Hook
- type Index
- func (idx *Index) Build() <-chan bool
- func (idx *Index) DeleteImage(id string)
- func (idx *Index) FindImage(id string) (*dim.IndexImage, error)
- func (idx *Index) GetImage(repository, tag string, dg digest.Digest) (*dim.IndexImage, error)
- func (idx *Index) IndexImage(image *dim.IndexImage)
- func (idx *Index) SearchImages(q, a string, fields []string, offset, maxResults int) (*dim.IndexResults, error)
- func (idx *Index) Submit(job *dim.NotificationJob)
Constants ¶
This section is empty.
Variables ¶
var ImageMapping *bleve.DocumentMapping
ImageMapping is a document mapping that specifies how to index an image
Functions ¶
func BuildQuery ¶
BuildQuery returns the query object corresponding to given parameters
func DocumentToImage ¶
func DocumentToImage(h *search.DocumentMatch) *dim.IndexImage
DocumentToImage reads all fields of the given DocumentMatch and returns an image
Types ¶
type Config ¶
type Config struct { // Directory where to write index data Directory string // Hooks to trigger on event Hooks []*Hook // contains filtered or unexported fields }
Config holds index configuration
func (*Config) ParseHooks ¶
ParseHooks parses Action fields of all hooks and stores the template in their eval fields Functions available in templates should be added before with RegisterFunction
func (*Config) RegisterFunction ¶
RegisterFunction adds a function that can be used in hook Actions
type Hook ¶
type Hook struct { Event dim.ActionType Action string // contains filtered or unexported fields }
Hook evals the template string when an event of its type occurs
type Index ¶
type Index struct { // Index is the bleve.Index instance bleve.Index Config *Config RegClient dim.RegistryClient // contains filtered or unexported fields }
Index manages indexation of docker images
func New ¶
New create a new instance to manage a index of a given registry into a specific directory
func (*Index) Build ¶
Build creates a full index from the registry. The returned channel is closed once all images are indexed so the caller can block until the index is built if needed
func (*Index) DeleteImage ¶
DeleteImage removes an image from the index
func (*Index) IndexImage ¶
func (idx *Index) IndexImage(image *dim.IndexImage)
IndexImage adds a given image into the index