loki

package
v1.23.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ResultTypeVector = "vector"
	ResultTypeMatrix = "matrix"
)

Variables

This section is empty.

Functions

func Exist

func Exist(eles []interface{}, ele interface{}) bool

func FileExists

func FileExists(path string) bool

func GenerateLevelRegex

func GenerateLevelRegex(level string) string

func GetExpr

func GetExpr(label string, value string) string

func GetLogLevelExpr

func GetLogLevelExpr(level string) string

func GetShellColor

func GetShellColor(colorNo string) string

func InitSplitDateTime

func InitSplitDateTime(limit int) map[string][]int

func LogLevel

func LogLevel(message string) string

func RegexHighlightShow

func RegexHighlightShow(message string, filter string) string

func ShellHighlightShow

func ShellHighlightShow(message string) string

func SplitDateTime

func SplitDateTime(start string, end string, limit int) ([]int, int)

func TimeInPart

func TimeInPart(splitDateTime []int, timestamp string, step int) int

Types

type Info

type Info struct {
	Animation    string `json:"animation"`
	Level        string `json:"level"`
	Message      string `json:"message"`
	Timestamp    string `json:"timestamp"`
	Timestampstr string `json:"timestampstr"`
	Index        string `json:"index"`
}

type LabelParam

type LabelParam struct {
	Start string `form:"start" json:"start,omitempty"`
	End   string `form:"end" json:"end,omitempty"`
	Label string `form:"label" json:"label,omitempty"`
}

func (*LabelParam) ToMap

func (l *LabelParam) ToMap() map[string]string

type LabelResponse

type LabelResponse struct {
	Status string   `json:"status"`
	Data   []string `json:"data,omitempty"`
}

type LokiMessage

type LokiMessage struct {
	Timestamp string
	Message   string
}

type LokiMessages

type LokiMessages []LokiMessage

func (LokiMessages) Len

func (msg LokiMessages) Len() int

func (LokiMessages) Less

func (msg LokiMessages) Less(i, j int) bool

func (LokiMessages) Swap

func (msg LokiMessages) Swap(i, j int)

type LokiPromeRuleResp

type LokiPromeRuleResp struct {
	Status    string         `json:"status"`
	Data      v1.RulesResult `json:"data"`
	ErrorType v1.ErrorType   `json:"errorType"`
	Error     string         `json:"error"`
	Warnings  []string       `json:"warnings,omitempty"`
}

type Matrix

type Matrix []SampleStream

type QueryRangeParam

type QueryRangeParam struct {
	Start     string `form:"start" json:"start,omitempty"`
	End       string `form:"end" json:"end,omitempty"`
	Step      string `form:"step" json:"step,omitempty"`
	Interval  string `form:"interval" json:"interval,omitempty"`
	Query     string `form:"query" json:"query,omitempty"`
	Direction string `form:"direction" json:"direction,omitempty"`
	Limit     string `form:"limit" json:"limit,omitempty"`
}

func (*QueryRangeParam) ToMap

func (q *QueryRangeParam) ToMap() map[string]string

type QueryResponse

type QueryResponse struct {
	Status string            `json:"status"`
	Data   QueryResponseData `json:"data"`
}

QueryResponse represents the http json response to a Loki range and instant query

type QueryResponseData

type QueryResponseData struct {
	ResultType string        `json:"resultType"`
	Result     []interface{} `json:"result"`
}

type QueryResult

type QueryResult struct {
	Info   Info              `json:"info"`
	Stream map[string]string `json:"stream"`
}

type SampleStream

type SampleStream struct {
	Metric map[string]string `json:"metric"`
	Values [][]interface{}   `json:"values"`
}

func (*SampleStream) ToStruct

func (q *SampleStream) ToStruct(m map[string]interface{}) SampleStream

type SeriesForm

type SeriesForm struct {
	Match string `form:"match" json:"match,omitempty"`
	End   string `form:"end" json:"end,omitempty"`
	Start string `form:"start" json:"start,omitempty"`
	Label string `form:"label" json:"label,omitempty"`
}

func (*SeriesForm) ToMap

func (l *SeriesForm) ToMap() map[string]string

type SeriesResponse

type SeriesResponse struct {
	Status string      `json:"status"`
	Data   interface{} `json:"data,omitempty"`
}

type Stream

type Stream struct {
	Labels  map[string]string `json:"stream"`
	Entries [][]string        `json:"values"`
}

func (*Stream) ToStruct

func (q *Stream) ToStruct(m map[string]interface{}) Stream

type Streams

type Streams []Stream

type TailParam

type TailParam struct {
	Start     string `form:"start" json:"start,omitempty" header:"start"`
	Query     string `form:"query" json:"query,omitempty" header:"query"`
	Limit     string `form:"limit" json:"limit,omitempty" header:"limit"`
	Delay_For string `form:"delay_for"  json:"delay_for,omitempty" header:"delay_for"`
	Level     string `form:"level" json:"level,omitempty" header:"level"`
	Filter    string `form:"filter" json:"filter,omitempty" header:"filter"`
}

func (*TailParam) ToMap

func (q *TailParam) ToMap() map[string]string

Jump to

Keyboard shortcuts

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