Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchWriteError ¶
type BatchWriteError struct { List []interface{} Errors []error }
BatchWriteError .
type BatchWriteOption ¶
type BatchWriteOption func(opts *BatchWriteOptions)
BatchWriteOption .
func WithBatchErrorHandler ¶
func WithBatchErrorHandler(eh func(error) error) BatchWriteOption
WithBatchErrorHandler .
type BatchWriteOptions ¶
BatchWriteOptions .
type BatchWriterConfig ¶
type BatchWriterConfig struct { Type string `file:"type" desc:"index type"` Parallelism uint64 `file:"parallelism" default:"4" desc:"parallelism"` Batch struct { Size uint64 `file:"size" default:"100" desc:"batch size"` Timeout time.Duration `file:"timeout" default:"30s" desc:"timeout to flush buffer for batch write"` } `file:"batch"` Retry int `file:"retry" desc:"retry if fail to write"` }
BatchWriterConfig .
type Document ¶
type Document struct { ID string `json:"id"` Index string `json:"index"` Data interface{} `json:"data"` }
Document .
type EncodeFunc ¶
EncodeFunc .
type Interface ¶
type Interface interface { URL() string Client() *elastic.Client NewBatchWriter(*BatchWriterConfig) writer.Writer NewBatchWriterWithOptions(c *WriterConfig, opts ...BatchWriteOption) writer.Writer NewWriter(opts *WriteOptions) *Writer }
Interface .
type WriteOptions ¶
type WriteOptions struct { Timeout time.Duration Enc EncodeFunc }
WriteOptions .
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer .
type WriterConfig ¶
type WriterConfig = BatchWriterConfig
WriterConfig deprecated, use BatchWriterConfig instead of
Click to show internal directories.
Click to hide internal directories.