Documentation ¶
Index ¶
- Constants
- func CreateMockClient(fixtureFiles []string, statusCode int) (*elasticsearch.Client, error)
- func ElasticConfig(env string, testOverwrite, tls bool) models.Config
- func ElasticService(tls bool) string
- func GetCert(env string, testOverWrite bool) []byte
- func HealthCheck(client Client) error
- type Access
- type AccessImpl
- type Builder
- type BuilderImpl
- func (b *BuilderImpl) Aggregate(aggregate, field string) map[string]interface{}
- func (b *BuilderImpl) CreateTraceIndexMapping(policyName string) map[string]interface{}
- func (b *BuilderImpl) DictionaryIndex(min, max int, policyName string) map[string]interface{}
- func (b *BuilderImpl) FilteredAggregate(term, queryWord, aggregate, field string) map[string]interface{}
- func (b *BuilderImpl) GrammarIndex(policyName string) map[string]interface{}
- func (b *BuilderImpl) Index() map[string]interface{}
- func (b *BuilderImpl) MatchAll() map[string]interface{}
- func (b *BuilderImpl) MatchPhrasePrefixed(queryWord, field string) map[string]interface{}
- func (b *BuilderImpl) MatchQuery(term, queryWord string) map[string]interface{}
- func (b *BuilderImpl) MultiMatchWithGram(queryWord, field string) map[string]interface{}
- func (b *BuilderImpl) MultipleMatch(mappedFields []map[string]string) map[string]interface{}
- func (b *BuilderImpl) QuizIndex(policyName string) map[string]interface{}
- func (b *BuilderImpl) SearchAsYouTypeIndex(searchWord string) map[string]interface{}
- func (b *BuilderImpl) TextIndex(policyName string) map[string]interface{}
- type BulkResponse
- type Client
- type Document
- type DocumentImpl
- func (d *DocumentImpl) AddItemToDocument(index, id, body, paramName string) (*models.CreateResult, error)
- func (d *DocumentImpl) Bulk(buf bytes.Buffer, index string) (*BulkResponse, error)
- func (d *DocumentImpl) Create(index string, body []byte) (*models.CreateResult, error)
- func (d *DocumentImpl) CreateWithId(index, documentId string, body []byte) (*models.CreateResult, error)
- func (d *DocumentImpl) CreateWithIdAndFirstItem(index, documentId, body, paramName string) (*models.CreateResult, error)
- func (d *DocumentImpl) Update(index, id string, body []byte) (*models.CreateResult, error)
- type Elastic
- type Health
- type HealthImpl
- type Index
- type IndexImpl
- func (i *IndexImpl) Create(index string, request map[string]interface{}) (*models.IndexCreateResult, error)
- func (i *IndexImpl) CreateDocument(index string, body []byte) (*models.CreateResult, error)
- func (i *IndexImpl) CreateWithAlias(indexName string, request map[string]interface{}) (*models.IndexCreateResult, error)
- func (i *IndexImpl) Delete(index string) (bool, error)
- func (i *IndexImpl) Update(index string, request map[string]interface{}) (*models.IndexCreateResult, error)
- type MockTransport
- type Policy
- type PolicyImpl
- func (p *PolicyImpl) CreateColdPolicy(name string) (*models.IndexCreateResult, error)
- func (p *PolicyImpl) CreateHotPolicy(name string) (*models.IndexCreateResult, error)
- func (p *PolicyImpl) CreatePolicyWithRollOver(name, maxAge, phase string) (*models.IndexCreateResult, error)
- func (p *PolicyImpl) CreateWarmPolicy(name string) (*models.IndexCreateResult, error)
- type Query
- type QueryImpl
- func (q *QueryImpl) Match(index string, request map[string]interface{}) (*models.Response, error)
- func (q *QueryImpl) MatchAggregate(index string, request map[string]interface{}) (*models.Aggregations, error)
- func (q *QueryImpl) MatchWithScroll(index string, request map[string]interface{}) (*models.Response, error)
- func (q *QueryImpl) MatchWithSort(index, direction, sortField string, size int, request map[string]interface{}) (*models.Response, error)
Constants ¶
View Source
const ( EnvElasticService = "ELASTIC_SEARCH_SERVICE" EnvElasticUser = "ELASTIC_SEARCH_USER" EnvElasticPassword = "ELASTIC_SEARCH_PASSWORD" )
View Source
const ( HOT = "hot" WARM = "warm" COLD = "cold" )
Variables ¶
This section is empty.
Functions ¶
func CreateMockClient ¶
func ElasticConfig ¶ added in v0.1.1
func ElasticService ¶ added in v0.1.1
func HealthCheck ¶ added in v0.1.1
Types ¶
type Access ¶
type Access interface { CreateRole(name string, roleRequest models.CreateRoleRequest) (bool, error) CreateUser(name string, userCreation models.CreateUserRequest) (bool, error) }
type AccessImpl ¶
type AccessImpl struct {
// contains filtered or unexported fields
}
func NewAccessImpl ¶
func NewAccessImpl(suppliedClient *elasticsearch.Client) (*AccessImpl, error)
func (*AccessImpl) CreateRole ¶
func (a *AccessImpl) CreateRole(name string, roleRequest models.CreateRoleRequest) (bool, error)
func (*AccessImpl) CreateUser ¶
func (a *AccessImpl) CreateUser(name string, userCreation models.CreateUserRequest) (bool, error)
type Builder ¶
type Builder interface { MatchQuery(term, queryWord string) map[string]interface{} MatchAll() map[string]interface{} MultipleMatch(mappedFields []map[string]string) map[string]interface{} MultiMatchWithGram(queryWord, field string) map[string]interface{} MatchPhrasePrefixed(queryWord, field string) map[string]interface{} Aggregate(aggregate, field string) map[string]interface{} FilteredAggregate(term, queryWord, aggregate, field string) map[string]interface{} SearchAsYouTypeIndex(searchWord string) map[string]interface{} Index() map[string]interface{} TextIndex(policyName string) map[string]interface{} DictionaryIndex(min, max int, policyName string) map[string]interface{} GrammarIndex(policyName string) map[string]interface{} CreateTraceIndexMapping(policyName string) map[string]interface{} QuizIndex(policyName string) map[string]interface{} }
type BuilderImpl ¶
type BuilderImpl struct { }
func NewBuilderImpl ¶
func NewBuilderImpl() *BuilderImpl
func (*BuilderImpl) Aggregate ¶
func (b *BuilderImpl) Aggregate(aggregate, field string) map[string]interface{}
func (*BuilderImpl) CreateTraceIndexMapping ¶ added in v0.4.1
func (b *BuilderImpl) CreateTraceIndexMapping(policyName string) map[string]interface{}
func (*BuilderImpl) DictionaryIndex ¶ added in v0.3.3
func (b *BuilderImpl) DictionaryIndex(min, max int, policyName string) map[string]interface{}
func (*BuilderImpl) FilteredAggregate ¶
func (b *BuilderImpl) FilteredAggregate(term, queryWord, aggregate, field string) map[string]interface{}
func (*BuilderImpl) GrammarIndex ¶ added in v0.3.3
func (b *BuilderImpl) GrammarIndex(policyName string) map[string]interface{}
func (*BuilderImpl) Index ¶
func (b *BuilderImpl) Index() map[string]interface{}
func (*BuilderImpl) MatchAll ¶
func (b *BuilderImpl) MatchAll() map[string]interface{}
func (*BuilderImpl) MatchPhrasePrefixed ¶ added in v0.3.5
func (b *BuilderImpl) MatchPhrasePrefixed(queryWord, field string) map[string]interface{}
func (*BuilderImpl) MatchQuery ¶
func (b *BuilderImpl) MatchQuery(term, queryWord string) map[string]interface{}
func (*BuilderImpl) MultiMatchWithGram ¶
func (b *BuilderImpl) MultiMatchWithGram(queryWord, field string) map[string]interface{}
func (*BuilderImpl) MultipleMatch ¶
func (b *BuilderImpl) MultipleMatch(mappedFields []map[string]string) map[string]interface{}
func (*BuilderImpl) QuizIndex ¶ added in v0.3.3
func (b *BuilderImpl) QuizIndex(policyName string) map[string]interface{}
func (*BuilderImpl) SearchAsYouTypeIndex ¶
func (b *BuilderImpl) SearchAsYouTypeIndex(searchWord string) map[string]interface{}
func (*BuilderImpl) TextIndex ¶ added in v0.3.3
func (b *BuilderImpl) TextIndex(policyName string) map[string]interface{}
type BulkResponse ¶ added in v0.6.0
type BulkResponse struct { Errors bool `json:"errors"` Items []struct { Index struct { ID string `json:"_id"` Result string `json:"result"` Status int `json:"status"` Error struct { Type string `json:"type"` Reason string `json:"reason"` Cause struct { Type string `json:"type"` Reason string `json:"reason"` } `json:"caused_by"` } `json:"error"` } `json:"index"` } `json:"items"` }
type Client ¶
type Client interface { Query() Query Document() Document Index() Index Builder() Builder Health() Health Access() Access Policy() Policy }
func NewMockClient ¶
type Document ¶ added in v0.1.5
type Document interface { Create(index string, body []byte) (*models.CreateResult, error) Update(index, id string, body []byte) (*models.CreateResult, error) AddItemToDocument(index, id, body, paramName string) (*models.CreateResult, error) CreateWithId(index, documentId string, body []byte) (*models.CreateResult, error) CreateWithIdAndFirstItem(index, documentId, body, paramName string) (*models.CreateResult, error) Bulk(buf bytes.Buffer, index string) (*BulkResponse, error) }
type DocumentImpl ¶ added in v0.1.5
type DocumentImpl struct {
// contains filtered or unexported fields
}
func NewDocumentImpl ¶ added in v0.1.5
func NewDocumentImpl(suppliedClient *elasticsearch.Client) (*DocumentImpl, error)
func (*DocumentImpl) AddItemToDocument ¶ added in v0.4.1
func (d *DocumentImpl) AddItemToDocument(index, id, body, paramName string) (*models.CreateResult, error)
func (*DocumentImpl) Bulk ¶ added in v0.6.0
func (d *DocumentImpl) Bulk(buf bytes.Buffer, index string) (*BulkResponse, error)
func (*DocumentImpl) Create ¶ added in v0.1.5
func (d *DocumentImpl) Create(index string, body []byte) (*models.CreateResult, error)
func (*DocumentImpl) CreateWithId ¶ added in v0.4.1
func (d *DocumentImpl) CreateWithId(index, documentId string, body []byte) (*models.CreateResult, error)
func (*DocumentImpl) CreateWithIdAndFirstItem ¶ added in v0.4.1
func (d *DocumentImpl) CreateWithIdAndFirstItem(index, documentId, body, paramName string) (*models.CreateResult, error)
func (*DocumentImpl) Update ¶ added in v0.1.5
func (d *DocumentImpl) Update(index, id string, body []byte) (*models.CreateResult, error)
type Health ¶
type Health interface { Check(ticks, tick time.Duration) bool Info() (elasticHealth models.DatabaseHealth) }
type HealthImpl ¶
type HealthImpl struct {
// contains filtered or unexported fields
}
func NewHealthImpl ¶
func NewHealthImpl(suppliedClient *elasticsearch.Client) (*HealthImpl, error)
func (*HealthImpl) Info ¶
func (h *HealthImpl) Info() (elasticHealth models.DatabaseHealth)
type Index ¶
type Index interface { CreateDocument(index string, body []byte) (*models.CreateResult, error) Create(index string, request map[string]interface{}) (*models.IndexCreateResult, error) CreateWithAlias(indexName string, request map[string]interface{}) (*models.IndexCreateResult, error) Delete(index string) (bool, error) }
type IndexImpl ¶
type IndexImpl struct {
// contains filtered or unexported fields
}
func NewIndexImpl ¶
func (*IndexImpl) CreateDocument ¶
func (*IndexImpl) CreateWithAlias ¶ added in v0.4.1
type MockTransport ¶
type Policy ¶ added in v0.4.3
type Policy interface { CreatePolicyWithRollOver(name, maxAge, phase string) (*models.IndexCreateResult, error) CreateHotPolicy(name string) (*models.IndexCreateResult, error) CreateWarmPolicy(name string) (*models.IndexCreateResult, error) CreateColdPolicy(name string) (*models.IndexCreateResult, error) }
type PolicyImpl ¶ added in v0.4.3
type PolicyImpl struct {
// contains filtered or unexported fields
}
func NewPolicyImpl ¶ added in v0.4.3
func NewPolicyImpl(suppliedClient *elasticsearch.Client) (*PolicyImpl, error)
func (*PolicyImpl) CreateColdPolicy ¶ added in v0.4.3
func (p *PolicyImpl) CreateColdPolicy(name string) (*models.IndexCreateResult, error)
func (*PolicyImpl) CreateHotPolicy ¶ added in v0.4.3
func (p *PolicyImpl) CreateHotPolicy(name string) (*models.IndexCreateResult, error)
func (*PolicyImpl) CreatePolicyWithRollOver ¶ added in v0.4.3
func (p *PolicyImpl) CreatePolicyWithRollOver(name, maxAge, phase string) (*models.IndexCreateResult, error)
func (*PolicyImpl) CreateWarmPolicy ¶ added in v0.4.3
func (p *PolicyImpl) CreateWarmPolicy(name string) (*models.IndexCreateResult, error)
type Query ¶
type Query interface { Match(index string, request map[string]interface{}) (*models.Response, error) MatchWithSort(index, mode, sort string, size int, request map[string]interface{}) (*models.Response, error) MatchWithScroll(index string, request map[string]interface{}) (*models.Response, error) MatchAggregate(index string, request map[string]interface{}) (*models.Aggregations, error) }
type QueryImpl ¶
type QueryImpl struct {
// contains filtered or unexported fields
}
func NewQueryImpl ¶
func (*QueryImpl) MatchAggregate ¶
func (*QueryImpl) MatchWithScroll ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.