ingestjob

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

View Source
const (
	InProgress = "inprogress"
	Failed     = "failed"
	Done       = "done"
)

Variables

This section is empty.

Functions

func CreateMustTerms

func CreateMustTerms(log *Log) []map[string]interface{}

Types

type ESLogProvider

type ESLogProvider interface {
	CreateDocument(index, documentID string, body []byte) ([]byte, error)
	Get(index string, query map[string]interface{}, result interface{}) error
	UpdateDocument(index string, id string, body interface{}) ([]byte, error)
	Count(index string, query map[string]interface{}) (int, error)
}

ESLogProvider used in connecting to ES logging server

type Hits

type Hits struct {
	Hits []NestedHits `json:"hits"`
}

Hits result

type Log

type Log struct {
	Connector     string              `json:"connector"`
	Configuration []map[string]string `json:"configuration"`
	Status        string              `json:"status"`
	CreatedAt     time.Time           `json:"created_at"`
	UpdatedAt     time.Time           `json:"updated_at"`
	Message       string              `json:"message"`
	From          *time.Time          `json:"from,omitempty"`
	To            *time.Time          `json:"to,omitempty"`
}

Log ...

type Logger

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

Logger ...

func NewLogger

func NewLogger(esClient ESLogProvider, environment string) (*Logger, error)

NewLogger ...

func (*Logger) Count

func (s *Logger) Count(connector string, status string) (int, error)

func (*Logger) Filter

func (s *Logger) Filter(log *Log) ([]Log, error)

Filter connector logs based on status, configuration and creation date

func (*Logger) Read

func (s *Logger) Read(connector string, status string) ([]Log, error)

Read ...

func (*Logger) Write

func (s *Logger) Write(log *Log) error

Write ...

type NestedHits

type NestedHits struct {
	ID     string `json:"_id"`
	Source Log    `json:"_source"`
}

NestedHits is the actual hit data

type TopHits

type TopHits struct {
	Hits Hits `json:"hits"`
}

TopHits result

Jump to

Keyboard shortcuts

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