tencentcls

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LEVELS = map[string]zapcore.Level{
	"panic":  zapcore.PanicLevel,
	"dpanic": zapcore.DPanicLevel,
	"error":  zapcore.ErrorLevel,
	"warn":   zapcore.WarnLevel,
	"info":   zapcore.InfoLevel,
	"debug":  zapcore.DebugLevel,
}

Functions

This section is empty.

Types

type Callback

type Callback struct{}

func (*Callback) Fail

func (cb *Callback) Fail(rs *cls.Result)

func (*Callback) Success

func (cb *Callback) Success(rs *cls.Result)

type Option

type Option func(*Sink)

func WithHostSource

func WithHostSource() Option

Aliyun SLS source field

func WithLogLevel

func WithLogLevel(l string) Option

WithLogLevel: "debug" "info", "warn", "error"

func WithProject

func WithProject(project, logstore, source string) Option

Aliyun SLS setups

type Sink

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

func New

func New(_url string, opts ...Option) (*Sink, error)

func (*Sink) Close

func (s *Sink) Close()

func (*Sink) GetProducer

func (s *Sink) GetProducer() *cls.AsyncProducerClient

func (*Sink) Open

func (s *Sink) Open()

func (*Sink) Write

func (s *Sink) Write(ent zapcore.Entry, fields []zapcore.Field)

type URL

type URL struct {
	Endpoint        string
	AccessKeyID     string
	AccessKeySecret string
	Project         string
	LogStore        string
}

func ParseURL

func ParseURL(_url string) (*URL, error)

ParseUrl parse the url of tencentcls url format: tencent+cls://accessKeyId:accessKeySecret@endpoint/projectId/logstore

Jump to

Keyboard shortcuts

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