elasticsearch

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(logger log.Logger, config Config, opts ...ClientOption) (*Client, error)

func (*Client) CreateIdx

func (c *Client) CreateIdx(ctx context.Context, discoveryOp, indexName, alias string) (err error)

func (*Client) Init

func (c *Client) Init() (string, error)

type ClientOption

type ClientOption func(*Client)

func WithClient

func WithClient(cli *elasticsearch.Client) ClientOption

type Config

type Config struct {
	Brokers        string        `mapstructure:"brokers" default:"http://localhost:9200"`
	RequestTimeout time.Duration `mapstructure:"request_timeout" default:"10s"`
}

type DiscoveryRepository

type DiscoveryRepository struct {
	// contains filtered or unexported fields
}

DiscoveryRepository implements discovery.Repository with elasticsearch as the backing store.

func NewDiscoveryRepository

func NewDiscoveryRepository(cli *Client, logger log.Logger, requestTimeout time.Duration, colSearchExclusionList []string) *DiscoveryRepository

func (*DiscoveryRepository) DeleteByID

func (repo *DiscoveryRepository) DeleteByID(ctx context.Context, assetID string) error

func (*DiscoveryRepository) DeleteByQueryExpr added in v0.7.8

func (repo *DiscoveryRepository) DeleteByQueryExpr(ctx context.Context, queryExpr queryexpr.ExprStr) error

func (*DiscoveryRepository) DeleteByURN

func (repo *DiscoveryRepository) DeleteByURN(ctx context.Context, assetURN string) error

func (*DiscoveryRepository) GroupAssets added in v0.5.4

func (repo *DiscoveryRepository) GroupAssets(ctx context.Context, cfg asset.GroupConfig) (results []asset.GroupResult, err error)

func (*DiscoveryRepository) Search

func (repo *DiscoveryRepository) Search(ctx context.Context, cfg asset.SearchConfig) (results []asset.SearchResult, err error)

Search the asset store

func (*DiscoveryRepository) Suggest

func (repo *DiscoveryRepository) Suggest(ctx context.Context, config asset.SearchConfig) (results []string, err error)

func (*DiscoveryRepository) SyncAssets added in v0.7.0

func (repo *DiscoveryRepository) SyncAssets(ctx context.Context, indexName string) (func() error, error)

func (*DiscoveryRepository) Upsert

func (repo *DiscoveryRepository) Upsert(ctx context.Context, ast asset.Asset) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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