config

package
v2.0.15 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: MIT Imports: 6 Imported by: 4

Documentation

Overview

Package config allows parsing a configuration for Opensearch from a URL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URLs        []string
	Index       string
	Username    string
	Password    string
	Shards      int
	Replicas    int
	Sniff       *bool
	Healthcheck *bool
	Transport   http.RoundTripper
	Logger      *logrus.Logger
}

Config represents an Opensearch configuration.

func Parse

func Parse(opensearchURL string) (*Config, error)

Parse returns the Opensearch configuration by extracting it from the URL, its path, and its query string.

Example:

http://127.0.0.1:9200/store-blobs?shards=1&replicas=0&sniff=false&tracelog=opensearch.trace.log

The code above will return a URL of http://127.0.0.1:9200, an index name of store-blobs, and the related settings from the query string.

Jump to

Keyboard shortcuts

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