bleve

package
v4.4.4 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Package bleve provides tools for using Bolt as a standard persistence layer for services.

Index

Constants

View Source
const (
	BufferedChanSize = 10000
	MinRotationSize  = 68 * 1024
)
View Source
const DefaultBatchSize = 2000
View Source
const DefaultRotationSize = int64(200 * 1024 * 1024)
View Source
const Driver = "bleve"

Variables

View Source
var (
	UnitTestEnv = false
)

Functions

func NewDAO

func NewDAO(ctx context.Context, driver string, dsn string, prefix string) (dao.DAO, error)

NewDAO creates a new handler for the boltdb dao

func NewIndexer

func NewIndexer(ctx context.Context, rd dao.DAO) (dao.IndexDAO, error)

NewIndexer creates and configures a default Bleve instance to store technical logs Setting rotationSize to -1 fully disables rotation

Types

type BleveConfig

type BleveConfig struct {
	BlevePath    string
	MappingName  string
	RotationSize int64
	BatchSize    int64
}

func (*BleveConfig) GetConn

func (b *BleveConfig) GetConn(ctx context.Context) (dao.Conn, error)

func (*BleveConfig) Open

func (b *BleveConfig) Open(ctx context.Context, dsn string) (dao.Conn, error)

func (*BleveConfig) SetMaxConnectionsForWeight

func (b *BleveConfig) SetMaxConnectionsForWeight(_ int)

type DAO

type DAO interface {
	dao.DAO
	BleveConfig(context.Context) (*BleveConfig, error)
}

DAO defines the functions specific to the boltdb dao

type Handler

type Handler struct {
	dao.DAO
}

Handler for the main functions of the DAO

func (*Handler) BleveConfig

func (h *Handler) BleveConfig(ctx context.Context) (*BleveConfig, error)

BleveConfig returns the folder to lookup for bleve index

func (*Handler) Init

Init initialises the handler

func (*Handler) LocalAccess

func (h *Handler) LocalAccess() bool

LocalAccess overrides DAO

type IndexDAO

type IndexDAO interface {
	DAO
	dao.IndexDAO
}

type Indexer

type Indexer struct {
	DAO
	// contains filtered or unexported fields
}

Indexer is the syslog specific implementation of the Log server

func (*Indexer) As added in v4.0.1

func (s *Indexer) As(i interface{}) bool

func (*Indexer) Close

func (s *Indexer) Close(ctx context.Context) error

func (*Indexer) DeleteMany

func (s *Indexer) DeleteMany(ctx context.Context, qu interface{}) (int32, error)

func (*Indexer) DeleteOne

func (s *Indexer) DeleteOne(ctx context.Context, data interface{}) error

func (*Indexer) FindMany

func (s *Indexer) FindMany(ctx context.Context, query interface{}, offset, limit int32, sortFields string, sortDesc bool, customCodec dao.IndexCodex) (chan interface{}, error)

func (*Indexer) Flush

func (s *Indexer) Flush(c context.Context) error

func (*Indexer) Init

func (s *Indexer) Init(ctx context.Context, cfg configx.Values) error

func (*Indexer) InsertOne

func (s *Indexer) InsertOne(ctx context.Context, data interface{}) error

func (*Indexer) MustBleveConfig added in v4.0.1

func (s *Indexer) MustBleveConfig(ctx context.Context) *BleveConfig

func (*Indexer) Open

func (s *Indexer) Open(c context.Context, indexPath string) error

Open lists all existing indexes and creates a writeable index on the active one and a composed index for searching. It calls watchInserts() to start watching for new logs

func (*Indexer) Resync

func (s *Indexer) Resync(ctx context.Context, logger func(string)) error

Resync creates a copy of current index. It has been originally used for switching analyze format from bleve to scorch.

func (*Indexer) SetCodex

func (s *Indexer) SetCodex(c dao.IndexCodex)

func (*Indexer) Stats

func (s *Indexer) Stats() map[string]interface{}

Stats implements DAO method by listing opened indexes and documents counts

func (*Indexer) Truncate

func (s *Indexer) Truncate(ctx context.Context, max int64, logger func(string)) error

Truncate gathers size of existing indexes, starting from last. When max is reached it starts deleting all previous indexes.

func (*Indexer) WatchStatus added in v4.0.1

func (s *Indexer) WatchStatus() (registry.StatusWatcher, error)

Jump to

Keyboard shortcuts

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