index

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkIndex

type BulkIndex interface {
	Publish(ctx context.Context, message ...*domainpb.IndexMessage) error
}

type Metrics

type Metrics struct {
	Nats struct {
		Published uint64
		Consumed  uint64
		Failed    uint64
	}
	Index struct {
		Successful uint64
		Failed     uint64
	}
	// contains filtered or unexported fields
}

type NatsConfig

type NatsConfig struct {
	Conn         stan.Conn
	SubjectID    string
	ClusterID    string
	ClientID     string
	DurableName  string
	DurableQueue string
}

type Option

type Option func(*Service) error

func SetBulkIndexer

func SetBulkIndexer(bi esutil.BulkIndexer, direct bool) Option

func SetNatsConfiguration

func SetNatsConfiguration(ncfg *NatsConfig) Option

func WithDefaultMessageHandle

func WithDefaultMessageHandle() Option

type Service

type Service struct {
	MsgHandler func(ctx context.Context, m *domainpb.IndexMessage) error
	// contains filtered or unexported fields
}

func NewService

func NewService(options ...Option) (*Service, error)

func (*Service) BulkIndexStats

func (s *Service) BulkIndexStats() esutil.BulkIndexerStats

func (*Service) Metrics

func (s *Service) Metrics() Metrics

func (*Service) Publish

func (s *Service) Publish(ctx context.Context, messages ...*domainpb.IndexMessage) error

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

func (*Service) Start

func (s *Service) Start(ctx context.Context, workers int) error

Jump to

Keyboard shortcuts

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