pkg

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const ESHelpersSlug = "es-helpers"
View Source
const EsConnectionSlug = "es-connection"

Variables

This section is empty.

Functions

func NewESClientFromParsedLayers added in v0.0.6

func NewESClientFromParsedLayers(
	parsedLayers *layers.ParsedLayers,
) (*elasticsearch.Client, error)

func NewESHelpersParameterLayer added in v0.1.0

func NewESHelpersParameterLayer(
	options ...layers.ParameterLayerOptions,
) (*layers.ParameterLayerImpl, error)

Types

type ESClientFactory added in v0.0.5

type ESClientFactory func(*layers.ParsedLayers) (*elasticsearch.Client, error)

type ESHelperSettings added in v0.1.0

type ESHelperSettings struct {
	PrintQuery bool   `glazed.parameter:"print-query"`
	Explain    bool   `glazed.parameter:"explain"`
	Index      string `glazed.parameter:"index"`
}

type ElasticSearchCommand

type ElasticSearchCommand struct {
	*cmds.CommandDescription
	Query string
	// contains filtered or unexported fields
}

func NewElasticSearchCommand

func NewElasticSearchCommand(
	description *cmds.CommandDescription,
	clientFactory ESClientFactory,
	query string,
) (*ElasticSearchCommand, error)

func (*ElasticSearchCommand) RenderQuery added in v0.0.3

func (esc *ElasticSearchCommand) RenderQuery(parameters map[string]interface{}) (string, error)

func (*ElasticSearchCommand) RenderQueryToJSON added in v0.0.3

func (esc *ElasticSearchCommand) RenderQueryToJSON(parameters map[string]interface{}) (string, error)

func (*ElasticSearchCommand) RunIntoGlazeProcessor added in v0.1.0

func (esc *ElasticSearchCommand) RunIntoGlazeProcessor(
	ctx context.Context,
	parsedLayers *layers.ParsedLayers,
	gp middlewares.Processor,
) error

func (*ElasticSearchCommand) RunQueryIntoGlaze added in v0.0.3

func (esc *ElasticSearchCommand) RunQueryIntoGlaze(
	ctx context.Context,
	es *elasticsearch.Client,
	parsedLayers *layers.ParsedLayers,
	gp middlewares.Processor,
) error

type ElasticSearchCommandLoader added in v0.0.3

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

ElasticSearchCommandLoader walks through a directory and finds all directories that end with .escuse-me and loads the commands from there. The layout of an .escuse-me directory is as follows: - main.yaml (mandatory) contains the command description

  • contains flags, arguments, name, short
  • reference the query template file

- the alias folder, which contains alias definitions in single yaml files - the data folder, which contains additional data in json / csv / yaml format

  • this data is passed to the template at evaluation file, and can be used to store things like tags and constant strings, boost values and the like

func NewElasticSearchCommandLoader added in v0.0.5

func NewElasticSearchCommandLoader(
	clientFactory ESClientFactory,
) *ElasticSearchCommandLoader

func (*ElasticSearchCommandLoader) IsFileSupported added in v0.1.0

func (escl *ElasticSearchCommandLoader) IsFileSupported(f fs.FS, fileName string) bool

func (*ElasticSearchCommandLoader) LoadCommands added in v0.1.0

func (escl *ElasticSearchCommandLoader) LoadCommands(
	f fs.FS,
	entryName string,
	options []cmds.CommandDescriptionOption,
	aliasOptions []alias.Option,
) ([]cmds.Command, error)

type EsClientSettings added in v0.0.6

type EsClientSettings struct {
	Addresses               []string `glazed.parameter:"addresses"`
	Username                string   `glazed.parameter:"username"`
	Password                string   `glazed.parameter:"password"`
	CloudId                 string   `glazed.parameter:"cloud-id"`
	ApiKey                  string   `glazed.parameter:"api-key"`
	ServiceToken            string   `glazed.parameter:"service-token"`
	CertificateFingerprint  string   `glazed.parameter:"certificate-fingerprint"`
	RetryOnStatus           []int    `glazed.parameter:"retry-on-status"`
	DisableRetry            bool     `glazed.parameter:"disable-retry"`
	MaxRetries              int      `glazed.parameter:"max-retries"`
	EnableMetrics           bool     `glazed.parameter:"enable-metrics"`
	EnableDebugLogger       bool     `glazed.parameter:"enable-debug-logger"`
	EnableCompatibilityMode bool     `glazed.parameter:"enable-compatibility-mode"`
}

func NewESClientSettingsFromParsedLayers added in v0.0.6

func NewESClientSettingsFromParsedLayers(parsedLayers *layers.ParsedLayers) (*EsClientSettings, error)

type EsParameterLayer added in v0.0.5

type EsParameterLayer struct {
	*layers.ParameterLayerImpl `yaml:",inline"`
}

func NewESParameterLayer added in v0.0.5

func NewESParameterLayer(options ...layers.ParameterLayerOptions) (*EsParameterLayer, error)

type EscuseMeCommandDescription

type EscuseMeCommandDescription struct {
	Name      string                            `yaml:"name"`
	Short     string                            `yaml:"short"`
	Long      string                            `yaml:"long,omitempty"`
	Layout    []*layout.Section                 `yaml:"layout,omitempty"`
	Flags     []*parameters.ParameterDefinition `yaml:"flags,omitempty"`
	Arguments []*parameters.ParameterDefinition `yaml:"arguments,omitempty"`

	QueryTemplate string `yaml:"queryTemplate,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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