tencentcloud_cls_sdk_go

package module
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 36 Imported by: 48

README

Tencent CLS Log SDK for Go

Go Reference License Go Version

English | 简体中文

The official Go SDK for Tencent Cloud Log Service (CLS), providing log upload and log consumption capabilities out of the box.


Table of Contents


Features

  • Log Upload: async / sync producer, batching & aggregation, retry, callbacks, multiple compression codecs (lz4 / zstd / deflate).
  • Log Consumption: consumer group based multi-partition concurrent consumption, automatic offset persistence and resume-from-checkpoint.
  • Auth: supports both permanent credentials (AccessKeyID + AccessKeySecret) and temporary credentials (AccessToken); also supports anonymous (Uin only) upload.
  • Endpoint: automatic endpoint composition by Region + NetworkType.
  • Resilience: exponential backoff retry on retryable errors (429 / 5xx); fast-fail on 4xx client errors.
  • High Throughput: fully leverages Go's concurrency; a single instance can sustain high ingestion QPS.

Installation

Requires Go 1.17+.

go get github.com/tencentcloud/tencentcloud-cls-sdk-go

Quick Start

package main

import (
    "fmt"
    "sync"
    "time"

    cls "github.com/tencentcloud/tencentcloud-cls-sdk-go"
)

func main() {
    cfg := cls.GetDefaultAsyncProducerClientConfig()
    cfg.Endpoint = "ap-guangzhou.cls.tencentcs.com"
    cfg.AccessKeyID = "<YourSecretID>"
    cfg.AccessKeySecret = "<YourSecretKey>"

    topicID := "<YourTopicID>"

    producer, err := cls.NewAsyncProducerClient(cfg)
    if err != nil {
        panic(err)
    }
    producer.Start()

    var wg sync.WaitGroup
    cb := &Callback{}
    for i := 0; i < 10; i++ {
        wg.Add(1)
        go func() {
            defer wg.Done()
            for j := 0; j < 1000; j++ {
                log := cls.NewCLSLog(time.Now().Unix(), map[string]string{
                    "content":  "hello world",
                    "content2": fmt.Sprintf("%d", j),
                })
                if err := producer.SendLog(topicID, log, cb); err != nil {
                    fmt.Println(err)
                }
            }
        }()
    }
    wg.Wait()
    _ = producer.Close(60000)
}

type Callback struct{}

func (c *Callback) Success(r *cls.Result) {
    for _, a := range r.GetReservedAttempts() {
        fmt.Printf("%+v\n", a)
    }
}

func (c *Callback) Fail(r *cls.Result) {
    fmt.Println(r.IsSuccessful(), r.GetErrorCode(), r.GetErrorMessage(), r.GetRequestId())
}

Endpoints & Regions

You may either fill Endpoint directly or use SetEndpointByRegionAndNetworkType(region, networkType) to compose it automatically.

cfg := cls.GetDefaultSyncProducerClientConfig()
cfg.SetEndpointByRegionAndNetworkType(cls.Shanghai, cls.Intranet)
// or
cfg.Endpoint = "ap-guangzhou.cls.tencentcs.com"

Network types

Constant Value Description
cls.Intranet cls.tencentyun.com Private network (VPC)
cls.Extranet cls.tencentcs.com Public Internet

Supported regions (see Available Regions for the latest list):

Beijing, Guangzhou, Shanghai, Chengdu, Nanjing, Chongqing, Hongkong, Siliconvalley, Ashburn, Singapore, Bangkok, Frankfurt, Tokyo, Seoul, Jakarta, Saopaulo, ShenzhenFSI, ShanghaiFSI, BeijingFSI, ShanghaiADC.

The Region / NetworkType types are string aliases — you can freely define your own values when needed.

Authentication

Strong Auth (API Key)

Get your AccessKeyID / AccessKeySecret from the CAM console. Make sure the credential owner has the permission to upload logs via API/SDK.

cfg.AccessKeyID     = "<YourSecretID>"
cfg.AccessKeySecret = "<YourSecretKey>"
// Optional: use a temporary security token (STS)
cfg.AccessToken     = "<YourSecurityToken>"
Weak Auth (Anonymous / Uin only)

Besides API keys, the SDK also supports anonymous upload using only the account Uin — no AccessKeyID / AccessKeySecret is required.

Prerequisite: the target topic MUST have Anonymous Upload → API/SDK log upload enabled, otherwise the server responds 401 Unauthorized.

Uin and AccessKeyID + AccessKeySecret are mutually exclusive but one is required; creating a client with neither returns an error.

// Async producer
cfg := cls.GetDefaultAsyncProducerClientConfig()
cfg.Endpoint = "ap-guangzhou.cls.tencentcs.com"
cfg.Uin      = "100012345678" // account Uin

// Sync producer
scfg := cls.GetDefaultSyncProducerClientConfig()
scfg.Endpoint = "ap-guangzhou.cls.tencentcs.com"
scfg.Uin      = "100012345678"

Auth mode is inferred from credentials:

AccessKeyID + AccessKeySecret Uin Auth Mode
✅ ❌ Strong (Cloud API signature)
❌ ✅ Weak (anonymous)
✅ ✅ Strong; Uin is ignored
❌ ❌ MissAccessKeyId error at client creation

Additional rules:

  • Uin must be a digits-only string, otherwise InvalidUin is returned.
  • AK/SK take precedence — if both are set, strong auth is used so the security level is never silently downgraded.
  • ResetSecretToken() is a no-op in weak-auth mode (a warn log is printed).

⚠️ Security notice

  • Weak auth is for log upload only; log consumption (consumer) still requires AK/SK.
  • Weak auth only guarantees transport tamper-resistance; it does NOT authenticate the caller identity. The security level is equivalent to anonymous write. Use it only in trusted network environments.
Refreshing Temporary Credentials

When using STS temporary credentials, call ResetSecretToken before the token expires:

// Async producer
err := producer.Client.ResetSecretToken(newSecretID, newSecretKey, newSecurityToken)

// Sync producer
err := syncClient.ResetSecretToken(newSecretID, newSecretKey, newSecurityToken)

Producer

Async Producer

The async producer buffers logs in memory, aggregates them into batches and dispatches them via a worker pool. It returns immediately from SendLog / SendLogList and delivers success/failure via a user-defined CallBack.

Why use the async producer?

  • Non-blocking send with per-log callbacks.
  • Graceful shutdown: Close(timeoutMs) flushes buffered data before returning.
  • Per-log observability: implement your own CallBack.Success / CallBack.Fail.
  • Simple config: one struct configures batching, retry, timeouts and more.
  • Auto retry: retries on 429 / 5xx errors with exponential backoff.
  • High throughput: engineered on top of goroutines.

Basic lifecycle:

producer, err := cls.NewAsyncProducerClient(cfg)
if err != nil { /* ... */ }
producer.Start()                 // start background workers
_ = producer.SendLog(topicID, log, callback)
_ = producer.SendLogList(topicID, logs, callback)
_ = producer.Close(60_000)       // wait up to 60s for graceful drain
Sync Producer

The sync producer sends logs immediately in the calling goroutine. Choose it when you need back-pressure or strict per-call semantics.

cfg := cls.GetDefaultSyncProducerClientConfig()
cfg.SetEndpointByRegionAndNetworkType(cls.Guangzhou, cls.Extranet)
cfg.AccessKeyID     = "<YourSecretID>"
cfg.AccessKeySecret = "<YourSecretKey>"
cfg.CompressType    = "zstd"

client, err := cls.NewSyncProducerClient(cfg)
if err != nil { /* ... */ }

logs := make([]*cls.Log, 0, 100)
for i := 0; i < 100; i++ {
    logs = append(logs, cls.NewCLSLog(time.Now().Unix(),
        map[string]string{"number": fmt.Sprint(i)}))
}

ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()

if err := client.SendLogList(ctx, topicID, logs); err != nil {
    log.Fatal(err)
}

Server-side constraints enforced by the sync producer: a single request must not exceed 5 MB and 10 000 log entries.

Async Producer Config Reference
Field Type Default Description
Endpoint string — CLS endpoint host, e.g. ap-guangzhou.cls.tencentcs.com.
AccessKeyID / AccessKeySecret string — Permanent API credentials.
AccessToken string — Optional STS security token.
Uin string — Weak-auth (anonymous) account ID. See Weak Auth.
Source string local IP Log source field written into LogGroup.Source.
HostName string — Optional hostname written into LogGroup.Hostname.
CompressType string lz4 lz4 or zstd.
Timeout int (ms) 10000 HTTP request timeout.
IdleConn int 50 Max idle connections per host.
TotalSizeLnBytes int64 100 MB Max in-memory buffered bytes.
MaxSendWorkerCount int64 50 Max concurrent send goroutines.
MaxBlockSec int 60 Max seconds SendLog blocks when the buffer is full. 0 = fail immediately; negative = block forever.
MaxBatchSize int64 512 KB Batch flush threshold (bytes). Max 5 MB.
MaxBatchCount int 4096 Batch flush threshold (entries). Max 40960.
LingerMs int64 2000 Max time a batch may linger before being flushed (min 100).
Retries int 10 Retry attempts on retryable errors. <=0 disables retry.
MaxReservedAttempts int 11 Max attempt records returned to the callback.
BaseRetryBackoffMs int64 100 Base backoff for the first retry (exponential: base * 2^(N-1)).
MaxRetryBackoffMs int64 50000 Retry backoff upper bound.

The sync producer only uses the subset relevant to per-call sending: Endpoint, AccessKeyID/Secret/Token, Uin, Timeout, IdleConn, CompressType, NeedSource, HostName.

Consumer

The consumer sub-package provides a full-featured consumer-group implementation:

  • Consumer group management: auto-create if missing, reuse otherwise.
  • Heartbeat & partition assignment: dynamic rebalance via PartitionStrategy=2; scale out horizontally.
  • Multi-partition concurrency: each partition has its own goroutine that fetches logs and serially invokes your Processor.
  • Offset persistence: advanced on fetch, flushed every 60 s, flushed after 30 s idle, force-flushed on exit — resume-from-checkpoint is transparent.
  • Server-side DSL pre-filter: set ConsumerOption.Query to a DSL expression so only matching logs are delivered, saving bandwidth and CPU. Example: log_keep(op_and(op_gt(v("status"), 400), str_exist(v("message"), "access failed"))).
  • Bounded consumption: with OffsetEndTime set, the worker auto-exits when all partitions catch up.
  • Graceful degradation: InvalidOffset auto-recovers to the latest offset; heartbeat timeout triggers reassignment; a panicking Process does not stall the pipeline.

Minimal usage: implement the Processor interface → build a ConsumerOption → consumer.NewConsumerWorkerWithOption(option, processor) (returns an error, check it before calling Run(ctx)).

consumer.NewConsumerWorker is deprecated: it swallows the error raised while building the underlying cloud API client (e.g. empty AccessKeyID / AccessKey). Use consumer.NewConsumerWorkerWithOption instead. Likewise cls.NewYunApiLogClient / NewYunApiLogClientWithConfig / NewYunApiLogClientSimple are deprecated in favor of cls.NewYunApiLogClientFromConfig.

For detailed configuration, concurrency model, error handling, FAQ and a runnable example (consumer/demo/consumer_demo.go), see consumer/README.md.

Compression

CompressType Header x-cls-compress-type Notes
lz4 (default) lz4 Default when CompressType is empty.
zstd zstd Better compression ratio, slightly more CPU.

Set it via cfg.CompressType = "zstd".

Regenerate Protobuf

If you modified cls.proto, regenerate the Go stub:

protoc --gofast_out=. cls.proto

License

Distributed under the Apache License 2.0.

Documentation

Index

Constants

View Source
const BAD_REQUEST = "BadRequest"
View Source
const CompressionLevelDefault = -1000
View Source
const INTERNAL_SERVER_ERROR = "InternalError"
View Source
const INVALID_UIN = "InvalidUin"
View Source
const MISSING_HOST = "MissingHost"
View Source
const MISS_ACCESS_KEY_ID = "MissAccessKeyId"
View Source
const MISS_ACCESS_SECRET = "MissAccessKeyId"
View Source
const MISS_ACCESS_TOKEN = "MissAccessKeyId"
View Source
const (
	// MaxLogSize is the maximum size of batch logs.
	MaxLogSize = 20 * 1024 * 1024
)
View Source
const UNKNOWN_ERROR = "UnknownError"
View Source
const WRITE_QUOTA_EXCEED = "WriteQuotaExceed"

Variables

View Source
var (
	ErrInvalidLengthCls        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCls          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCls = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// ErrLogSizeExceeded is returned when the total size of logs exceeds 20M.
	ErrLogSizeExceeded = errors.New("logs must be less than 20M")
)

Errors returned by SyncProducerClient send methods. Callers can use

Functions

func DeflateCompress added in v1.0.13

func DeflateCompress(data []byte) ([]byte, error)

DeflateCompress ...

func GenerateProducerHash added in v1.0.7

func GenerateProducerHash(instanceID string) string

GenerateProducerHash ...

func GetLocalIP

func GetLocalIP() (string, error)

GetLocalIP get local IP with string format

func GetLogListSize

func GetLogListSize(logList []*Log) (int, error)

func GetLogSizeCalculate

func GetLogSizeCalculate(log *Log) (int, error)

func GetTimeMs

func GetTimeMs(t int64) int64

func NewCLSClient

func NewCLSClient(options *Options) (*CLSClient, *CLSError)

func SetUserAgent added in v1.0.9

func SetUserAgent(agent string)

SetUserAgent ...

func SetVersion added in v1.0.9

func SetVersion(ver string)

SetVersion ...

func SignatureWithTC3 added in v1.0.15

func SignatureWithTC3(secretID, secretKey, service, method, path string, queryString string, headers map[string]string, payload []byte, timestamp int64) (string, error)

SignatureWithTC3 generates TC3-HMAC-SHA256 signature

func ZSTDCompress added in v1.0.2

func ZSTDCompress(params ZstdEncoderParams, dst, src []byte) ([]byte, error)

func ZSTDDecompress added in v1.0.2

func ZSTDDecompress(params ZstdDecoderParams, dst, src []byte) ([]byte, error)

Types

type APIError added in v1.0.15

type APIError struct {
	Code    string `json:"Code"`
	Message string `json:"Message"`
}

type Accumulator

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

func NewAccumulator

func NewAccumulator(config *AsyncProducerClientConfig, worker *Worker, threadPool *SendThreadPool, producer *AsyncProducerClient) *Accumulator

NewAccumulator ...

type AsyncProducerClient

type AsyncProducerClient struct {
	Client *CLSClient
	// contains filtered or unexported fields
}

AsyncProducerClient async producer client

func NewAsyncProducerClient

func NewAsyncProducerClient(asyncProducerClientConfig *AsyncProducerClientConfig) (*AsyncProducerClient, error)

NewAsyncProducerClient 初始化Async Producer Client

func (*AsyncProducerClient) Close

func (producer *AsyncProducerClient) Close(timeoutMs int64) error

func (*AsyncProducerClient) SendLog

func (producer *AsyncProducerClient) SendLog(topicId string, log *Log, callback CallBack) error

func (*AsyncProducerClient) SendLogList

func (producer *AsyncProducerClient) SendLogList(topicId string, logList []*Log, callback CallBack) (err error)

func (*AsyncProducerClient) Start

func (producer *AsyncProducerClient) Start()

type AsyncProducerClientConfig

type AsyncProducerClientConfig struct {
	TotalSizeLnBytes    int64
	MaxSendWorkerCount  int64
	MaxBlockSec         int
	MaxBatchSize        int64
	MaxBatchCount       int
	LingerMs            int64
	Retries             int
	MaxReservedAttempts int
	BaseRetryBackoffMs  int64
	MaxRetryBackoffMs   int64
	Endpoint            string

	AccessKeyID     string
	AccessKeySecret string
	AccessToken     string
	// Uin 弱鉴权(免密)账号 ID,与 AccessKeyID/AccessKeySecret 二选一填写。
	// 两者同时填写时以 AccessKeyID/AccessKeySecret 为准(走强鉴权),Uin 被忽略。
	Uin          string
	Source       string
	Timeout      int
	IdleConn     int
	CompressType string
	HostName     string
	// contains filtered or unexported fields
}

AsyncProducerClientConfig Producer Config

func GetDefaultAsyncProducerClientConfig

func GetDefaultAsyncProducerClientConfig() *AsyncProducerClientConfig

GetDefaultAsyncProducerClientConfig 获取默认的Producer Config

func (*AsyncProducerClientConfig) SetEndpointByRegionAndNetworkType added in v1.0.12

func (config *AsyncProducerClientConfig) SetEndpointByRegionAndNetworkType(region Region, networkType NetworkType)

SetEndpointByRegionAndNetworkType 根据地域和网络类型设置域名

type Attempt

type Attempt struct {
	Success      bool
	RequestId    string
	ErrorCode    string
	ErrorMessage string
	TimeStampMs  int64
}

func NewAttempt

func NewAttempt(success bool, requestId, errorCode, errorMessage string, timeStampMs int64) *Attempt

NewAttempt init attempt

type CLSClient

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

func (*CLSClient) ResetSecretToken

func (client *CLSClient) ResetSecretToken(secretID string, secretKEY string, secretToken string) *CLSError

func (*CLSClient) Send

func (client *CLSClient) Send(ctx context.Context, topicId string, group ...*LogGroup) *CLSError

Send cls实际发送接口

type CLSError

type CLSError struct {
	HTTPCode  int32  `json:"httpCode"`
	Code      string `json:"errorCode"`
	Message   string `json:"errorMessage"`
	RequestID string `json:"requestID"`
}

Error defines sls error

func NewError

func NewError(httpCode int32, requestID, errorCode string, err error) *CLSError

NewClientError new client error

func (CLSError) Error

func (e CLSError) Error() string

func (CLSError) String

func (e CLSError) String() string

type CallBack

type CallBack interface {
	Success(result *Result)
	Fail(result *Result)
}

type ConsumerGroupEntity added in v1.0.15

type ConsumerGroupEntity struct {
	ConsumerGroup string   `json:"ConsumerGroup"`
	Timeout       int      `json:"Timeout"`
	Topics        []string `json:"Topics"`
}

type ConsumerGroupGetOffsetsResponse added in v1.0.15

type ConsumerGroupGetOffsetsResponse struct {
	Response struct {
		ConsumerGroup             string                      `json:"ConsumerGroup"`
		TopicPartitionOffsetsInfo []TopicPartitionOffsetsInfo `json:"TopicPartitionOffsetsInfo"`
		RequestId                 string                      `json:"RequestId"`
		Error                     *APIError                   `json:"Error,omitempty"`
	} `json:"Response"`
}

ConsumerGroupGetOffsetsResponse get offset response

type ConsumerGroupHeartBeatResponse added in v1.0.15

type ConsumerGroupHeartBeatResponse struct {
	Response struct {
		ConsumerGroup       string          `json:"ConsumerGroup,omitempty"`
		TopicPartitionsInfo []PartitionInfo `json:"TopicPartitionsInfo,omitempty"`
		RequestId           string          `json:"RequestId"`
		Error               *APIError       `json:"Error,omitempty"`
	} `json:"Response"`
}

ConsumerGroupHeartBeatResponse heartbeat response

type ConsumerGroupUpdateOffsetsResponse added in v1.0.15

type ConsumerGroupUpdateOffsetsResponse struct {
	Response struct {
		RequestId string    `json:"RequestId"`
		Error     *APIError `json:"Error,omitempty"`
	} `json:"Response"`
}

ConsumerGroupUpdateOffsetsResponse update offset response

type CreateConsumerGroupRequest added in v1.0.15

type CreateConsumerGroupRequest struct {
	ConsumerGroup string   `json:"ConsumerGroup"`
	Timeout       int      `json:"Timeout"`
	Topics        []string `json:"Topics"`
	LogsetId      string   `json:"LogsetId"`
}

CreateConsumerGroupRequest create consumer group request

type CreateConsumerGroupResponse added in v1.0.15

type CreateConsumerGroupResponse struct {
	Response struct {
		RequestId     string    `json:"RequestId"`
		Error         *APIError `json:"Error,omitempty"`
		ConsumerGroup string    `json:"ConsumerGroup,omitempty"`
	} `json:"Response"`
}

type Credentials added in v1.0.6

type Credentials struct {
	SecretID    string
	SecretKEY   string
	SecretToken string
	// Uin 弱鉴权(免密)账号 ID,与 SecretID/SecretKEY 二选一填写。
	// 两者同时填写时以 SecretID/SecretKEY 为准(走强鉴权),Uin 被忽略。
	Uin string
}

type DeleteConsumerGroupRequest added in v1.0.15

type DeleteConsumerGroupRequest struct {
	LogsetId      string `json:"LogsetId"`
	ConsumerGroup string `json:"ConsumerGroup"`
}

DeleteConsumerGroupRequest delete consumer group request

type DeleteConsumerGroupResponse added in v1.0.15

type DeleteConsumerGroupResponse struct {
	Response struct {
		RequestId string    `json:"RequestId"`
		Error     *APIError `json:"Error,omitempty"`
	} `json:"Response"`
}

DeleteConsumerGroupResponse supports capturing all fields

type ErrorMessage

type ErrorMessage struct {
	Code    string `json:"errorcode"`
	Message string `json:"errormessage"`
}

type Field added in v1.0.15

type Field struct {
	Key   string
	Value interface{}
}

type GetOffsetsRequest added in v1.0.15

type GetOffsetsRequest struct {
	ConsumerGroup string `json:"ConsumerGroup"`
	TopicId       string `json:"TopicId"`
	PartitionId   string `json:"PartitionId,omitempty"`
	LogsetId      string `json:"LogsetId"`
	From          string `json:"From,omitempty"`
}

GetOffsetsRequest get offset request body

type HeartbeatRequest added in v1.0.15

type HeartbeatRequest struct {
	ConsumerGroup       string          `json:"ConsumerGroup"`
	Consumer            string          `json:"Consumer"`
	LogsetId            string          `json:"LogsetId"`
	TopicPartitionsInfo []PartitionInfo `json:"TopicPartitionsInfo"`
	PartitionStrategy   int             `json:"PartitionStrategy"`
}

HeartbeatRequest heartbeat request body

type ListConsumerGroupRequest added in v1.0.15

type ListConsumerGroupRequest struct {
	LogsetId string   `json:"LogsetId"`
	Topics   []string `json:"Topics"`
}

ListConsumerGroupRequest list consumer group request

type ListConsumerGroupResponse added in v1.0.15

type ListConsumerGroupResponse struct {
	Response struct {
		ConsumerGroupsInfo []ConsumerGroupEntity `json:"ConsumerGroupsInfo"`
		RequestId          string                `json:"RequestId"`
		Error              *APIError             `json:"Error,omitempty"`
	} `json:"Response"`
}

type Log

type Log struct {
	Time                 *int64         `protobuf:"varint,1,req,name=time" json:"time,omitempty"`
	Contents             []*Log_Content `protobuf:"bytes,2,rep,name=contents" json:"contents,omitempty"`
	CollectTime          *int64         `protobuf:"varint,3,opt,name=collectTime" json:"collectTime,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func NewCLSLog

func NewCLSLog(logTime int64, addLogMap map[string]string) *Log

NewCLSLog ...

func (*Log) Descriptor

func (*Log) Descriptor() ([]byte, []int)

func (*Log) GetCollectTime added in v1.0.8

func (m *Log) GetCollectTime() int64

func (*Log) GetContents

func (m *Log) GetContents() []*Log_Content

func (*Log) GetTime

func (m *Log) GetTime() int64

func (*Log) Marshal

func (m *Log) Marshal() (dAtA []byte, err error)

func (*Log) MarshalTo

func (m *Log) MarshalTo(dAtA []byte) (int, error)

func (*Log) MarshalToSizedBuffer

func (m *Log) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Log) ProtoMessage

func (*Log) ProtoMessage()

func (*Log) Reset

func (m *Log) Reset()

func (*Log) Size

func (m *Log) Size() (n int)

func (*Log) String

func (m *Log) String() string

func (*Log) Unmarshal

func (m *Log) Unmarshal(dAtA []byte) error

func (*Log) XXX_DiscardUnknown

func (m *Log) XXX_DiscardUnknown()

func (*Log) XXX_Marshal

func (m *Log) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Log) XXX_Merge

func (m *Log) XXX_Merge(src proto.Message)

func (*Log) XXX_Size

func (m *Log) XXX_Size() int

func (*Log) XXX_Unmarshal

func (m *Log) XXX_Unmarshal(b []byte) error

type LogGroup

type LogGroup struct {
	Logs                 []*Log    `protobuf:"bytes,1,rep,name=logs" json:"logs,omitempty"`
	ContextFlow          *string   `protobuf:"bytes,2,opt,name=contextFlow" json:"contextFlow,omitempty"`
	Filename             *string   `protobuf:"bytes,3,opt,name=filename" json:"filename,omitempty"`
	Source               *string   `protobuf:"bytes,4,opt,name=source" json:"source,omitempty"`
	LogTags              []*LogTag `protobuf:"bytes,5,rep,name=logTags" json:"logTags,omitempty"`
	Hostname             *string   `protobuf:"bytes,6,opt,name=hostname" json:"hostname,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*LogGroup) Descriptor

func (*LogGroup) Descriptor() ([]byte, []int)

func (*LogGroup) GetContextFlow

func (m *LogGroup) GetContextFlow() string

func (*LogGroup) GetFilename

func (m *LogGroup) GetFilename() string

func (*LogGroup) GetHostname added in v1.0.8

func (m *LogGroup) GetHostname() string

func (*LogGroup) GetLogTags

func (m *LogGroup) GetLogTags() []*LogTag

func (*LogGroup) GetLogs

func (m *LogGroup) GetLogs() []*Log

func (*LogGroup) GetSource

func (m *LogGroup) GetSource() string

func (*LogGroup) Marshal

func (m *LogGroup) Marshal() (dAtA []byte, err error)

func (*LogGroup) MarshalTo

func (m *LogGroup) MarshalTo(dAtA []byte) (int, error)

func (*LogGroup) MarshalToSizedBuffer

func (m *LogGroup) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LogGroup) ProtoMessage

func (*LogGroup) ProtoMessage()

func (*LogGroup) Reset

func (m *LogGroup) Reset()

func (*LogGroup) Size

func (m *LogGroup) Size() (n int)

func (*LogGroup) String

func (m *LogGroup) String() string

func (*LogGroup) Unmarshal

func (m *LogGroup) Unmarshal(dAtA []byte) error

func (*LogGroup) XXX_DiscardUnknown

func (m *LogGroup) XXX_DiscardUnknown()

func (*LogGroup) XXX_Marshal

func (m *LogGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LogGroup) XXX_Merge

func (m *LogGroup) XXX_Merge(src proto.Message)

func (*LogGroup) XXX_Size

func (m *LogGroup) XXX_Size() int

func (*LogGroup) XXX_Unmarshal

func (m *LogGroup) XXX_Unmarshal(b []byte) error

type LogGroupList

type LogGroupList struct {
	LogGroupList         []*LogGroup `protobuf:"bytes,1,rep,name=logGroupList" json:"logGroupList,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*LogGroupList) Descriptor

func (*LogGroupList) Descriptor() ([]byte, []int)

func (*LogGroupList) GetLogGroupList

func (m *LogGroupList) GetLogGroupList() []*LogGroup

func (*LogGroupList) Marshal

func (m *LogGroupList) Marshal() (dAtA []byte, err error)

func (*LogGroupList) MarshalTo

func (m *LogGroupList) MarshalTo(dAtA []byte) (int, error)

func (*LogGroupList) MarshalToSizedBuffer

func (m *LogGroupList) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LogGroupList) ProtoMessage

func (*LogGroupList) ProtoMessage()

func (*LogGroupList) Reset

func (m *LogGroupList) Reset()

func (*LogGroupList) Size

func (m *LogGroupList) Size() (n int)

func (*LogGroupList) String

func (m *LogGroupList) String() string

func (*LogGroupList) Unmarshal

func (m *LogGroupList) Unmarshal(dAtA []byte) error

func (*LogGroupList) XXX_DiscardUnknown

func (m *LogGroupList) XXX_DiscardUnknown()

func (*LogGroupList) XXX_Marshal

func (m *LogGroupList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LogGroupList) XXX_Merge

func (m *LogGroupList) XXX_Merge(src proto.Message)

func (*LogGroupList) XXX_Size

func (m *LogGroupList) XXX_Size() int

func (*LogGroupList) XXX_Unmarshal

func (m *LogGroupList) XXX_Unmarshal(b []byte) error

type LogSendRetryQueue

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

LogSendRetryQueue RetryQueue cache ProducerBatch and retry latter

func NewRetryQueue

func NewRetryQueue() *LogSendRetryQueue

NewRetryQueue ...

func (*LogSendRetryQueue) Len

func (retryQueue *LogSendRetryQueue) Len() int

func (*LogSendRetryQueue) Less

func (retryQueue *LogSendRetryQueue) Less(i, j int) bool

func (*LogSendRetryQueue) Pop

func (retryQueue *LogSendRetryQueue) Pop() interface{}

func (*LogSendRetryQueue) Push

func (retryQueue *LogSendRetryQueue) Push(x interface{})

func (*LogSendRetryQueue) Swap

func (retryQueue *LogSendRetryQueue) Swap(i, j int)

type LogTag

type LogTag struct {
	Key                  *string  `protobuf:"bytes,1,req,name=key" json:"key,omitempty"`
	Value                *string  `protobuf:"bytes,2,req,name=value" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*LogTag) Descriptor

func (*LogTag) Descriptor() ([]byte, []int)

func (*LogTag) GetKey

func (m *LogTag) GetKey() string

func (*LogTag) GetValue

func (m *LogTag) GetValue() string

func (*LogTag) Marshal

func (m *LogTag) Marshal() (dAtA []byte, err error)

func (*LogTag) MarshalTo

func (m *LogTag) MarshalTo(dAtA []byte) (int, error)

func (*LogTag) MarshalToSizedBuffer

func (m *LogTag) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LogTag) ProtoMessage

func (*LogTag) ProtoMessage()

func (*LogTag) Reset

func (m *LogTag) Reset()

func (*LogTag) Size

func (m *LogTag) Size() (n int)

func (*LogTag) String

func (m *LogTag) String() string

func (*LogTag) Unmarshal

func (m *LogTag) Unmarshal(dAtA []byte) error

func (*LogTag) XXX_DiscardUnknown

func (m *LogTag) XXX_DiscardUnknown()

func (*LogTag) XXX_Marshal

func (m *LogTag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LogTag) XXX_Merge

func (m *LogTag) XXX_Merge(src proto.Message)

func (*LogTag) XXX_Size

func (m *LogTag) XXX_Size() int

func (*LogTag) XXX_Unmarshal

func (m *LogTag) XXX_Unmarshal(b []byte) error

type Log_Content

type Log_Content struct {
	Key                  *string  `protobuf:"bytes,1,req,name=key" json:"key,omitempty"`
	Value                *string  `protobuf:"bytes,2,req,name=value" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Log_Content) Descriptor

func (*Log_Content) Descriptor() ([]byte, []int)

func (*Log_Content) GetKey

func (m *Log_Content) GetKey() string

func (*Log_Content) GetValue

func (m *Log_Content) GetValue() string

func (*Log_Content) Marshal

func (m *Log_Content) Marshal() (dAtA []byte, err error)

func (*Log_Content) MarshalTo

func (m *Log_Content) MarshalTo(dAtA []byte) (int, error)

func (*Log_Content) MarshalToSizedBuffer

func (m *Log_Content) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Log_Content) ProtoMessage

func (*Log_Content) ProtoMessage()

func (*Log_Content) Reset

func (m *Log_Content) Reset()

func (*Log_Content) Size

func (m *Log_Content) Size() (n int)

func (*Log_Content) String

func (m *Log_Content) String() string

func (*Log_Content) Unmarshal

func (m *Log_Content) Unmarshal(dAtA []byte) error

func (*Log_Content) XXX_DiscardUnknown

func (m *Log_Content) XXX_DiscardUnknown()

func (*Log_Content) XXX_Marshal

func (m *Log_Content) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Log_Content) XXX_Merge

func (m *Log_Content) XXX_Merge(src proto.Message)

func (*Log_Content) XXX_Size

func (m *Log_Content) XXX_Size() int

func (*Log_Content) XXX_Unmarshal

func (m *Log_Content) XXX_Unmarshal(b []byte) error

type Logger added in v1.0.15

type Logger interface {
	Debug(msg string, args ...Field)
	Info(msg string, args ...Field)
	Warn(msg string, args ...Field)
	Error(msg string, args ...Field)
}

type NetworkType added in v1.0.12

type NetworkType string

NetworkType 网络类型,可以将string赋值给该类型,实现自定义网络类型

const (
	Intranet NetworkType = "cls.tencentyun.com" //内网
	Extranet NetworkType = "cls.tencentcs.com"  //外网
)

type Options

type Options struct {
	Host         string
	Scheme       string
	Timeout      int
	IdleConn     int
	CompressType string
	Credentials  Credentials
}

type PartitionInfo added in v1.0.15

type PartitionInfo struct {
	TopicID    string `json:"TopicID"`
	Partitions []int  `json:"Partitions"`
}

type PartitionOffset added in v1.0.15

type PartitionOffset struct {
	PartitionID int   `json:"PartitionId"`
	Offset      int64 `json:"Offset"`
}

PartitionOffset partition offset

type ProducerBatch

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

func NewProducerBatch

func NewProducerBatch(topicID string, config *AsyncProducerClientConfig, callBackFunc CallBack, logData interface{}, packageID string) *ProducerBatch

NewProducerBatch 初始化Producer batch

type PullLogResponse added in v1.0.15

type PullLogResponse struct {
	NextOffset int64
	LogGroups  []*LogGroup
	Headers    map[string]string
	// contains filtered or unexported fields
}

func ParsePullLogResponse added in v1.0.15

func ParsePullLogResponse(respBytes []byte) (*PullLogResponse, error)

ParsePullLogResponse parses the binary response of pulling logs and returns a PullLogResponse object

func (*PullLogResponse) GetLogCount added in v1.0.15

func (r *PullLogResponse) GetLogCount() int

GetLogCount returns the number of all logs

func (*PullLogResponse) GetLogGroups added in v1.0.15

func (r *PullLogResponse) GetLogGroups() []*LogGroup

GetLogGroups returns all log groups

func (*PullLogResponse) GetNextOffset added in v1.0.15

func (r *PullLogResponse) GetNextOffset() int64

GetNextOffset returns the next offset

type PullLogsClient added in v1.0.15

type PullLogsClient struct {
	Endpoint  string
	SecretId  string
	SecretKey string
	Token     string
	UserAgent string
}

func NewPullLogsClient added in v1.0.15

func NewPullLogsClient(endpoint, secretId, secretKey, token, userAgent string) *PullLogsClient

func (*PullLogsClient) PullLogs added in v1.0.15

func (c *PullLogsClient) PullLogs(topicId string, partitionId int, size int, startTime *int64, offset int64, endTime *int64, query string) ([]byte, error)

PullLogs pulls logs and returns snappy compressed binary data. query is an optional DSL pre-filter expression; pass "" to disable server-side filtering.

func (*PullLogsClient) PullLogsAndParse added in v1.0.15

func (c *PullLogsClient) PullLogsAndParse(topicId string, partitionId int, size int, startTime *int64, offset int64, endTime *int64, query string) (*PullLogResponse, error)

PullLogsAndParse pulls and parses logs and outputs proto text format. query is an optional DSL pre-filter expression; pass "" to disable server-side filtering.

type PullLogsRequest added in v1.0.15

type PullLogsRequest struct {
	StartOffset  int64  `json:"StartOffset"`
	Size         int    `json:"Size"`
	CompressType string `json:"CompressType"`
	PartitionId  int    `json:"PartitionId"`
	StartTime    int64  `json:"StartTime"`
	EndTime      *int64 `json:"EndTime,omitempty"`
	// Query is an optional DSL pre-filter expression applied on the server side
	// before logs are returned. Example:
	//   log_keep(op_and(op_gt(v("status"), 400), str_exist(v("message"), "access failed")))
	// See https://cloud.tencent.com/document/product/614/37908 for the full DSL syntax.
	Query string `json:"Query"`
}

type Region added in v1.0.12

type Region string

Region 地域类型,可以将string赋值给该类型,实现自定义地域

const (
	Beijing       Region = "ap-beijing"
	Guangzhou     Region = "ap-guangzhou"
	Shanghai      Region = "ap-shanghai"
	Chengdu       Region = "ap-chengdu"
	Nanjing       Region = "ap-nanjing"
	Chongqing     Region = "ap-chongqing"
	Hongkong      Region = "ap-hongkong"
	Siliconvalley Region = "na-siliconvalley"
	Ashburn       Region = "na-ashburn"
	Singapore     Region = "ap-singapore"
	Bangkok       Region = "ap-bangkok"
	Frankfurt     Region = "eu-frankfurt"
	Tokyo         Region = "ap-tokyo"
	Seoul         Region = "ap-seoul"
	Jakarta       Region = "ap-jakarta"
	Saopaulo      Region = "sa-saopaulo"
	ShenzhenFSI   Region = "ap-shenzhen-fsi"
	ShanghaiFSI   Region = "ap-shanghai-fsi"
	BeijingFSI    Region = "ap-beijing-fsi"
	ShanghaiADC   Region = "ap-shanghai-adc"
)

type Result

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

func NewResult

func NewResult() *Result

NewResult init result

func (*Result) GetErrorCode

func (result *Result) GetErrorCode() string

func (*Result) GetErrorMessage

func (result *Result) GetErrorMessage() string

func (*Result) GetRequestId

func (result *Result) GetRequestId() string

func (*Result) GetReservedAttempts

func (result *Result) GetReservedAttempts() []*Attempt

func (*Result) GetTimeStampMs

func (result *Result) GetTimeStampMs() int64

func (*Result) IsSuccessful

func (result *Result) IsSuccessful() bool

type SendThreadPool

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

func NewSendThreadPool

func NewSendThreadPool(worker *Worker) *SendThreadPool

type SyncProducerClient added in v1.0.3

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

SyncProducerClient synchronized producer client

func NewSyncProducerClient added in v1.0.3

func NewSyncProducerClient(config *SyncProducerClientConfig) (*SyncProducerClient, error)

NewSyncProducerClient new sync producer client

func (*SyncProducerClient) ResetSecretToken added in v1.0.3

func (c *SyncProducerClient) ResetSecretToken(secretID string, secretKEY string, secretToken string) error

ResetSecretToken reset temporary secret info

func (*SyncProducerClient) SendLogGroupList added in v1.0.6

func (c *SyncProducerClient) SendLogGroupList(ctx context.Context, topicID string, logGroupList []*LogGroup) error

SendLogGroupList send batched logs to cls

func (*SyncProducerClient) SendLogList added in v1.0.3

func (c *SyncProducerClient) SendLogList(ctx context.Context, topicID string, logList []*Log) error

SendLogList send batched logs to cls

type SyncProducerClientConfig added in v1.0.3

type SyncProducerClientConfig struct {
	Endpoint string

	AccessKeyID     string
	AccessKeySecret string
	AccessToken     string
	// Uin 弱鉴权(免密)账号 ID,与 AccessKeyID/AccessKeySecret 二选一填写。
	// 两者同时填写时以 AccessKeyID/AccessKeySecret 为准(走强鉴权),Uin 被忽略。
	Uin          string
	Timeout      int
	IdleConn     int
	CompressType string
	NeedSource   bool
	HostName     string
	// contains filtered or unexported fields
}

SyncProducerClientConfig sync producer config

func GetDefaultSyncProducerClientConfig added in v1.0.3

func GetDefaultSyncProducerClientConfig() *SyncProducerClientConfig

GetDefaultSyncProducerClientConfig get default sync producer config

func (*SyncProducerClientConfig) SetEndpointByRegionAndNetworkType added in v1.0.12

func (config *SyncProducerClientConfig) SetEndpointByRegionAndNetworkType(region Region, networkType NetworkType)

SetEndpointByRegionAndNetworkType 根据地域和网络类型设置域名

type TimerSendLogTask

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

func NewTimerSendLogTask

func NewTimerSendLogTask(logAccumulator *Accumulator, retryQueue *LogSendRetryQueue, ioWorker *Worker, threadPool *SendThreadPool) *TimerSendLogTask

type TopicPartitionOffsetsInfo added in v1.0.15

type TopicPartitionOffsetsInfo struct {
	TopicID          string            `json:"TopicID"`
	PartitionOffsets []PartitionOffset `json:"PartitionOffsets"`
}

TopicPartitionOffsetsInfo topic partition offset information

type UpdateConsumerGroupRequest added in v1.0.15

type UpdateConsumerGroupRequest struct {
	LogsetId      string   `json:"LogsetId"`
	ConsumerGroup string   `json:"ConsumerGroup"`
	Topics        []string `json:"Topics,omitempty"`
	Timeout       *int     `json:"Timeout,omitempty"`
}

UpdateConsumerGroupRequest update consumer group request

type UpdateConsumerGroupResponse added in v1.0.15

type UpdateConsumerGroupResponse struct {
	Response struct {
		RequestId string    `json:"RequestId"`
		Error     *APIError `json:"Error,omitempty"`
	} `json:"Response"`
}

UpdateConsumerGroupResponse supports capturing all fields

type UpdateOffsetsRequest added in v1.0.15

type UpdateOffsetsRequest struct {
	TopicPartitionOffsetsInfo []TopicPartitionOffsetsInfo `json:"TopicPartitionOffsetsInfo"`
	ConsumerGroup             string                      `json:"ConsumerGroup"`
	Consumer                  string                      `json:"Consumer"`
	LogsetId                  string                      `json:"LogsetId"`
}

UpdateOffsetsRequest update offset request body

type Worker

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

func NewWorker

func NewWorker(clsClient *CLSClient, retryQueue *LogSendRetryQueue, maxSendWorkerCount int64, producer *AsyncProducerClient) *Worker

NewWorker ...

type YunApiLogClient added in v1.0.15

type YunApiLogClient struct {
	*CLSClient
	// contains filtered or unexported fields
}

func NewYunApiLogClient deprecated added in v1.0.15

func NewYunApiLogClient(accessKeyId, accessKey string, internal bool, securityToken, source, region string) *YunApiLogClient

NewYunApiLogClient constructor

Deprecated: it silently ignores the underlying client construction error and returns nil when the credentials are invalid (e.g. empty accessKeyId / accessKey). Use NewYunApiLogClientFromConfig instead, which returns an error.

func NewYunApiLogClientFromConfig added in v1.0.18

func NewYunApiLogClientFromConfig(config YunApiLogClientConfig) (*YunApiLogClient, error)

NewYunApiLogClientFromConfig creates a YunApiLogClient from the given configuration. Unlike the deprecated constructors it reports credential / option errors instead of returning a client whose embedded *CLSClient is nil (which later panics on use).

func NewYunApiLogClientSimple deprecated added in v1.0.15

func NewYunApiLogClientSimple(accessKeyId, accessKey string) *YunApiLogClient

NewYunApiLogClientSimple simple constructor, only requires essential parameters

Deprecated: it silently ignores the underlying client construction error and returns nil when the credentials are invalid (e.g. empty AccessKeyId / AccessKey). Use NewYunApiLogClientFromConfig instead, which returns an error.

func NewYunApiLogClientWithConfig deprecated added in v1.0.15

func NewYunApiLogClientWithConfig(config YunApiLogClientConfig) *YunApiLogClient

NewYunApiLogClientWithConfig constructor using configuration struct, supports optional parameters

Deprecated: it silently ignores the underlying client construction error and returns nil when the credentials are invalid (e.g. empty AccessKeyId / AccessKey). Use NewYunApiLogClientFromConfig instead, which returns an error.

func (*YunApiLogClient) CreateConsumerGroup added in v1.0.15

func (c *YunApiLogClient) CreateConsumerGroup(logsetId, consumerGroup string, timeout int, topics []string) (*CreateConsumerGroupResponse, error)

CreateConsumerGroup create consumer group

func (*YunApiLogClient) DeleteConsumerGroup added in v1.0.15

func (c *YunApiLogClient) DeleteConsumerGroup(logsetId, consumerGroup string) (*DeleteConsumerGroupResponse, error)

DeleteConsumerGroup delete consumer group

func (*YunApiLogClient) DoRequest added in v1.0.15

func (c *YunApiLogClient) DoRequest(
	method string,
	resource string,
	params map[string]string,
	headers map[string]string,
	body []byte,
	region string,
	action string,
	responseBodyType string,
	service string,
) ([]byte, error)

DoRequest

func (*YunApiLogClient) GetOffsets added in v1.0.15

func (c *YunApiLogClient) GetOffsets(logsetId, consumerGroup, topicId string, partitionId int, position string) (*ConsumerGroupGetOffsetsResponse, error)

GetOffsets get offsets

func (*YunApiLogClient) Heartbeat added in v1.0.15

func (c *YunApiLogClient) Heartbeat(logsetId, consumerGroup, consumer string, partitions []PartitionInfo) (*ConsumerGroupHeartBeatResponse, error)

Heartbeat heartbeat

func (*YunApiLogClient) ListConsumerGroup added in v1.0.15

func (c *YunApiLogClient) ListConsumerGroup(logsetId string, topics []string) (*ListConsumerGroupResponse, error)

ListConsumerGroup list consumer groups

func (*YunApiLogClient) UpdateConsumerGroup added in v1.0.15

func (c *YunApiLogClient) UpdateConsumerGroup(logsetId, consumerGroup string, topics []string, timeout *int) (*UpdateConsumerGroupResponse, error)

UpdateConsumerGroup update consumer group

func (*YunApiLogClient) UpdateOffsets added in v1.0.15

func (c *YunApiLogClient) UpdateOffsets(logsetId, consumerGroup, consumer string, offsets []TopicPartitionOffsetsInfo) (*ConsumerGroupUpdateOffsetsResponse, error)

UpdateOffsets update offsets

type YunApiLogClientConfig added in v1.0.15

type YunApiLogClientConfig struct {
	AccessKeyId   string
	AccessKey     string
	Internal      bool
	SecurityToken string
	Source        string
	Region        string
}

YunApiLogClientConfig configuration struct, supports optional parameters

type ZapLogger added in v1.0.15

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

func GetZapLoggerAdapter added in v1.0.15

func GetZapLoggerAdapter() *ZapLogger

provide get logger instance function

func NewZapLogger added in v1.0.15

func NewZapLogger(logger *zap.Logger) *ZapLogger

func (*ZapLogger) Debug added in v1.0.15

func (z *ZapLogger) Debug(msg string, args ...Field)

func (*ZapLogger) Error added in v1.0.15

func (z *ZapLogger) Error(msg string, args ...Field)

func (*ZapLogger) Info added in v1.0.15

func (z *ZapLogger) Info(msg string, args ...Field)

func (*ZapLogger) Warn added in v1.0.15

func (z *ZapLogger) Warn(msg string, args ...Field)

type ZstdDecoderParams added in v1.0.2

type ZstdDecoderParams struct {
}

type ZstdEncoderParams added in v1.0.2

type ZstdEncoderParams struct {
	Level int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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