elasticsearch

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIndexName

func CreateIndexName(aliasName string) string

func ResolveAliasName

func ResolveAliasName(prefix string, mappingName string) string

Types

type Client

type Client interface {
	IndexExist(indexName string) (bool, error)
	AliasExist(aliasName string) (bool, error)

	CreateIndex(indexName string, mapping configuration.Index) error
	CreateAlias(aliasName string, indexName string) error

	UpdateAlias(aliasName string, newIndexName string) error

	GetAliasedIndex(aliasName string) (string, error)
	GetIndexConfiguration(indexName string) (configuration.Index, error)

	UpdateIndexConfiguration(indexName string, configuration configuration.Index) error

	Reindex(sourceIndexName string, targetIndexName string) error
}

Client is an Elasticsearch client. Create one by calling New.

func New

func New(options Options) (Client, error)

New creates a Client instance.

type MockClient

type MockClient struct {
	mock.Mock
}

func NewMockClient

func NewMockClient() *MockClient

func (*MockClient) AliasExist

func (mc *MockClient) AliasExist(aliasName string) (bool, error)

func (*MockClient) CreateAlias

func (mc *MockClient) CreateAlias(aliasName string, indexName string) error

func (*MockClient) CreateIndex

func (mc *MockClient) CreateIndex(indexName string, mapping configuration.Index) error

func (*MockClient) GetAliasedIndex

func (mc *MockClient) GetAliasedIndex(aliasName string) (string, error)

func (*MockClient) GetIndexConfiguration

func (mc *MockClient) GetIndexConfiguration(indexName string) (configuration.Index, error)

func (*MockClient) IndexExist

func (mc *MockClient) IndexExist(indexName string) (bool, error)

func (*MockClient) Reindex

func (mc *MockClient) Reindex(sourceIndexName string, targetIndexName string) error

func (*MockClient) UpdateAlias

func (mc *MockClient) UpdateAlias(aliasName string, newIndexName string) error

func (*MockClient) UpdateIndexConfiguration

func (mc *MockClient) UpdateIndexConfiguration(indexName string, configuration configuration.Index) error

type Options

type Options struct {
	Host     string
	User     string
	Password string
	Debug    bool
}

Options is a set of flags to configure a Client.

type V6Client

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

V6Client is an Elasticsearch client for elasticsearch v6. Create one by calling NewV6Client.

func NewV6Client

func NewV6Client(
	options Options,
) (*V6Client, error)

NewV6Client creates a V6Client instance.

func (*V6Client) AliasExist

func (c *V6Client) AliasExist(aliasName string) (bool, error)

func (*V6Client) CreateAlias

func (c *V6Client) CreateAlias(aliasName string, indexName string) error

func (*V6Client) CreateIndex

func (c *V6Client) CreateIndex(indexName string, mapping configuration.Index) error

func (*V6Client) GetAliasedIndex

func (c *V6Client) GetAliasedIndex(aliasName string) (string, error)

func (*V6Client) GetIndexConfiguration

func (c *V6Client) GetIndexConfiguration(indexName string) (configuration.Index, error)

func (*V6Client) IndexExist

func (c *V6Client) IndexExist(indexName string) (bool, error)

func (*V6Client) Reindex

func (c *V6Client) Reindex(sourceIndexName string, targetIndexName string) error

func (*V6Client) UpdateAlias

func (c *V6Client) UpdateAlias(aliasName string, indexName string) error

func (*V6Client) UpdateIndexConfiguration

func (c *V6Client) UpdateIndexConfiguration(indexName string, configuration configuration.Index) error

type V7Client

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

V7Client is an Elasticsearch client for elasticsearch v6. Create one by calling NewV7Client.

func NewV7Client

func NewV7Client(
	options Options,
) (*V7Client, error)

NewV7Client creates a V6Client instance.

func (*V7Client) AliasExist

func (c *V7Client) AliasExist(aliasName string) (bool, error)

func (*V7Client) CreateAlias

func (c *V7Client) CreateAlias(aliasName string, indexName string) error

func (*V7Client) CreateIndex

func (c *V7Client) CreateIndex(indexName string, mapping configuration.Index) error

func (*V7Client) GetAliasedIndex

func (c *V7Client) GetAliasedIndex(aliasName string) (string, error)

func (*V7Client) GetIndexConfiguration

func (c *V7Client) GetIndexConfiguration(indexName string) (configuration.Index, error)

func (*V7Client) IndexExist

func (c *V7Client) IndexExist(indexName string) (bool, error)

func (*V7Client) Reindex

func (c *V7Client) Reindex(sourceIndexName string, targetIndexName string) error

func (*V7Client) UpdateAlias

func (c *V7Client) UpdateAlias(aliasName string, indexName string) error

func (*V7Client) UpdateIndexConfiguration

func (c *V7Client) UpdateIndexConfiguration(indexName string, configuration configuration.Index) error

Jump to

Keyboard shortcuts

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