mattermost-community-enterp.../vendor/github.com/opensearch-project/opensearch-go/v4/opensearchapi/api_ingest.go
Claude ec1f89217a Merge: Complete Mattermost Server with Community Enterprise
Full Mattermost server source with integrated Community Enterprise features.
Includes vendor directory for offline/air-gapped builds.

Structure:
- enterprise-impl/: Enterprise feature implementations
- enterprise-community/: Init files that register implementations
- enterprise/: Bridge imports (community_imports.go)
- vendor/: All dependencies for offline builds

Build (online):
  go build ./cmd/mattermost

Build (offline/air-gapped):
  go build -mod=vendor ./cmd/mattermost

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:59:07 +09:00

89 lines
2.0 KiB
Go

// SPDX-License-Identifier: Apache-2.0
//
// The OpenSearch Contributors require contributions made to
// this file be licensed under the Apache-2.0 license or a
// compatible open source license.
package opensearchapi
import (
"context"
)
type ingestClient struct {
apiClient *Client
}
// Create executes a creade ingest request with the required IngestCreateReq
func (c ingestClient) Create(ctx context.Context, req IngestCreateReq) (*IngestCreateResp, error) {
var (
data IngestCreateResp
err error
)
if data.response, err = c.apiClient.do(ctx, req, &data); err != nil {
return &data, err
}
return &data, nil
}
// Delete executes a delete ingest request with the required IngestDeleteReq
func (c ingestClient) Delete(ctx context.Context, req IngestDeleteReq) (*IngestDeleteResp, error) {
var (
data IngestDeleteResp
err error
)
if data.response, err = c.apiClient.do(ctx, req, &data); err != nil {
return &data, err
}
return &data, nil
}
// Get executes a get ingest request with the optional IngestGetReq
func (c ingestClient) Get(ctx context.Context, req *IngestGetReq) (*IngestGetResp, error) {
if req == nil {
req = &IngestGetReq{}
}
var (
data IngestGetResp
err error
)
if data.response, err = c.apiClient.do(ctx, req, &data.Pipelines); err != nil {
return &data, err
}
return &data, nil
}
// Simulate executes a stats ingest request with the optional IngestSimulateReq
func (c ingestClient) Simulate(ctx context.Context, req IngestSimulateReq) (*IngestSimulateResp, error) {
var (
data IngestSimulateResp
err error
)
if data.response, err = c.apiClient.do(ctx, req, &data); err != nil {
return &data, err
}
return &data, nil
}
// Grok executes a get ingest request with the optional IngestGrokReq
func (c ingestClient) Grok(ctx context.Context, req *IngestGrokReq) (*IngestGrokResp, error) {
if req == nil {
req = &IngestGrokReq{}
}
var (
data IngestGrokResp
err error
)
if data.response, err = c.apiClient.do(ctx, req, &data); err != nil {
return &data, err
}
return &data, nil
}