logs

package
v0.0.0-...-9b02830 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogWorkQueue chan chan LogWorkRequest
View Source
var LoggingRemoveOld = map[string]interface{}{
	"Oracle":  providers.RemoveOldLogsOracle,
	"Elastic": providers.RemoveOldLogsElastic,
}
View Source
var LoggingType = map[string]interface{}{
	"Rabbit":  PublishRabbit,
	"Elastic": providers.PublishElastic,
	"Oracle":  providers.PublishOracle}
View Source
var WorkQueue = make(chan LogWorkRequest, 1000)

Functions

func NewRequestLogging

func NewRequestLogging(c *fasthttp.RequestCtx, queryArgs []byte, headers []byte, currentDate string, elapsedTime int64, serviceName string, indexName string) models.RequestLogging

func PublishLog

func PublishLog(reqLogging *models.RequestLogging)

func PublishRabbit

func PublishRabbit(reqLogging *models.RequestLogging)

func StartDispatcher

func StartDispatcher(nworkers int)

Types

type LogWorkRequest

type LogWorkRequest struct {
	Name      string
	LogToSave models.RequestLogging
}

type Worker

type Worker struct {
	ID          int
	Work        chan LogWorkRequest
	WorkerQueue chan chan LogWorkRequest
	QuitChan    chan bool
}

func NewWorker

func NewWorker(id int, workerQueue chan chan LogWorkRequest) Worker

NewWorker creates, and returns a new Worker object. Its only argument is a channel that the worker can add itself to whenever it is done its work.

func (*Worker) Start

func (w *Worker) Start()

This function "starts" the worker by starting a goroutine, that is an infinite "for-select" loop.

func (*Worker) Stop

func (w *Worker) Stop()

Stop tells the worker to stop listening for work requests.

Note that the worker will only stop *after* it has finished its work.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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