Documentation
¶
Index ¶
- Constants
- func Ptr[T any](t T) *T
- type Client
- func (c *Client) Close()
- func (c *Client) Ingest(data ...any)
- func (c *Client) OnDiscard(f OnDiscardFunc)
- func (c *Client) Search(ctx context.Context, query string, opt *SearchOpt) (*SearchResult, error)
- func (c *Client) SetAuth(auth func(req *http.Request))
- func (c *Client) SetAutoReduceBatchSize(autoReduceBatchSize bool)
- func (c *Client) SetBatchSize(batchSize int)
- func (c *Client) SetConcurrent(concurrent int)
- func (c *Client) SetDiscard(discard bool)
- func (c *Client) SetHTTPClient(client *http.Client)
- func (c *Client) SetIngestBufferSize(size int)
- func (c *Client) SetIngestTimeout(timeout time.Duration)
- func (c *Client) SetMaxDelay(maxDelay time.Duration)
- type OnDiscardFunc
- type SearchOpt
- type SearchResult
Constants ¶
View Source
const ( IngestBufferSize = 10000 IngestBatchSize = 1000 IngestMaxDelay = time.Second IngestConcurrent = 2 IngestTimeout = 15 * time.Second ReduceBatchSizeToRatio = 0.9 // reduce 10% of the batch size ReduceBatchSizeMin = 0.1 // do not reduce below 10% of the default batch size ResetBatchSizeAfter = 10 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Ingest ¶
Ingest sends data to the quickwit server. The data can be any type, and will be marshalled to JSON. The data will be buffered until the buffer is full, then sent to the server. If the buffer is full, Ingest will block until the buffer is no longer full.
func (*Client) OnDiscard ¶
func (c *Client) OnDiscard(f OnDiscardFunc)
func (*Client) SetAutoReduceBatchSize ¶
func (*Client) SetBatchSize ¶
func (*Client) SetConcurrent ¶
func (*Client) SetDiscard ¶
func (*Client) SetHTTPClient ¶
func (*Client) SetIngestBufferSize ¶
func (*Client) SetIngestTimeout ¶
func (*Client) SetMaxDelay ¶
type OnDiscardFunc ¶
type OnDiscardFunc func(any)
type SearchResult ¶
type SearchResult struct {
Hits json.RawMessage
NumHits int64
ElapsedTimeMicros int64
}
Click to show internal directories.
Click to hide internal directories.