logs

package
v0.0.0-...-d8099e1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const LogsMappings = `` /* 14449-byte string literal not displayed */

LogsMappings mappings for .logs indices

Variables

This section is empty.

Functions

func Recorder

func Recorder() middleware.Middleware

Recorder records a log "record" for every request.

Types

type LogError

type LogError struct {
	Err  error
	Code int
}

type Logs

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

Logs plugin records an elasticsearch request and its response.

func Instance

func Instance() *Logs

Instance returns the singleton instance of Logs plugin. Note: Only this function must be used (both within and outside the package) to obtain the instance Logs in order to avoid stateless instances of the plugin.

func (*Logs) ESMiddleware

func (l *Logs) ESMiddleware() []middleware.Middleware

Default empty middleware array function

func (*Logs) InitFunc

func (l *Logs) InitFunc() error

InitFunc is a part of Plugin interface that gets executed only once, and initializes the dao, i.e. elasticsearch before the plugin is operational.

func (*Logs) Lumberjack

func (l *Logs) Lumberjack() lumberjack.Logger

Get the Lumberjack logger

func (*Logs) Name

func (l *Logs) Name() string

Name returns the name of the plugin: "logs"

func (*Logs) RSMiddleware

func (a *Logs) RSMiddleware() []middleware.Middleware

Default empty middleware array function

func (*Logs) Routes

func (l *Logs) Routes() []plugins.Route

Routes returns an empty slice of routes, since Logs is solely a middleware.

type NormalizedQueryParams

type NormalizedQueryParams struct {
	StartDate string
	EndDate   string
	Size      int
}

NormalizedQueryParams represents the normalized query parameters

func RangeQueryParams

func RangeQueryParams(values url.Values) NormalizedQueryParams

RangeQueryParams returns the common query params that every analytics endpoint expects, - "start_date": start of the duration in consideration - "end_date" : end of the duration in consideration - "size": no. of response entries

type Query

type Query struct {
	Type string `json:"type"`
}

type RSAPI

type RSAPI struct {
	Query []Query `json:"query"`
}

type RSSettings

type RSSettings struct {
	Took float64 `json:"took"`
}

RSSettings represents the settings object in RS API response

type Request

type Request struct {
	URI     string              `json:"uri"`
	Method  string              `json:"method"`
	Headers map[string][]string `json:"header"`
	Body    string              `json:"body"`
}

type RequestChange

type RequestChange struct {
	Before requestlogs.LogsResults
	After  requestlogs.LogsResults
}

type Response

type Response struct {
	Code    int    `json:"code"`
	Status  string `json:"status"`
	Headers map[string][]string
	Took    *float64 `json:"took,omitempty"`
	Body    string   `json:"body"`
}

type ResponseBodyRS

type ResponseBodyRS struct {
	Settings RSSettings `json:"settings"`
}

ResponseBodyRS represents the response body returned by reactivesearch route

type SearchResponseBody

type SearchResponseBody struct {
	Took float64 `json:"took"`
}

SearchResponseBody represents the response body returned by search

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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