Documentation
¶
Index ¶
- func NewESClientFromParsedLayers(parsedLayers map[string]*layers.ParsedParameterLayer) (*elasticsearch.Client, error)
- type ESClientFactory
- type ElasticSearchCommand
- func (esc *ElasticSearchCommand) Description() *cmds.CommandDescription
- func (esc *ElasticSearchCommand) RenderQuery(parameters map[string]interface{}) (string, error)
- func (esc *ElasticSearchCommand) RenderQueryToJSON(parameters map[string]interface{}) (string, error)
- func (esc *ElasticSearchCommand) Run(ctx context.Context, parsedLayers map[string]*layers.ParsedParameterLayer, ...) error
- func (esc *ElasticSearchCommand) RunQueryIntoGlaze(ctx context.Context, es *elasticsearch.Client, ...) error
- type ElasticSearchCommandLoader
- func (escl *ElasticSearchCommandLoader) LoadCommandAliasFromYAML(s io.Reader, options ...cmds.CommandDescriptionOption) ([]*cmds.CommandAlias, error)
- func (escl *ElasticSearchCommandLoader) LoadCommandFromDir(f fs.FS, dir string, options ...cmds.CommandDescriptionOption) ([]cmds.Command, []*cmds.CommandAlias, error)
- func (l *ElasticSearchCommandLoader) LoadCommandsFromFS(f fs.FS, dir string, options ...cmds.CommandDescriptionOption) ([]cmds.Command, []*cmds.CommandAlias, error)
- type EsClientSettings
- type EsParameterLayer
- type EscuseMeCommandDescription
- type QueriesCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewESClientFromParsedLayers ¶ added in v0.0.6
func NewESClientFromParsedLayers( parsedLayers map[string]*layers.ParsedParameterLayer, ) (*elasticsearch.Client, error)
Types ¶
type ESClientFactory ¶ added in v0.0.5
type ESClientFactory func(map[string]*layers.ParsedParameterLayer) (*elasticsearch.Client, error)
type ElasticSearchCommand ¶
type ElasticSearchCommand struct { Query string // contains filtered or unexported fields }
func NewElasticSearchCommand ¶
func NewElasticSearchCommand( description *cmds.CommandDescription, clientFactory ESClientFactory, query string, ) (*ElasticSearchCommand, error)
func (*ElasticSearchCommand) Description ¶
func (esc *ElasticSearchCommand) Description() *cmds.CommandDescription
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) Run ¶
func (esc *ElasticSearchCommand) Run( ctx context.Context, parsedLayers map[string]*layers.ParsedParameterLayer, ps map[string]interface{}, gp cmds.Processor, ) error
func (*ElasticSearchCommand) RunQueryIntoGlaze ¶ added in v0.0.3
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, rootDir string, ) *ElasticSearchCommandLoader
func (*ElasticSearchCommandLoader) LoadCommandAliasFromYAML ¶ added in v0.0.3
func (escl *ElasticSearchCommandLoader) LoadCommandAliasFromYAML( s io.Reader, options ...cmds.CommandDescriptionOption, ) ([]*cmds.CommandAlias, error)
func (*ElasticSearchCommandLoader) LoadCommandFromDir ¶ added in v0.0.3
func (escl *ElasticSearchCommandLoader) LoadCommandFromDir( f fs.FS, dir string, options ...cmds.CommandDescriptionOption, ) ([]cmds.Command, []*cmds.CommandAlias, error)
func (*ElasticSearchCommandLoader) LoadCommandsFromFS ¶ added in v0.0.3
func (l *ElasticSearchCommandLoader) LoadCommandsFromFS( f fs.FS, dir string, options ...cmds.CommandDescriptionOption, ) ([]cmds.Command, []*cmds.CommandAlias, 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 map[string]*layers.ParsedParameterLayer) (*EsClientSettings, error)
type EsParameterLayer ¶ added in v0.0.5
type EsParameterLayer struct {
*layers.ParameterLayerImpl
}
func NewESParameterLayer ¶ added in v0.0.5
func NewESParameterLayer(options ...layers.ParameterLayerOptions) (*EsParameterLayer, error)
func (*EsParameterLayer) ParseFlagsFromCobraCommand ¶ added in v0.0.6
func (ep *EsParameterLayer) ParseFlagsFromCobraCommand( cmd *cobra.Command, ) (map[string]interface{}, error)
type EscuseMeCommandDescription ¶
type EscuseMeCommandDescription struct { Name string `yaml:"name"` Short string `yaml:"short"` Long string `yaml:"long,omitempty"` Flags []*parameters.ParameterDefinition `yaml:"flags,omitempty"` Arguments []*parameters.ParameterDefinition `yaml:"arguments,omitempty"` QueryTemplate string `yaml:"queryTemplate,omitempty"` }
type QueriesCommand ¶ added in v0.0.5
type QueriesCommand struct {
// contains filtered or unexported fields
}
func NewQueriesCommand ¶ added in v0.0.5
func NewQueriesCommand( allQueries []*ElasticSearchCommand, aliases []*glazed_cmds.CommandAlias, options ...glazed_cmds.CommandDescriptionOption, ) (*QueriesCommand, error)
func (*QueriesCommand) Description ¶ added in v0.0.5
func (q *QueriesCommand) Description() *glazed_cmds.CommandDescription
func (*QueriesCommand) Run ¶ added in v0.0.5
func (q *QueriesCommand) Run( ctx context.Context, parsedLayers map[string]*layers.ParsedParameterLayer, ps map[string]interface{}, gp glazed_cmds.Processor, ) error
Click to show internal directories.
Click to hide internal directories.