 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package elasticsearch contains logic to record data to an elasticsearch index. The data is already sanitised by the data provider.
Index ¶
- type Config
- func (c *Config) Backoff() int
- func (c *Config) Endpoint() string
- func (c *Config) IndexName() string
- func (c *Config) Logger() logrus.FieldLogger
- func (c *Config) Name() string
- func (c *Config) NewInstance(ctx context.Context, payloadChan chan *recorder.RecordJob, ...) (recorder.DataRecorder, error)
- func (c *Config) RoutePath() string
- func (c *Config) Timeout() time.Duration
 
- type Recorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
	ESEndpoint  string `mapstructure:"endpoint"`
	ESTimeout   string `mapstructure:"timeout"`
	ESBackoff   int    `mapstructure:"backoff"`
	ESIndexName string `mapstructure:"index_name"`
	// contains filtered or unexported fields
}
    Config holds the necessary configuration for setting up an elasticsearch reader endpoint.
func FromViper ¶
FromViper constructs the necessary configuration for bootstrapping the elasticsearch reader
func NewConfig ¶
func NewConfig(log logrus.FieldLogger, name string, endpoint string, timeout time.Duration, backoff int, indexName string) (*Config, error)
NewConfig returns errors coming from Viper
func (*Config) NewInstance ¶
func (c *Config) NewInstance(ctx context.Context, payloadChan chan *recorder.RecordJob, errorChan chan<- communication.ErrorMessage) (recorder.DataRecorder, error)
NewInstance returns an instance of the elasticsearch recorder
type Recorder ¶
type Recorder struct {
	// contains filtered or unexported fields
}
    Recorder contains an elasticsearch client and an index name for recording data It implements DataRecorder interface
func NewRecorder ¶
func NewRecorder( ctx context.Context, log logrus.FieldLogger, payloadChan chan *recorder.RecordJob, errorChan chan<- communication.ErrorMessage, name, endpoint, indexName string, timeout time.Duration, ) (*Recorder, error)
NewRecorder returns an error if it can't create the index
func (*Recorder) PayloadChan ¶
PayloadChan returns the channel it receives the information from
func (*Recorder) Start ¶
func (r *Recorder) Start(ctx context.Context, stop communication.StopChannel)
Start begins reading from the target in its own goroutine It will close the done channel when the job channel is closed