escompat

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package escompat contains shared REST implementation for Elasticsearch-compatible plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, cfg plugin.ConnectConfig, provider Provider) (plugin.Session, error)

func ExecuteSearchRequest

func ExecuteSearchRequest(ctx context.Context, s *Session, index string, req sqldb.QueryRequest) (sqldb.QueryResult, error)

func Routes

func Routes(provider Provider) []plugin.Route

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) Do

func (c *Client) Do(ctx context.Context, method, path string, query url.Values, body any, out any) error

type Options

type Options struct {
	Endpoint      string
	Username      string
	Password      string
	Authorization string
	TLSConfig     *tls.Config
	Timeout       time.Duration
	PageLimit     int
	ReadOnly      bool
	Product       Product
}

func ParseOptions

func ParseOptions(cfg plugin.ConnectConfig, provider Provider) (Options, error)

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func New

func New(provider Provider) *Plugin

func (*Plugin) Connect

func (p *Plugin) Connect(ctx context.Context, cfg plugin.ConnectConfig) (plugin.Session, error)

func (*Plugin) Manifest

func (p *Plugin) Manifest() plugin.Manifest

func (*Plugin) Routes

func (p *Plugin) Routes() []plugin.Route

type Product

type Product string
const (
	ProductElasticsearch Product = "elasticsearch"
	ProductOpenSearch    Product = "opensearch"
)

type Provider

type Provider struct {
	Protocol    string
	Title       string
	Description string
	DefaultURL  string
	Product     Product
	Icon        plugin.Icon
}

type Session

type Session struct {
	// contains filtered or unexported fields
}

func (*Session) Close

func (s *Session) Close() error

func (*Session) HealthCheck

func (s *Session) HealthCheck(ctx context.Context) error

func (*Session) OpenChannel

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL