Documentation
¶
Index ¶
- Constants
- Variables
- func DoCommand(method string, url string, args map[string]interface{}, data interface{}) ([]byte, error)
- func QueryString(args map[string]interface{}) (s string, err error)
- func Scroll(duration string) string
- func SetHosts(newhosts []string)
- type BaseResponse
- type ClusterHealthResponse
- type ClusterStateMetadataResponse
- type ClusterStateNodeReponse
- type ClusterStateResponse
- type ClusterStateRoutingTableResponse
- type ESError
- type Explanation
- type ExtendedStatus
- type Facets
- type Filter
- type Match
- type NodeStatsFSDataResponse
- type NodeStatsFSResponse
- type NodeStatsHTTPResponse
- type NodeStatsIndicesDocsResponse
- type NodeStatsIndicesGetResponse
- type NodeStatsIndicesIndexingResponse
- type NodeStatsIndicesResponse
- type NodeStatsIndicesSearchResponse
- type NodeStatsIndicesStoreResponse
- type NodeStatsNetworkResponse
- type NodeStatsNodeResponse
- type NodeStatsOSCPUResponse
- type NodeStatsOSMemResponse
- type NodeStatsOSResponse
- type NodeStatsOSSwapResponse
- type NodeStatsProcessCPUResponse
- type NodeStatsProcessMemResponse
- type NodeStatsProcessResponse
- type NodeStatsReponse
- type NodeStatsTCPResponse
- type NodeStatsThreadPoolPoolResponse
- type NodeStatsTransportResponse
- type Query
- type Request
- func (r *Request) Do(v interface{}) (int, []byte, error)
- func (r *Request) DoResponse(v interface{}) (*http.Response, []byte, error)
- func (r *Request) SetBody(body io.Reader)
- func (r *Request) SetBodyBytes(body []byte)
- func (r *Request) SetBodyJson(data interface{}) error
- func (r *Request) SetBodyString(body string)
- type SearchRequest
- type Status
- type Term
- type Terms
Constants ¶
View Source
const ( Version = "0.0.2" DefaultProtocol = "http" DefaultDomain = "localhost" DefaultPort = "9200" // A decay duration of zero results in the default behaviour DefaultDecayDuration = 0 )
Variables ¶
View Source
var ( // Maintain these for backwards compatibility Protocol string = DefaultProtocol Domain string = DefaultDomain ClusterDomains [1]string = [1]string{DefaultDomain} Port string = DefaultPort Username string Password string BasePath string // Store a slice of hosts in a hostpool Hosts []string // To compute the weighting scores, we perform a weighted average of recent response times, // over the course of `DecayDuration`. DecayDuration may be set to 0 to use the default // value of 5 minutes. The EpsilonValueCalculator uses this to calculate a score // from the weighted average response time. DecayDuration time.Duration = time.Duration(DefaultDecayDuration * time.Second) )
Functions ¶
func QueryString ¶
Types ¶
type BaseResponse ¶
type BaseResponse struct {
Ok bool `json:"ok"`
Index string `json:"_index,omitempty"`
Type string `json:"_type,omitempty"`
Id string `json:"_id,omitempty"`
Source interface{} `json:"_source,omitempty"` // depends on the schema you've defined
Version int `json:"_version,omitempty"`
Found bool `json:"found,omitempty"`
Exists bool `json:"exists,omitempty"`
Matches []string `json:"matches,omitempty"` // percolate matches
}
type ClusterHealthResponse ¶
type ClusterHealthResponse struct {
ClusterName string `json:"cluster_name"`
Status string `json:"status"`
TimedOut bool `json:"timed_out"`
NumberOfNodes int `json:"number_of_nodes"`
NumberOfDataNodes int `json:"number_of_data_nodes"`
ActivePrimaryShards int `json:"active_primary_shards"`
ActiveShards int `json:"active_shards"`
RelocatingShards int `json:"relocating_shards"`
InitializingShards int `json:"initializing_shards"`
UnassignedShards int `json:"unassigned_shards"`
}
type ClusterStateMetadataResponse ¶
type ClusterStateMetadataResponse struct {
}
type ClusterStateNodeReponse ¶
type ClusterStateResponse ¶
type ClusterStateResponse struct {
ClusterName string `json:"cluster_name"`
MasterNode string `json:"master_node"`
Nodes map[string]ClusterStateNodeReponse `json:"nodes"`
}
type ClusterStateRoutingTableResponse ¶
type ClusterStateRoutingTableResponse struct {
}
type Explanation ¶
type Explanation struct {
Value float32 `json:"value"`
Description string `json:"description"`
Details []Explanation `json:"details,omitempty"`
}
type ExtendedStatus ¶
type Match ¶
type Match struct {
OK bool `json:"ok"`
Matches []string `json:"matches"`
Explanation Explanation `json:"explanation,omitempty"`
}
type NodeStatsFSDataResponse ¶
type NodeStatsFSDataResponse struct {
Path string `json:"path"`
Mount string `json:"mount"`
Device string `json:"dev"`
Total int64 `json:"total_in_bytes"`
Free int64 `json:"free_in_bytes"`
Available int64 `json:"available_in_bytes"`
DiskReads int64 `json:"disk_reads"`
DiskWrites int64 `json:"disk_writes"`
DiskReadSize int64 `json:"disk_read_size_in_bytes"`
DiskWriteSize int64 `json:"disk_write_size_in_bytes"`
}
type NodeStatsFSResponse ¶
type NodeStatsFSResponse struct {
Timestamp int64 `json:"timestamp"`
Data map[string]NodeStatsFSDataResponse `json:"data"`
}
type NodeStatsHTTPResponse ¶
type NodeStatsIndicesGetResponse ¶
type NodeStatsIndicesGetResponse struct {
Total int64 `json:"total"`
Time int64 `json:"time_in_millis"`
ExistsTotal int64 `json:"exists_total"`
ExistsTime int64 `json:"exists_time_in_millis"`
MissingTotal int64 `json:"missing_total"`
MissingTime int64 `json:"missing_time_in_millis"`
Current int64 `json:"current"`
}
type NodeStatsIndicesIndexingResponse ¶
type NodeStatsIndicesIndexingResponse struct {
IndexTotal int64 `json:"index_total"`
IndexTime int64 `json:"index_time_in_millis"`
IndexCurrent int64 `json:"index_current"`
DeleteTotal int64 `json:"delete_total"`
DeleteTime int64 `json:"delete_time_in_millis"`
DeleteCurrent int64 `json:"delete_current"`
}
type NodeStatsIndicesResponse ¶
type NodeStatsIndicesResponse struct {
Docs NodeStatsIndicesDocsResponse
Store NodeStatsIndicesStoreResponse
Indexing NodeStatsIndicesIndexingResponse
Get NodeStatsIndicesGetResponse
Search NodeStatsIndicesSearchResponse
}
type NodeStatsIndicesSearchResponse ¶
type NodeStatsIndicesSearchResponse struct {
OpenContext int64 `json:"open_contexts"`
QueryTotal int64 `json:"query_total"`
QueryTime int64 `json:"query_time_in_millis"`
QueryCurrent int64 `json:"query_current"`
FetchTotal int64 `json:"fetch_total"`
FetchTime int64 `json:"fetch_time_in_millis"`
FetchCurrent int64 `json:"fetch_current"`
}
type NodeStatsNetworkResponse ¶
type NodeStatsNetworkResponse struct {
TCP NodeStatsTCPResponse `json:"tcp"`
}
type NodeStatsNodeResponse ¶
type NodeStatsNodeResponse struct {
Name string `json:"name"`
Timestamp int64 `json:"timestamp"`
TransportAddress string `json:"transport_address"`
Hostname string `json:"hostname"`
Indices NodeStatsIndicesResponse `json:"indices"`
OS NodeStatsOSResponse `json:"os"`
Network NodeStatsNetworkResponse `json:"network"`
ThreadPool map[string]NodeStatsThreadPoolPoolResponse `json:"thread_pool"`
}
type NodeStatsOSCPUResponse ¶
type NodeStatsOSMemResponse ¶
type NodeStatsOSResponse ¶
type NodeStatsOSResponse struct {
Timestamp int64 `json:"timestamp"`
Uptime int64 `json:"uptime_in_millis"`
LoadAvg []float64 `json:"load_average"`
CPU NodeStatsOSCPUResponse `json:"cpu"`
Mem NodeStatsOSMemResponse `json:"mem"`
Swap NodeStatsOSSwapResponse `json:"swap"`
}
type NodeStatsOSSwapResponse ¶
type NodeStatsProcessResponse ¶
type NodeStatsProcessResponse struct {
Timestamp int64 `json:"timestamp"`
OpenFD int64 `json:"open_file_descriptors"`
CPU NodeStatsProcessCPUResponse `json:"cpu"`
Memory NodeStatsProcessMemResponse `json:"mem"`
}
type NodeStatsReponse ¶
type NodeStatsReponse struct {
ClusterName string `json:"cluster_name"`
Nodes map[string]NodeStatsNodeResponse
}
type NodeStatsTCPResponse ¶
type NodeStatsTCPResponse struct {
ActiveOpens int64 `json:"active_opens"`
PassiveOpens int64 `json:"passive_opens"`
CurrEstab int64 `json:"curr_estab"`
InSegs int64 `json:"in_segs"`
OutSegs int64 `json:"out_segs"`
RetransSegs int64 `json:"retrans_segs"`
EstabResets int64 `json:"estab_resets"`
AttemptFails int64 `json:"attempt_fails"`
InErrs int64 `json:"in_errs"`
OutRsts int64 `json:"out_rsts"`
}
type Request ¶
func ElasticSearchRequest ¶
func (*Request) DoResponse ¶
func (*Request) SetBodyBytes ¶
func (*Request) SetBodyJson ¶
func (*Request) SetBodyString ¶
type SearchRequest ¶
Click to show internal directories.
Click to hide internal directories.