client

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(username, password string) string

BasicAuth encode username and password to be used with basic authentication header

Types

type Alias

type Alias struct {
	// Index name.
	Index string
	// Alias name.
	Name string
	// IsWritedIndex option
	IsWriteIndex bool
}

Alias represents ES alias.

type Client

type Client struct {
	// Http client.
	Client *http.Client
	// ES server endpoint.
	Endpoint string
	// Basic authentication string.
	BasicAuth string
}

Client is a generic client to make requests to ES

type ClusterAPI

type ClusterAPI interface {
	Version() (uint, error)
}

type ClusterClient

type ClusterClient struct {
	Client
}

ClusterClient is a client used to get ES cluster information

func (*ClusterClient) Version

func (c *ClusterClient) Version() (uint, error)

Version returns the major version of the ES cluster

type ILMClient

type ILMClient struct {
	Client
	MasterTimeoutSeconds int
}

ILMClient is a client used to manipulate Index lifecycle management policies.

func (ILMClient) Exists

func (i ILMClient) Exists(name string) (bool, error)

Exists verify if a ILM policy exists

type Index

type Index struct {
	// Index name.
	Index string
	// Index creation time.
	CreationTime time.Time
	// Aliases
	Aliases map[string]bool
}

Index represents ES index.

type IndexAPI

type IndexAPI interface {
	GetJaegerIndices(prefix string) ([]Index, error)
	DeleteIndices(indices []Index) error
	CreateIndex(index string) error
	CreateAlias(aliases []Alias) error
	DeleteAlias(aliases []Alias) error
	CreateTemplate(template, name string) error
	Rollover(rolloverTarget string, conditions map[string]interface{}) error
}

type IndexManagementLifecycleAPI

type IndexManagementLifecycleAPI interface {
	Exists(name string) (bool, error)
}

type IndicesClient

type IndicesClient struct {
	Client
	MasterTimeoutSeconds int
}

IndicesClient is a client used to manipulate indices.

func (*IndicesClient) CreateAlias

func (i *IndicesClient) CreateAlias(aliases []Alias) error

CreateAlias an ES specific set of index aliases

func (*IndicesClient) CreateIndex

func (i *IndicesClient) CreateIndex(index string) error

CreateIndex an ES index

func (IndicesClient) CreateTemplate

func (i IndicesClient) CreateTemplate(template, name string) error

CreateTemplate an ES index template

func (*IndicesClient) DeleteAlias

func (i *IndicesClient) DeleteAlias(aliases []Alias) error

DeleteAlias an ES specific set of index aliases

func (*IndicesClient) DeleteIndices

func (i *IndicesClient) DeleteIndices(indices []Index) error

DeleteIndices deletes specified set of indices.

func (*IndicesClient) GetJaegerIndices

func (i *IndicesClient) GetJaegerIndices(prefix string) ([]Index, error)

GetJaegerIndices queries all Jaeger indices including the archive and rollover. Jaeger daily indices are: - jaeger-span-2019-01-01 - jaeger-service-2019-01-01 - jaeger-dependencies-2019-01-01 - jaeger-span-archive

Rollover indices: - aliases: jaeger-span-read, jaeger-span-write, jaeger-service-read, jaeger-service-write - indices: jaeger-span-000001, jaeger-service-000001 etc. - aliases: jaeger-span-archive-read, jaeger-span-archive-write - indices: jaeger-span-archive-000001

func (IndicesClient) Rollover

func (i IndicesClient) Rollover(rolloverTarget string, conditions map[string]interface{}) error

Rollover create a rollover for certain index/alias

type ResponseError

type ResponseError struct {
	// Error returned by the http client
	Err error
	// StatusCode is the http code returned by the server (if any)
	StatusCode int
	// Body is the bytes readed in the response (if any)
	Body []byte
}

ResponseError holds information about a request error

func (ResponseError) Error

func (r ResponseError) Error() string

Error returns the error string of the Err field

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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