utils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Elilogger *zap.SugaredLogger

Elilogger is the logging instance

Functions

func Configure

func Configure() elasticsearch.Config

Configure returns an elasticsearch.Config

func Connect

func Connect() (*elasticsearch.Client, error)

Connect takes a config generated by utils.Configure and returns an elasticsearch client and error

func Debug

func Debug(debugString string)

Debug returns a debug message to the logger

func Error

func Error(errString string, err error) error

Error returns an error message to the logger and terminates

func Fatal

func Fatal(errString string, err error)

Fatal returns a fatal msg to the logger and terminates

func HandleResponse

func HandleResponse(resp []byte) ([]map[string]string, error)

HandleResponse handles esapi responses for everything except search

func HandleSearchResponse

func HandleSearchResponse(resp []byte) (models.SearchResponse, error)

HandleSearchResponse handles responses for searches

func Info

func Info(infoString string)

Info returns an info msg to the logger is info or debug

func InitLogger

func InitLogger()

InitLogger initializes the zap logger for use

func LogRequest

func LogRequest(r []byte)

LogRequest takes an esapi response and logs it

func Warn

func Warn(warnString string)

Warn returns a warning msg to the logger

Types

This section is empty.

Jump to

Keyboard shortcuts

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