Documentation
¶
Index ¶
- Constants
- func CompactJson(data string) (string, error)
- func CompareJson(data1 string, data2 string) bool
- func ContainsString(slice []string, s string) bool
- func EsVersion(rawurl string) (int, error)
- func FilterByNamespacesRegex(meta metav1.Object, regex string, log logr.Logger) bool
- func GetElasticsearchVersion(jsonBody string) (int, error)
- func GetSecret(namespace string, secretKeySelector *v1.SecretKeySelector, ...) (*v1.Secret, error)
- func IsValidUpdateProperties(oldProperties string, newProperties string) bool
- func RemoveString(slice []string, s string) (result []string)
- func StreamToString(r io.Reader) (res string, err error)
- type Elasticsearch
- type Elasticsearch7
- func (es *Elasticsearch7) CreateOrUpdateIndex(ctx context.Context, indexName string, model string) (*EsStatus, error)
- func (es *Elasticsearch7) CreateOrUpdateTemplate(ctx context.Context, templateName string, model string, order *int) (*EsStatus, error)
- func (es *Elasticsearch7) DeleteIndex(ctx context.Context, indexName string) error
- func (es *Elasticsearch7) DeleteTemplate(ctx context.Context, templateName string) error
- func (es *Elasticsearch7) NewClient(config *EsConfig, log logr.Logger) error
- func (es *Elasticsearch7) PingES(ctx context.Context) error
- type Elasticsearch8
- func (es *Elasticsearch8) CreateOrUpdateIndex(ctx context.Context, indexName string, model string) (*EsStatus, error)
- func (es *Elasticsearch8) CreateOrUpdateTemplate(ctx context.Context, templateName string, model string, order *int) (*EsStatus, error)
- func (es *Elasticsearch8) DeleteIndex(ctx context.Context, indexName string) error
- func (es *Elasticsearch8) DeleteTemplate(ctx context.Context, templateName string) error
- func (es *Elasticsearch8) NewClient(config *EsConfig, log logr.Logger) error
- func (es *Elasticsearch8) PingES(ctx context.Context) error
- type EsConfig
- type EsMappings
- type EsModel
- func (m *EsModel) AddSettings(replicas int32, shards int32) (string, error)
- func (m *EsModel) GetNumberOfReplicas() (*int32, error)
- func (m *EsModel) GetNumberOfShards() (*int32, error)
- func (m *EsModel) GetProperties() *string
- func (m *EsModel) IsMappingWithType() *bool
- func (m *EsModel) IsValid(mType string) (bool, error)
- type EsSettings
- type EsStatus
- type HttpCodeStatus
Constants ¶
View Source
const ( StatusCreated = "Created" StatusRetry = "Retry" StatusError = "Error" Index = "Index" Template = "Template" ElasticMainFnTimeout time.Duration = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func CompactJson ¶
func CompareJson ¶
func ContainsString ¶
func FilterByNamespacesRegex ¶
func GetElasticsearchVersion ¶ added in v1.2.0
func IsValidUpdateProperties ¶
func RemoveString ¶
Types ¶
type Elasticsearch ¶
type Elasticsearch interface { NewClient(config *EsConfig, log logr.Logger) error PingES(ctx context.Context) error CreateOrUpdateIndex(ctx context.Context, indexName string, model string) (*EsStatus, error) DeleteIndex(ctx context.Context, indexName string) error CreateOrUpdateTemplate(ctx context.Context, templateName string, model string, order *int) (*EsStatus, error) DeleteTemplate(ctx context.Context, templateName string) error }
type Elasticsearch7 ¶ added in v1.2.0
type Elasticsearch7 struct { Config *EsConfig Client *elasticsearch.Client // contains filtered or unexported fields }
func (*Elasticsearch7) CreateOrUpdateIndex ¶ added in v1.2.0
func (*Elasticsearch7) CreateOrUpdateTemplate ¶ added in v1.2.0
func (*Elasticsearch7) DeleteIndex ¶ added in v1.2.0
func (es *Elasticsearch7) DeleteIndex(ctx context.Context, indexName string) error
func (*Elasticsearch7) DeleteTemplate ¶ added in v1.2.0
func (es *Elasticsearch7) DeleteTemplate(ctx context.Context, templateName string) error
type Elasticsearch8 ¶ added in v1.2.0
type Elasticsearch8 struct { Config *EsConfig Client *elasticsearch.Client // contains filtered or unexported fields }
func (*Elasticsearch8) CreateOrUpdateIndex ¶ added in v1.2.0
func (*Elasticsearch8) CreateOrUpdateTemplate ¶ added in v1.2.0
func (*Elasticsearch8) DeleteIndex ¶ added in v1.2.0
func (es *Elasticsearch8) DeleteIndex(ctx context.Context, indexName string) error
func (*Elasticsearch8) DeleteTemplate ¶ added in v1.2.0
func (es *Elasticsearch8) DeleteTemplate(ctx context.Context, templateName string) error
type EsConfig ¶
type EsConfig struct { Scheme string Host string Port string Username string Password string Version int }
type EsMappings ¶
type EsMappings struct {
Mappings string
}
func (EsMappings) GetProperties ¶
func (m EsMappings) GetProperties(indexName string) *string
type EsModel ¶
type EsModel struct {
Model string
}
func (*EsModel) AddSettings ¶
func (*EsModel) GetNumberOfReplicas ¶
func (*EsModel) GetNumberOfShards ¶
func (*EsModel) GetProperties ¶
func (*EsModel) IsMappingWithType ¶
type EsSettings ¶
type EsSettings struct {
Settings string
}
func (*EsSettings) GetNumberOfReplicas ¶
func (s *EsSettings) GetNumberOfReplicas(indexName string) (*int32, error)
func (*EsSettings) GetNumberOfShards ¶
func (s *EsSettings) GetNumberOfShards(indexName string) (*int32, error)
type EsStatus ¶
func BuildEsStatus ¶
type HttpCodeStatus ¶
type HttpCodeStatus string
const ( Http1xx HttpCodeStatus = "1xx" Http2xx HttpCodeStatus = "2xx" Http3xx HttpCodeStatus = "3xx" Http4xx HttpCodeStatus = "4xx" Http5xx HttpCodeStatus = "5xx" )
Click to show internal directories.
Click to hide internal directories.