logs

package
v1.2.28 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogQuery

func NewLogQuery(c *conf.LogQuery) (datasource.LogDatasource, error)

NewLogQuery creates a new log query based on the configuration.

Types

type AliYunLog

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

func NewAliYunLog

func NewAliYunLog(c mlog.AliyunLogConfig, opt ...AliYunLogOption) *AliYunLog

NewAliYunLog 创建阿里云日志对象

func (*AliYunLog) Check

func (l *AliYunLog) Check(ctx context.Context) error

func (*AliYunLog) QueryLogs

func (l *AliYunLog) QueryLogs(_ context.Context, expr string, start, end int64) (*datasource.LogResponse, error)

type AliYunLogOption

type AliYunLogOption func(l *AliYunLog)

AliYunLogOption is a functional option for AliYunLogOption.

func WithAliYunEndpoint

func WithAliYunEndpoint(endpoint string) AliYunLogOption

WithAliYunEndpoint sets the aliYun endpoint.

type BasicAuth

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

BasicAuth 基础认证信息

type Elasticsearch

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

Elasticsearch es日志存储

func NewElasticsearch

func NewElasticsearch(c *conf.Elasticsearch, opt ...EsOption) (*Elasticsearch, error)

func (*Elasticsearch) Check

func (e *Elasticsearch) Check(_ context.Context) error

func (*Elasticsearch) QueryLogs

func (e *Elasticsearch) QueryLogs(ctx context.Context, expr string, _, _ int64) (*datasource.LogResponse, error)

type EsOption

type EsOption func(e *Elasticsearch)

EsOption Elasticsearch option

func WithEsEndpoint

func WithEsEndpoint(endpoint string) EsOption

WithEsEndpoint sets the es endpoint.

type LokiOption

type LokiOption func(l *LokiQuery)

LokiOption is a functional option for LokiQuery.

func WithLokiBasicAuth

func WithLokiBasicAuth(username, password string) LokiOption

WithLokiBasicAuth sets the Loki basic auth.

func WithLokiDirection

func WithLokiDirection(direction string) LokiOption

WithLokiDirection sets the Loki query direction.

func WithLokiEndpoint

func WithLokiEndpoint(endpoint string) LokiOption

WithLokiEndpoint sets the Loki endpoint.

func WithLokiLimit

func WithLokiLimit(limit int64) LokiOption

WithLokiLimit sets the Loki query limit.

type LokiQuery

type LokiQuery struct {

	// 日志排序顺序,支持的值为forward或backward,默认为backward
	Direction string
	// 要返回的最大条目数
	Limit int64
	// contains filtered or unexported fields
}

LokiQuery is a log query implementation for Loki.

func NewLokiDatasource

func NewLokiDatasource(opt ...LokiOption) *LokiQuery

NewLokiDatasource sets the Loki endpoint.

func (*LokiQuery) Check

func (l *LokiQuery) Check(ctx context.Context) error

func (*LokiQuery) QueryLogs

func (l *LokiQuery) QueryLogs(ctx context.Context, expr string, start, end int64) (*datasource.LogResponse, error)

Jump to

Keyboard shortcuts

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