Documentation
¶
Overview ¶
Package elasticsearch is a package of utilities to store a PackageGraph's state in an ElasticSearch index. This allows indexing once and in a distributed fashion, and querying the ElasticSearch separately.
Index ¶
Constants ¶
View Source
const ( PackageType = "package" RefType = "ref" FileType = "file" )
Types in the Elastic search index
Variables ¶
This section is empty.
Functions ¶
func FilterF ¶
FilterF returns a function suitable for goref.PackageGraph.FilterF that returns false if a package exists in this ElasticSearch index.
func LoadGraphToElastic ¶
func LoadGraphToElastic(pg goref.PackageGraph, client Client) error
LoadGraphToElastic loads all Packages and Refs from a PackageGraph to the provided ES index.
Types ¶
type Client ¶
type Client interface { // GetPackage retrieves a package by docID. GetPackage(ctx context.Context, docID string) (*elastic.GetResult, error) // CreatePackage creates a goref.Package entry in the index. CreatePackage(ctx context.Context, p *goref.Package) error // CreateFile creates a File entry in the index. CreateFile(ctx context.Context, f File) (*elastic.IndexResponse, error) // CreateRef creates a goref.Ref entry in the index. CreateRef(ctx context.Context, r *goref.Ref) (*elastic.IndexResponse, error) }
Client is an abstraction over the underlying elastic.Client that provides higher-order methods to manipulate data stored in elasticsearch.
Click to show internal directories.
Click to hide internal directories.