Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LogWorkQueue chan chan LogWorkRequest
View Source
var LoggingType = map[string]interface{}{ "Rabbit": PublishRabbit, "Elastic": PublishElastic}
View Source
var WorkQueue = make(chan LogWorkRequest, 1000)
Functions ¶
func PublishElastic ¶
func PublishElastic(reqLogging *RequestLogging)
func PublishLog ¶
func PublishLog(reqLogging *RequestLogging)
func PublishRabbit ¶
func PublishRabbit(reqLogging *RequestLogging)
func StartDispatcher ¶
func StartDispatcher(nworkers int)
Types ¶
type LogWorkRequest ¶
type LogWorkRequest struct {
Name string
LogToSave RequestLogging
}
type RequestLogging ¶
type RequestLogging struct {
Method string
Uri string
RequestBody string
Host string
UserAgent string
RemoteAddr string
RemoteIp string
Headers string
QueryArgs string
DateTime string
Response string
ElapsedTime int64
StatusCode int
ServiceName string
IndexName string
}
func NewRequestLogging ¶
func NewRequestLogging(c *fasthttp.RequestCtx, queryArgs []byte, headers []byte, currentDate string, elapsedTime int64, serviceName string, indexName string) RequestLogging
func (*RequestLogging) Save ¶
func (reqLogging *RequestLogging) Save()
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.
Click to show internal directories.
Click to hide internal directories.