Documentation ¶
Index ¶
- Constants
- type Backend
- type Elastic
- func (es *Elastic) CreateIndex(index string, body io.Reader) (int, error)
- func (es *Elastic) Delete(index, esType, id string) (int, error)
- func (es *Elastic) DeleteIndex(index string) (int, error)
- func (es *Elastic) GetByID(index, esType, id string, Response interface{}) (int, error)
- func (es *Elastic) GetHead(index, esType, id string) (int, error)
- func (es *Elastic) Post(index, esType, id string, obj interface{}) (int, error)
- func (es *Elastic) PostBulk(body io.Reader) (int, error)
- func (es *Elastic) Put(index, esType, id string, obj interface{}) (int, error)
- func (es *Elastic) Query(index, esType string, query, response interface{}) (int, error)
- type Settings
Constants ¶
View Source
const ( // HEAD is an http method constant HEAD = "HEAD" // GET is an http method constant GET = "GET" // POST is an http method constant POST = "POST" // PUT is an http method constant PUT = "PUT" // DELETE is an http method constant DELETE = "DELETE" )
View Source
const ( // ConfigWeightedBackend is the constant that should appear in the configuration to create // a weighted backend ConfigWeightedBackend = "weighted" // ConfigSimpleBackend is the constant that should appear in the configuration to create // a simple backend ConfigSimpleBackend = "simple" )
View Source
const NoIndex = ""
NoIndex is the index to be given to the request functions when there is no index
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { Request(index, method, path string, body io.Reader) (int, []byte, error) CountRetries() uint64 }
Backend defines a way to connect to elasticsearch
type Elastic ¶
type Elastic struct {
Backend
}
Elastic is a wrapper that creates helper functions around the backend
func (*Elastic) CreateIndex ¶
CreateIndex creates an index in the cluster
func (*Elastic) DeleteIndex ¶
DeleteIndex deletes an index in the cluster
Click to show internal directories.
Click to hide internal directories.