elasticsearch

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Name          string                          `toml:"name" comment:"Name of this CDS elasticsearch Service\n Enter a name to enable this service" json:"name"`
	HTTP          service.HTTPRouterConfiguration `toml:"http" comment:"######################\n CDS Elasticsearch HTTP Configuration \n######################" json:"http"`
	URL           string                          `default:"http://localhost:8088" json:"url"`
	ElasticSearch struct {
		URL             string `toml:"url" json:"url"`
		Username        string `toml:"username" json:"username"`
		Password        string `toml:"password" json:"-"`
		IndexEventsV2   string `toml:"indexEventsV2" commented:"true" comment:"index to store CDS events v2" json:"indexEventsV2"`
		IndexEvents     string `toml:"indexEvents" commented:"true" comment:"index to store CDS events" json:"indexEvents"`
		IndexMetrics    string `toml:"indexMetrics" commented:"true" comment:"index to store CDS metrics" json:"indexMetrics"`
		IndexJobSummary string `toml:"indexJobSummary" commented:"true" comment:"index to store CDS jobs summaries" json:"indexJobSummary"`
	} `` /* 159-byte string literal not displayed */
	EventBus struct {
		JobSummaryKafka event.KafkaConsumerConfig `toml:"jobSummaryKafka" json:"jobSummaryKafka" commented:"true" mapstructure:"jobSummaryKafka"`
	} `toml:"events" json:"events" commented:"true" mapstructure:"events"`
	API service.APIServiceConfiguration `toml:"api" comment:"######################\n CDS Indexes Settings \n######################" json:"api"`
}

Configuration is the vcs configuration structure

type ESClient added in v0.52.0

type ESClient interface {
	IndexDoc(ctx context.Context, index, docType, id string, body interface{}) (*elastic.IndexResponse, error)
	SearchDoc(ctx context.Context, indices []string, docType string, query elastic.Query, sorts []elastic.Sorter, from, size int) (*elastic.SearchResult, error)
	Ping(ctx context.Context, url string) (*elastic.PingResult, int, error)
	IndexDocWithoutType(ctx context.Context, index, id string, body interface{}) (*elastic.IndexResponse, error)
}

type Service

type Service struct {
	service.Common
	Cfg    Configuration
	Router *api.Router
	// contains filtered or unexported fields
}

Service is the elasticsearch service

func New

func New() *Service

New returns a new service

func (*Service) ApplyConfiguration

func (s *Service) ApplyConfiguration(config interface{}) error

ApplyConfiguration apply an object of type elasticsearch.Configuration after checking it

func (*Service) CheckConfiguration

func (s *Service) CheckConfiguration(config interface{}) error

CheckConfiguration checks the validity of the configuration object

func (*Service) Init

func (s *Service) Init(config interface{}) (cdsclient.ServiceConfig, error)

func (*Service) Serve

func (s *Service) Serve(c context.Context) error

Serve will start the http api server

func (*Service) Status

func (s *Service) Status(ctx context.Context) *sdk.MonitoringStatus

Status returns sdk.MonitoringStatus, implements interface service.Service

Directories

Path Synopsis
Package mock_elasticsearch is a generated GoMock package.
Package mock_elasticsearch is a generated GoMock package.

Jump to

Keyboard shortcuts

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