elasticsearch

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "elasticsearch"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	BulkCreate(content []byte, index string) error
	Stop()
}

type ClientSet

type ClientSet struct {
	Version string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *Config, cod codec.Codec, indexPattern *pattern.Pattern, documentIdPattern *pattern.Pattern) (*ClientSet, error)

func (*ClientSet) BulkIndex

func (c *ClientSet) BulkIndex(ctx context.Context, batch api.Batch) error

func (*ClientSet) Stop

func (c *ClientSet) Stop()

type Config

type Config struct {
	Hosts      []string `yaml:"hosts,omitempty" validate:"required"`
	UserName   string   `yaml:"username,omitempty"`
	Password   string   `yaml:"password,omitempty"`
	Index      string   `yaml:"index,omitempty" validate:"required"`
	Etype      string   `yaml:"etype,omitempty"` // elasticsearch type, for v5.* backward compatibility
	DocumentId string   `yaml:"documentId,omitempty"`
	Schema     string   `yaml:"schema,omitempty"`
	Sniff      *bool    `yaml:"sniff,omitempty"`
	Gzip       *bool    `yaml:"gzip,omitempty"`
}

func (*Config) Validate added in v1.1.0

func (c *Config) Validate() error

type Sink

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

func NewSink

func NewSink() *Sink

func (*Sink) Category

func (s *Sink) Category() api.Category

func (*Sink) Config

func (s *Sink) Config() interface{}

func (*Sink) Consume

func (s *Sink) Consume(batch api.Batch) api.Result

func (*Sink) Init

func (s *Sink) Init(context api.Context) error

func (*Sink) SetCodec

func (s *Sink) SetCodec(c codec.Codec)

func (*Sink) Start

func (s *Sink) Start() error

func (*Sink) Stop

func (s *Sink) Stop()

func (*Sink) String

func (s *Sink) String() string

func (*Sink) Type

func (s *Sink) Type() api.Type

Jump to

Keyboard shortcuts

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