Documentation ¶
Index ¶
- Constants
- type CompressedJSONEncoder
- type DocumentManager
- type DocumentRequestHandler
- type IndexRequestHandler
- type MetricsCollector
- type Monitor
- type MonitorListener
- type Option
- func WithErrorHandler(handler func(error)) Option
- func WithMetricsCollector(collector MetricsCollector, interval time.Duration) Option
- func WithRootCAs(rootCAFiles ...string) Option
- func WithSeedFile(seedFile string) Option
- func WithShardgroupSize(groupSize int32) Option
- func WithTimeout(timeout time.Duration) Option
- func WithTopic(topic string) Option
- type SearchAgent
Constants ¶
const COMPRESSED_ENCODER = "COMPRESSED_ENCODER"
const COMPRESSION_LIMIT = 1024
const COMPRESSION_MARKER = uint8(0xf8)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompressedJSONEncoder ¶ added in v0.2.0
type CompressedJSONEncoder struct{}
type DocumentManager ¶
type DocumentManager interface { Close() StartIndexRequestHandler(handler IndexRequestHandler) error StartDocumentRequestHandler(handler DocumentRequestHandler) error }
DocumentManager connects to the letarette cluster and processes indexing requests
func StartDocumentManager ¶
func StartDocumentManager(URLs []string, options ...Option) (DocumentManager, error)
StartDocumentManager creates a DocumentManager and connects to Nats daemon
type DocumentRequestHandler ¶
type DocumentRequestHandler func(ctx context.Context, req protocol.DocumentRequest) (protocol.DocumentUpdate, error)
DocumentRequestHandler processes document requests from the letarette cluster and returns document updates.
type IndexRequestHandler ¶
type IndexRequestHandler func(ctx context.Context, req protocol.IndexUpdateRequest) (protocol.IndexUpdate, error)
IndexRequestHandler processes index update requests from the letarette cluster and returns index updates.
type MetricsCollector ¶ added in v0.2.0
MetricsCollector is a callback function receiving metrics updates
type Monitor ¶
type Monitor interface {
Close()
}
Monitor listens to status broadcasts from a letarette cluster
func NewMonitor ¶
func NewMonitor(URLs []string, listener MonitorListener, options ...Option) (Monitor, error)
NewMonitor - Monitor constructor
type MonitorListener ¶
type MonitorListener func(protocol.IndexStatus)
MonitorListener is a callback function receiving status broadcasts
type Option ¶
type Option func(*state)
Option is the option setter interface. See related WithXXX functions.
func WithErrorHandler ¶
WithErrorHandler sets an error handler instead of the default silent one
func WithMetricsCollector ¶ added in v0.2.0
func WithMetricsCollector(collector MetricsCollector, interval time.Duration) Option
WithMetricsCollector makes the monitor periodically request metrics from the cluster.
func WithRootCAs ¶
WithRootCAs specifies a set of root CA files for server verification
func WithSeedFile ¶
WithSeedFile specifies a seed file for Nkey authentication
func WithShardgroupSize ¶
WithShardgroupSize forces shard group size instead of using discovery
func WithTimeout ¶
WithTimeout sets search request timeout
type SearchAgent ¶
type SearchAgent interface { Close() Search(q string, spaces []string, pageLimit int, pageOffset int) (protocol.SearchResponse, error) }
SearchAgent is a letarette cluster searcher
func NewSearchAgent ¶
func NewSearchAgent(URLs []string, options ...Option) (SearchAgent, error)
NewSearchAgent - SearchAgent constructor