opensearch

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ProfileName = "teleport"

ProfileName is the name of the opensearch-cli that will be created for Teleport usage

Variables

This section is empty.

Functions

func WriteConfig

func WriteConfig(baseDir string, cfg Config) (string, error)

WriteConfig writes the config to disk, relative to the base dir.

Types

type Certificate

type Certificate struct {
	// CACert is the path to the CA cert.
	CACert string `json:"cafilepath,omitempty"`
	// Cert is the path to the client cert.
	Cert string `json:"clientcertificatefilepath,omitempty"`
	// Key is the path to the client key.
	Key string `json:"clientkeyfilepath,omitempty"`
}

Certificate is an optional certificate config.

type Config

type Config struct {
	// Profiles is the list of profiles in the config.
	Profiles []Profile `json:"profiles"`
}

Config represents configuration for opensearch-cli

func ConfigNoTLS

func ConfigNoTLS(host string, port int) Config

ConfigNoTLS returns insecure config with single profile.

func ConfigTLS

func ConfigTLS(host string, port int, caCert, cert, key string) Config

ConfigTLS returns secure config with single profile.

type Profile

type Profile struct {
	// Name is the name of the profile. We use fixed "teleport" profile name per the ProfileName constant.
	Name string `json:"name"`
	// Endpoint is the URL of the database endpoint
	Endpoint string `json:"endpoint"`
	// Certificate holds optional certificate info
	Certificate *Certificate `json:"certificate,omitempty"`
	// MaxRetry is the maximum number of retries to be made in case of error.
	MaxRetry int `json:"max_retry,omitempty"`
	// Timeout is the timeout used by the client.
	Timeout int `json:"timeout,omitempty"`
}

Profile represents single profile in opensearch-cli configuration

Jump to

Keyboard shortcuts

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