Documentation
¶
Index ¶
- Constants
- Variables
- func SaveLoaderConfig(path string, cfg LoaderConfig) error
- type AuthenticationType
- type Client
- func (c *Client) BufferedRecords() int
- func (c *Client) Close() error
- func (c *Client) Closed() <-chan struct{}
- func (c *Client) Send(record string) (*Handle, error)
- func (c *Client) SendBatch(records []string) (*Handle, error)
- func (c *Client) SendBatchContext(ctx context.Context, records []string) (*Handle, error)
- func (c *Client) SendBatchWithCallback(callback DeliveryCallback, records []string) (*Handle, error)
- func (c *Client) SendRecord(records ...string) (*Handle, error)
- func (c *Client) SendRecordContext(ctx context.Context, records ...string) (*Handle, error)
- func (c *Client) SendRecordWithCallback(callback DeliveryCallback, records ...string) (*Handle, error)
- func (c *Client) SendWithCallback(callback DeliveryCallback, record string) (*Handle, error)
- func (c *Client) Stats() ClientStats
- type ClientStats
- type CompressionType
- type Config
- type DeliveryCallback
- type DeliveryResult
- type Handle
- type LoaderConfig
- type LogLevel
- type Logger
- type Mode
- type SendOption
- type StreamLoadResponse
- type ValidationMode
Constants ¶
View Source
const ( ModeCSV Mode = "csv" ModeJSON Mode = "json" CompressionNone CompressionType = "none" CompressionGzip CompressionType = "gz" CompressionLZO CompressionType = "lzo" CompressionBZip2 CompressionType = "bz2" CompressionLZ4 CompressionType = "lz4" CompressionLZOP CompressionType = "lzop" CompressionDeflate CompressionType = "deflate" ValidateNone ValidationMode = "none" ValidateSyntax ValidationMode = "syntax" ValidateStrict ValidationMode = "strict" AuthenticationNone AuthenticationType = "" AuthenticationBasic AuthenticationType = "basic" )
Variables ¶
Functions ¶
func SaveLoaderConfig ¶
func SaveLoaderConfig(path string, cfg LoaderConfig) error
Types ¶
type AuthenticationType ¶
type AuthenticationType string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BufferedRecords ¶
func (*Client) SendBatchContext ¶
func (*Client) SendBatchWithCallback ¶
func (c *Client) SendBatchWithCallback(callback DeliveryCallback, records []string) (*Handle, error)
func (*Client) SendRecordContext ¶
func (*Client) SendRecordWithCallback ¶
func (c *Client) SendRecordWithCallback(callback DeliveryCallback, records ...string) (*Handle, error)
func (*Client) SendWithCallback ¶
func (c *Client) SendWithCallback(callback DeliveryCallback, record string) (*Handle, error)
func (*Client) Stats ¶
func (c *Client) Stats() ClientStats
type ClientStats ¶
type ClientStats struct {
StartedAt time.Time
TotalWorkers int
IdleWorkers int
BusyWorkers int
TotalLoadJobs int64
ErrorJobs int64
ErrorRate float64
AverageLoadTime time.Duration
P50LoadTime time.Duration
P90LoadTime time.Duration
P99LoadTime time.Duration
P999LoadTime time.Duration
AverageRetries float64
TotalBytesSent int64
AverageLoadSize float64
AverageBytesRate float64
RecordsSent int64
AverageRecordsRate float64
TotalUploadAttempts int64
}
type CompressionType ¶ added in v1.1.0
type CompressionType string
type Config ¶
type Config struct {
Endpoint string
Database string
Table string
StreamLoadURL string
Columns []string
Headers http.Header
Mode Mode
CompressionType CompressionType
AuthenticationType AuthenticationType
AuthenticationToken string
MaxQueueSize int
MaxUploadQueueSize int
BatchBytes int
Linger time.Duration
MaxQueueWaitTime time.Duration
DorisUploadWorkers int
Validation ValidationMode
DorisUploadTimeout time.Duration
DorisUploadRequestTimeout time.Duration
CallbackTimeout time.Duration
SlowCallbackWarn time.Duration
LabelPrefix string
StatusPollTimeout time.Duration
FakeSend bool
FakeSendDelay time.Duration
FakeSendDelaySet bool
CSVSeparator string
CSVQuote string
TLSSkipVerify bool
TLSCACertPath string
Logger Logger
LogLevel LogLevel
// LogLevelSet distinguishes an explicit LogLevelError from the zero-value
// default path. Non-zero log levels are treated as explicitly configured.
LogLevelSet bool
HTTPClient *http.Client
}
type DeliveryCallback ¶
type DeliveryCallback func(DeliveryResult)
type DeliveryResult ¶
type DeliveryResult struct {
Err error
Attempts int
StatusCode int
Response *StreamLoadResponse
StartedAt time.Time
FinishedAt time.Time
}
func (DeliveryResult) Success ¶
func (r DeliveryResult) Success() bool
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
func (*Handle) Result ¶
func (h *Handle) Result() (DeliveryResult, bool)
func (*Handle) Wait ¶
func (h *Handle) Wait() DeliveryResult
func (*Handle) WaitContext ¶
func (h *Handle) WaitContext(ctx context.Context) (DeliveryResult, error)
type LoaderConfig ¶
type LoaderConfig struct {
Endpoint string `json:"endpoint,omitempty"`
Database string `json:"database,omitempty"`
Table string `json:"table,omitempty"`
StreamLoadURL string `json:"stream_load_url,omitempty"`
Columns []string `json:"columns,omitempty"`
Headers http.Header `json:"headers,omitempty"`
Mode Mode `json:"mode,omitempty"`
CompressionType CompressionType `json:"compression_type,omitempty"`
AuthenticationType AuthenticationType `json:"authentication_type,omitempty"`
AuthenticationToken string `json:"authentication_token,omitempty"`
MaxQueueSize int `json:"max_queue_size,omitempty"`
MaxUploadQueueSize int `json:"max_upload_queue_size,omitempty"`
BatchBytes int `json:"batch_bytes,omitempty"`
Linger string `json:"linger,omitempty"`
MaxQueueWaitTime string `json:"max_queue_wait_time,omitempty"`
DorisUploadWorkers int `json:"doris_upload_workers,omitempty"`
Validation ValidationMode `json:"validation,omitempty"`
DorisUploadTimeout string `json:"doris_upload_timeout,omitempty"`
DorisUploadRequestTimeout string `json:"doris_upload_request_timeout,omitempty"`
CallbackTimeout string `json:"callback_timeout,omitempty"`
SlowCallbackWarn string `json:"slow_callback_warn,omitempty"`
LabelPrefix string `json:"label_prefix,omitempty"`
StatusPollTimeout string `json:"status_poll_timeout,omitempty"`
FakeSend bool `json:"fake_send,omitempty"`
FakeSendDelay string `json:"fake_send_delay,omitempty"`
FakeSendDelaySet bool `json:"fake_send_delay_set,omitempty"`
CSVSeparator string `json:"csv_separator,omitempty"`
CSVQuote string `json:"csv_quote,omitempty"`
TLSSkipVerify bool `json:"tls_skip_verify,omitempty"`
TLSCACertPath string `json:"tls_ca_cert_path,omitempty"`
LogLevel LogLevel `json:"log_level,omitempty"`
LogLevelSet bool `json:"log_level_set,omitempty"`
}
func LoadLoaderConfig ¶
func LoadLoaderConfig(path string) (LoaderConfig, error)
func LoaderConfigFromConfig ¶
func LoaderConfigFromConfig(cfg Config) LoaderConfig
func (LoaderConfig) Config ¶
func (lc LoaderConfig) Config() (Config, error)
type SendOption ¶
type SendOption func(*sendOptions)
func WithCallback ¶
func WithCallback(callback DeliveryCallback) SendOption
type StreamLoadResponse ¶
type StreamLoadResponse struct {
TxnID int64 `json:"TxnId"`
Label string `json:"Label"`
Status string `json:"Status"`
ExistingJobStatus string `json:"ExistingJobStatus"`
Message string `json:"Message"`
ErrorURL string `json:"ErrorURL"`
NumberTotalRows int64 `json:"NumberTotalRows"`
NumberLoadedRows int64 `json:"NumberLoadedRows"`
NumberFilteredRows int64 `json:"NumberFilteredRows"`
NumberUnselected int64 `json:"NumberUnselectedRows"`
LoadBytes int64 `json:"LoadBytes"`
LoadTimeMS int64 `json:"LoadTimeMs"`
}
type ValidationMode ¶
type ValidationMode string
Click to show internal directories.
Click to hide internal directories.