Documentation
¶
Index ¶
- Variables
- type Backend
- type HitsInfo
- type RawClientMixin
- type Request
- type Response
- type Result
- type ScrollOptions
- type ScrollRequest
- type SearchHit
- type SearchResults
- type Searcher
- func (t *Searcher) ClearScroll(ctx context.Context, scrollID string) error
- func (t *Searcher) GetRawClient() *opensearch.Client
- func (t *Searcher) ScrollNext(ctx context.Context, scrollID string, scrollTimeout time.Duration) (*logs.LogResult, string, error)
- func (t *Searcher) Search(ctx context.Context, q Request) (*logs.LogResult, error)
- func (t *Searcher) SearchWithScroll(ctx context.Context, req ScrollRequest) (*logs.LogResult, string, error)
- type TotalHitsInfo
Constants ¶
This section is empty.
Variables ¶
var DefaultFieldMappingConfig = logs.FieldMappingConfig{ Message: []string{"message"}, Timestamp: []string{"@timestamp"}, Severity: []string{"log"}, }
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
Address string `json:"address"`
Username *types.EnvVar `json:"username,omitempty"`
Password *types.EnvVar `json:"password,omitempty"`
}
+kubebuilder:object:generate=true
func (*Backend) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend.
func (*Backend) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type HitsInfo ¶
type HitsInfo struct {
Total TotalHitsInfo `json:"total"`
MaxScore float64 `json:"max_score"`
Hits []SearchHit `json:"hits"`
}
type RawClientMixin ¶
type RawClientMixin interface {
GetRawClient() any
}
type Request ¶
type Request struct {
Index string `json:"index" template:"true"`
Query string `json:"query" template:"true"`
Limit string `json:"limit,omitempty" template:"true"`
}
+kubebuilder:object:generate=true
func (*Request) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Request.
func (*Request) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Result ¶
type Result struct {
// Id is the unique identifier provided by the underlying system, use to link to a point in time of a log stream
Id string `json:"id,omitempty"`
// RFC3339 timestamp
Time string `json:"timestamp,omitempty"`
Message string `json:"message,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
}
type ScrollOptions ¶
type ScrollOptions struct {
// Size is the number of documents to fetch per scroll request
Size int `json:"size,omitempty"`
// Timeout is how long to keep the scroll context alive
Timeout time.Duration `json:"timeout,omitempty"`
// Enabled determines if scroll should be used automatically for large result sets
Enabled bool `json:"enabled,omitempty"`
}
ScrollOptions contains configuration for scroll operations
type ScrollRequest ¶
type ScrollRequest struct {
Request
Scroll ScrollOptions `json:"scroll,omitempty"`
}
ScrollRequest extends Request with scroll-specific options
type SearchResults ¶
type Searcher ¶
type Searcher struct {
// contains filtered or unexported fields
}
func (*Searcher) ClearScroll ¶
ClearScroll cleans up the scroll context
func (*Searcher) GetRawClient ¶
func (t *Searcher) GetRawClient() *opensearch.Client
func (*Searcher) ScrollNext ¶
func (t *Searcher) ScrollNext(ctx context.Context, scrollID string, scrollTimeout time.Duration) (*logs.LogResult, string, error)
ScrollNext retrieves the next batch of results using the scroll ID
func (*Searcher) SearchWithScroll ¶
func (t *Searcher) SearchWithScroll(ctx context.Context, req ScrollRequest) (*logs.LogResult, string, error)
SearchWithScroll initiates a scroll search for large result sets