Documentation ¶
Index ¶
- Constants
- func AddRawFixture(name string, data []byte)
- func CreateMockClient(fixtureFiles []string, statusCode int) (*elasticsearch.Client, error)
- func ElasticConfig(tls bool) (models.Config, error)
- func ElasticService(tls bool) string
- func GetCert() ([]byte, error)
- func HealthCheck(client Client) error
- type Access
- type AccessImpl
- func (a *AccessImpl) CreateRole(name string, roleRequest models.CreateRoleRequest) (bool, error)
- func (a *AccessImpl) CreateUser(name string, userCreation models.CreateUserRequest) (bool, error)
- func (a *AccessImpl) DeleteUser(name string) (bool, error)
- func (a *AccessImpl) ListUsers() ([]string, error)
- 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) IndexExists(index string) (bool, *models.IndexInfo, 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) MatchRaw(index string, request map[string]interface{}) ([]byte, 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 AddRawFixture ¶ added in v0.1.2
func CreateMockClient ¶
func ElasticService ¶
func HealthCheck ¶
Types ¶
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)
func (*AccessImpl) DeleteUser ¶ added in v0.1.13
func (a *AccessImpl) DeleteUser(name string) (bool, error)
func (*AccessImpl) ListUsers ¶ added in v0.1.13
func (a *AccessImpl) ListUsers() ([]string, 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 ¶
func (b *BuilderImpl) CreateTraceIndexMapping(policyName string) map[string]interface{}
func (*BuilderImpl) DictionaryIndex ¶
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 ¶
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 ¶
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 ¶
func (b *BuilderImpl) QuizIndex(policyName string) map[string]interface{}
func (*BuilderImpl) SearchAsYouTypeIndex ¶
func (b *BuilderImpl) SearchAsYouTypeIndex(searchWord string) map[string]interface{}
func (*BuilderImpl) TextIndex ¶
func (b *BuilderImpl) TextIndex(policyName string) map[string]interface{}
type BulkResponse ¶
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 ¶
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 ¶
type DocumentImpl struct {
// contains filtered or unexported fields
}
func NewDocumentImpl ¶
func NewDocumentImpl(suppliedClient *elasticsearch.Client) (*DocumentImpl, error)
func (*DocumentImpl) AddItemToDocument ¶
func (d *DocumentImpl) AddItemToDocument(index, id, body, paramName string) (*models.CreateResult, error)
func (*DocumentImpl) Bulk ¶
func (d *DocumentImpl) Bulk(buf bytes.Buffer, index string) (*BulkResponse, error)
func (*DocumentImpl) Create ¶
func (d *DocumentImpl) Create(index string, body []byte) (*models.CreateResult, error)
func (*DocumentImpl) CreateWithId ¶
func (d *DocumentImpl) CreateWithId(index, documentId string, body []byte) (*models.CreateResult, error)
func (*DocumentImpl) CreateWithIdAndFirstItem ¶
func (d *DocumentImpl) CreateWithIdAndFirstItem(index, documentId, body, paramName string) (*models.CreateResult, error)
func (*DocumentImpl) Update ¶
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) IndexExists(index string) (bool, *models.IndexInfo, error) }
type IndexImpl ¶
type IndexImpl struct {
// contains filtered or unexported fields
}
func NewIndexImpl ¶
func (*IndexImpl) CreateDocument ¶
func (*IndexImpl) CreateWithAlias ¶
func (*IndexImpl) IndexExists ¶ added in v0.1.11
type MockTransport ¶
type Policy ¶
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 ¶
type PolicyImpl struct {
// contains filtered or unexported fields
}
func NewPolicyImpl ¶
func NewPolicyImpl(suppliedClient *elasticsearch.Client) (*PolicyImpl, error)
func (*PolicyImpl) CreateColdPolicy ¶
func (p *PolicyImpl) CreateColdPolicy(name string) (*models.IndexCreateResult, error)
func (*PolicyImpl) CreateHotPolicy ¶
func (p *PolicyImpl) CreateHotPolicy(name string) (*models.IndexCreateResult, error)
func (*PolicyImpl) CreatePolicyWithRollOver ¶
func (p *PolicyImpl) CreatePolicyWithRollOver(name, maxAge, phase string) (*models.IndexCreateResult, error)
func (*PolicyImpl) CreateWarmPolicy ¶
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) MatchRaw(index string, request map[string]interface{}) ([]byte, 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.