index

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 23 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 SetDisableMetrics added in v0.3.0

func SetDisableMetrics(disable bool) Option

func SetLogger added in v0.3.0

func SetLogger(log zerolog.Logger) Option

func SetNatsConfiguration

func SetNatsConfiguration(ncfg *NatsConfig) Option

func SetOrganisationService added in v0.3.0

func SetOrganisationService(org *organization.Service) Option

func SetOrphanWait added in v0.2.0

func SetOrphanWait(wait int) Option

func SetPostHookService added in v0.2.0

func SetPostHookService(hooks ...domain.PostHookService) 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) AddPostHook added in v0.2.0

func (s *Service) AddPostHook(hook domain.PostHookService) error

AddPostHook adds posthook to the indexing service

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