config

package
v0.0.0-...-39a21f2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeLOGDB    = "logdb"
	TypePipeline = "pipeline"
	TypeTSDB     = "tsdb"
	TypeReport   = "report"
)
View Source
const (
	DefaultTSDBEndpoint     = "https://tsdb.qiniu.com"
	DefaultLogDBEndpoint    = "https://logdb.qiniu.com"
	DefaultPipelineEndpoint = "https://pipeline.qiniu.com"
	DefaultReportEndpoint   = "https://report.qiniu.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoint         string
	Ak               string
	Sk               string
	Logger           base.Logger
	DialTimeout      time.Duration
	ResponseTimeout  time.Duration
	RequestRateLimit int64 //每秒请求数限制
	FlowRateLimit    int64 //每秒流量限制(kb),若FlowRateLimit为100,则表示限速100KB/s
	Gzip             bool

	HeaderUserAgent string

	//以下是新版本,上面的Endpoint是老版本,都兼容,默认使用新版,新版为空则用老的Endpoint
	LogdbEndpoint    string
	TsdbEndpoint     string
	PipelineEndpoint string
	ReportEndpoint   string
	ConfigType       string
}

func NewConfig

func NewConfig() *Config

func (*Config) Clone

func (c *Config) Clone() *Config

func (*Config) WithAccessKeySecretKey

func (c *Config) WithAccessKeySecretKey(ak, sk string) *Config

func (*Config) WithDialTimeout

func (c *Config) WithDialTimeout(t time.Duration) *Config

func (*Config) WithEndpoint

func (c *Config) WithEndpoint(endpoint string) *Config

func (*Config) WithFlowRateLimit

func (c *Config) WithFlowRateLimit(limit int64) *Config

func (*Config) WithGzipData

func (c *Config) WithGzipData(enable bool) *Config

func (*Config) WithHeaderUserAgent

func (c *Config) WithHeaderUserAgent(userAgent string) *Config

func (*Config) WithLogDBEndpoint

func (c *Config) WithLogDBEndpoint(endpoint string) *Config

func (*Config) WithLogger

func (c *Config) WithLogger(l base.Logger) *Config

func (*Config) WithLoggerLevel

func (c *Config) WithLoggerLevel(level base.LogLevelType) *Config

func (*Config) WithPipelineEndpoint

func (c *Config) WithPipelineEndpoint(endpoint string) *Config

func (*Config) WithReportEndpoint

func (c *Config) WithReportEndpoint(endpoint string) *Config

func (*Config) WithRequestRateLimit

func (c *Config) WithRequestRateLimit(limit int64) *Config

func (*Config) WithResponseTimeout

func (c *Config) WithResponseTimeout(t time.Duration) *Config

func (*Config) WithTSDBEndpoint

func (c *Config) WithTSDBEndpoint(endpoint string) *Config

Jump to

Keyboard shortcuts

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