indexers

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 18 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

ESClient elasticsearch client instance

View Source
var OSClient *opensearch.Client

OSClient OpenSearch client instance

Functions

This section is empty.

Types

type Elastic

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

Elastic ElasticSearch instance

func (*Elastic) Index

func (esIndexer *Elastic) Index(documents []interface{}, opts IndexingOpts) (string, error)

Index uses bulkIndexer to index the documents in the given index

type Indexer

type Indexer interface {
	Index([]interface{}, IndexingOpts) (string, error)
	// contains filtered or unexported methods
}

Indexer interface

func NewIndexer

func NewIndexer(indexerConfig IndexerConfig) (*Indexer, error)

NewIndexer creates a new Indexer with the specified IndexerConfig

type IndexerConfig

type IndexerConfig struct {
	// Type type of indexer
	Type IndexerType `yaml:"type"`
	// Servers List of ElasticSearch instances
	Servers []string `yaml:"esServers"`
	// Index index to send documents to server
	Index string `yaml:"defaultIndex"`
	// InsecureSkipVerify disable TLS ceriticate verification
	InsecureSkipVerify bool `yaml:"insecureSkipVerify"`
	// Directory to save metrics files in
	MetricsDirectory string `yaml:"metricsDirectory"`
	// Create tarball
	CreateTarball bool `yaml:"createTarball"`
	// TarBall name
	TarballName string `yaml:"tarballName"`
}

IndexerConfig holds the indexer configuration

type IndexerType

type IndexerType string

IndexerType type of indexer

const (
	// Elastic indexer that sends metrics to the configured ES instance
	ElasticIndexer IndexerType = "elastic"
	// OpenSearch indexer that sends metrics to the configured Search Instance
	OpenSearchIndexer IndexerType = "opensearch"
	// Local indexer that writes metrics to local directory
	LocalIndexer IndexerType = "local"
)

Types of indexers

type IndexingOpts

type IndexingOpts struct {
	MetricName string // MetricName, required for local indexer
}

Indexing options

type Local

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

Local indexer instance

func (*Local) Index

func (l *Local) Index(documents []interface{}, opts IndexingOpts) (string, error)

Index uses generates a local file with the given name and metrics

type OpenSearch

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

OpenSearch OpenSearch instance

func (*OpenSearch) Index

func (OpenSearchIndexer *OpenSearch) Index(documents []interface{}, opts IndexingOpts) (string, error)

Index uses bulkIndexer to index the documents in the given index

Jump to

Keyboard shortcuts

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