Documentation ¶
Index ¶
- func ConstructMappingSchema(name string, items map[string]MappingElementTypeName) (piazza.JsonString, error)
- func IndexExists(sys *piazza.SystemConfig, index string) (bool, error)
- func IsValidArrayTypeMapping(mappingValue interface{}) bool
- func IsValidMappingType(mappingValue interface{}) bool
- func PollFunction(fn GetData) (bool, error)
- type DeleteResponse
- type GetData
- type GetResult
- type IIndex
- type Index
- func (esi *Index) Close() error
- func (esi *Index) Create(settings string) error
- func (esi *Index) Delete() error
- func (esi *Index) DeleteByID(typ string, id string) (*DeleteResponse, error)
- func (esi *Index) DeleteByIDWait(typ string, id string) (*DeleteResponse, error)
- func (esi *Index) DirectAccess(verb string, endpoint string, input interface{}, output interface{}) error
- func (esi *Index) FilterByMatchAll(typ string, realFormat *piazza.JsonPagination) (*SearchResult, error)
- func (esi *Index) FilterByMatchQuery(typ string, name string, value interface{}, realFormat *piazza.JsonPagination) (*SearchResult, error)
- func (esi *Index) FilterByTermQuery(typ string, name string, value interface{}, realFormat *piazza.JsonPagination) (*SearchResult, error)
- func (esi *Index) GetAllElements(typ string) (*SearchResult, error)
- func (esi *Index) GetByID(typ string, id string) (*GetResult, error)
- func (esi *Index) GetMapping(typ string) (interface{}, error)
- func (esi *Index) GetTypes() ([]string, error)
- func (esi *Index) GetVersion() string
- func (esi *Index) IndexExists() (bool, error)
- func (esi *Index) IndexName() string
- func (esi *Index) ItemExists(typ string, id string) (bool, error)
- func (esi *Index) PostData(typ string, id string, obj interface{}) (*IndexResponse, error)
- func (esi *Index) PutData(typ string, id string, obj interface{}) (*IndexResponse, error)
- func (esi *Index) SearchByJSON(typ string, jsn string) (*SearchResult, error)
- func (esi *Index) SetMapping(typename string, jsn piazza.JsonString) error
- func (esi *Index) TypeExists(typ string) (bool, error)
- type IndexResponse
- type MappingElementTypeName
- type MockIndex
- func (esi *MockIndex) Close() error
- func (esi *MockIndex) Create(settings string) error
- func (esi *MockIndex) Delete() error
- func (esi *MockIndex) DeleteByID(typeName string, id string) (*DeleteResponse, error)
- func (esi *MockIndex) DeleteByIDWait(typeName string, id string) (*DeleteResponse, error)
- func (esi *MockIndex) DirectAccess(verb string, endpoint string, input interface{}, output interface{}) error
- func (esi *MockIndex) FilterByMatchAll(typeName string, realFormat *piazza.JsonPagination) (*SearchResult, error)
- func (esi *MockIndex) FilterByMatchQuery(typ string, name string, value interface{}, realFormat *piazza.JsonPagination) (*SearchResult, error)
- func (esi *MockIndex) FilterByTermQuery(typeName string, name string, value interface{}, ...) (*SearchResult, error)
- func (esi *MockIndex) GetAllElements(typ string) (*SearchResult, error)
- func (esi *MockIndex) GetByID(typeName string, id string) (*GetResult, error)
- func (esi *MockIndex) GetMapping(typ string) (interface{}, error)
- func (esi *MockIndex) GetTypes() ([]string, error)
- func (esi *MockIndex) GetVersion() string
- func (esi *MockIndex) IndexExists() (bool, error)
- func (esi *MockIndex) IndexName() string
- func (esi *MockIndex) ItemExists(typeName string, id string) (bool, error)
- func (esi *MockIndex) PostData(typeName string, id string, obj interface{}) (*IndexResponse, error)
- func (esi *MockIndex) PutData(typeName string, id string, obj interface{}) (*IndexResponse, error)
- func (esi *MockIndex) SearchByJSON(typ string, jsn string) (*SearchResult, error)
- func (esi *MockIndex) SetMapping(typeName string, mapping piazza.JsonString) error
- func (esi *MockIndex) TypeExists(typ string) (bool, error)
- type MockIndexType
- type QueryFormat
- type SearchResult
- type SearchResultHit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructMappingSchema ¶
func ConstructMappingSchema(name string, items map[string]MappingElementTypeName) (piazza.JsonString, error)
ConstructMappingSchema takes a map of parameter names to datatypes and returns the corresponding ES DSL for it.
func IndexExists ¶
func IsValidArrayTypeMapping ¶
func IsValidArrayTypeMapping(mappingValue interface{}) bool
func IsValidMappingType ¶
func IsValidMappingType(mappingValue interface{}) bool
func PollFunction ¶
Types ¶
type DeleteResponse ¶
DeleteResponse is the response when a deletion of a document or type occurs
func NewDeleteResponse ¶
func NewDeleteResponse(deleteResponse *elastic.DeleteResponse) *DeleteResponse
NewDeleteResponse is the initializing constructor for DeleteResponse
type GetResult ¶
type GetResult struct { ID string Source *json.RawMessage Found bool }
func NewGetResult ¶
func NewGetResult(getResult *elastic.GetResult) *GetResult
type IIndex ¶
type IIndex interface { GetVersion() string IndexName() string IndexExists() (bool, error) TypeExists(typ string) (bool, error) ItemExists(typ string, id string) (bool, error) Create(settings string) error Close() error Delete() error PostData(typ string, id string, obj interface{}) (*IndexResponse, error) PutData(typ string, id string, obj interface{}) (*IndexResponse, error) GetByID(typ string, id string) (*GetResult, error) DeleteByID(typ string, id string) (*DeleteResponse, error) DeleteByIDWait(typ string, id string) (*DeleteResponse, error) FilterByMatchAll(typ string, format *piazza.JsonPagination) (*SearchResult, error) GetAllElements(typ string) (*SearchResult, error) FilterByTermQuery(typ string, name string, value interface{}, format *piazza.JsonPagination) (*SearchResult, error) FilterByMatchQuery(typ string, name string, value interface{}, format *piazza.JsonPagination) (*SearchResult, error) SearchByJSON(typ string, jsn string) (*SearchResult, error) SetMapping(typename string, jsn piazza.JsonString) error GetTypes() ([]string, error) GetMapping(typ string) (interface{}, error) DirectAccess(verb string, endpoint string, input interface{}, output interface{}) error }
IIndex is an interface to Elasticsearch Index methods
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is a representation of the Elasticsearch index.
func (*Index) DeleteByID ¶
func (esi *Index) DeleteByID(typ string, id string) (*DeleteResponse, error)
DeleteByID deletes a document by ID within a specified index and type.
func (*Index) DeleteByIDWait ¶
func (esi *Index) DeleteByIDWait(typ string, id string) (*DeleteResponse, error)
DeleteByID deletes a document by ID within a specified index and type and waits before returning.
func (*Index) DirectAccess ¶
func (*Index) FilterByMatchAll ¶
func (esi *Index) FilterByMatchAll(typ string, realFormat *piazza.JsonPagination) (*SearchResult, error)
FilterByMatchAll returns all documents of a specified type, in the format specified by the realFormat parameter.
func (*Index) FilterByMatchQuery ¶
func (esi *Index) FilterByMatchQuery(typ string, name string, value interface{}, realFormat *piazza.JsonPagination) (*SearchResult, error)
FilterByMatchQuery creates an Elasticsearch match query and performs the query over the specified type. For more information on match queries, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html
func (*Index) FilterByTermQuery ¶
func (esi *Index) FilterByTermQuery(typ string, name string, value interface{}, realFormat *piazza.JsonPagination) (*SearchResult, error)
FilterByTermQuery creates an Elasticsearch term query and performs the query over the specified type. For more information on term queries, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html
func (*Index) GetAllElements ¶
func (esi *Index) GetAllElements(typ string) (*SearchResult, error)
GetAllElements returns all documents of a specified type.
func (*Index) GetMapping ¶
GetMapping returns the _mapping of a type.
func (*Index) GetVersion ¶
GetVersion returns the Elasticsearch version.
func (*Index) IndexExists ¶
IndexExists checks to see if the index exists.
func (*Index) ItemExists ¶
ItemExists checks to see if the specified item exists within the type and index specified.
func (*Index) PostData ¶
func (esi *Index) PostData(typ string, id string, obj interface{}) (*IndexResponse, error)
PostData send JSON data to the index.
func (*Index) PutData ¶
func (esi *Index) PutData(typ string, id string, obj interface{}) (*IndexResponse, error)
TODO
func (*Index) SearchByJSON ¶
func (esi *Index) SearchByJSON(typ string, jsn string) (*SearchResult, error)
SearchByJSON performs a search over the index via raw JSON.
func (*Index) SetMapping ¶
SetMapping sets the _mapping field for a new type.
type IndexResponse ¶
func NewIndexResponse ¶
func NewIndexResponse(indexResponse *elastic.IndexResponse) *IndexResponse
type MappingElementTypeName ¶
type MappingElementTypeName string
MappingElementTypeName is just an alias for a string.
const ( MappingElementTypeText MappingElementTypeName = "text" MappingElementTypeKeyword MappingElementTypeName = "keyword" MappingElementTypeLong MappingElementTypeName = "long" MappingElementTypeInteger MappingElementTypeName = "integer" MappingElementTypeShort MappingElementTypeName = "short" MappingElementTypeByte MappingElementTypeName = "byte" MappingElementTypeDouble MappingElementTypeName = "double" MappingElementTypeFloat MappingElementTypeName = "float" MappingElementTypeDate MappingElementTypeName = "date" MappingElementTypeBool MappingElementTypeName = "boolean" MappingElementTypeBinary MappingElementTypeName = "binary" MappingElementTypeGeoPoint MappingElementTypeName = "geo_point" MappingElementTypeGeoShape MappingElementTypeName = "geo_shape" MappingElementTypeIp MappingElementTypeName = "ip" MappingElementTypeCompletion MappingElementTypeName = "completion" MappingElementTypeTextA MappingElementTypeName = "[text]" MappingElementTypeKeywordA MappingElementTypeName = "[keyword]" MappingElementTypeLongA MappingElementTypeName = "[long]" MappingElementTypeIntegerA MappingElementTypeName = "[integer]" MappingElementTypeShortA MappingElementTypeName = "[short]" MappingElementTypeByteA MappingElementTypeName = "[byte]" MappingElementTypeDoubleA MappingElementTypeName = "[double]" MappingElementTypeFloatA MappingElementTypeName = "[float]" MappingElementTypeDateA MappingElementTypeName = "[date]" MappingElementTypeBoolA MappingElementTypeName = "[boolean]" MappingElementTypeBinaryA MappingElementTypeName = "[binary]" MappingElementTypeGeoPointA MappingElementTypeName = "[geo_point]" MappingElementTypeGeoShapeA MappingElementTypeName = "[geo_shape]" MappingElementTypeIpA MappingElementTypeName = "[ip]" MappingElementTypeCompletionA MappingElementTypeName = "[completion]" )
Constants representing the supported data types for the Event parameters.
type MockIndex ¶
type MockIndex struct {
// contains filtered or unexported fields
}
func NewMockIndex ¶
func (*MockIndex) DeleteByID ¶
func (esi *MockIndex) DeleteByID(typeName string, id string) (*DeleteResponse, error)
func (*MockIndex) DeleteByIDWait ¶
func (esi *MockIndex) DeleteByIDWait(typeName string, id string) (*DeleteResponse, error)
func (*MockIndex) DirectAccess ¶
func (*MockIndex) FilterByMatchAll ¶
func (esi *MockIndex) FilterByMatchAll(typeName string, realFormat *piazza.JsonPagination) (*SearchResult, error)
func (*MockIndex) FilterByMatchQuery ¶
func (esi *MockIndex) FilterByMatchQuery(typ string, name string, value interface{}, realFormat *piazza.JsonPagination) (*SearchResult, error)
func (*MockIndex) FilterByTermQuery ¶
func (esi *MockIndex) FilterByTermQuery(typeName string, name string, value interface{}, realFormat *piazza.JsonPagination) (*SearchResult, error)
func (*MockIndex) GetAllElements ¶
func (esi *MockIndex) GetAllElements(typ string) (*SearchResult, error)
func (*MockIndex) GetMapping ¶
func (*MockIndex) GetVersion ¶
func (*MockIndex) IndexExists ¶
func (*MockIndex) ItemExists ¶
func (*MockIndex) PostData ¶
func (esi *MockIndex) PostData(typeName string, id string, obj interface{}) (*IndexResponse, error)
func (*MockIndex) PutData ¶
func (esi *MockIndex) PutData(typeName string, id string, obj interface{}) (*IndexResponse, error)
TODO
func (*MockIndex) SearchByJSON ¶
func (esi *MockIndex) SearchByJSON(typ string, jsn string) (*SearchResult, error)
func (*MockIndex) SetMapping ¶
type MockIndexType ¶
type MockIndexType struct {
// contains filtered or unexported fields
}
type QueryFormat ¶
func NewQueryFormat ¶
func NewQueryFormat(params *piazza.JsonPagination) *QueryFormat
NewQueryFormat constructs a QueryFormat
type SearchResult ¶
type SearchResult struct { Found bool // contains filtered or unexported fields }
func NewSearchResult ¶
func NewSearchResult(searchResult *elastic.SearchResult) *SearchResult
func (*SearchResult) GetHit ¶
func (r *SearchResult) GetHit(i int) *SearchResultHit
func (*SearchResult) GetHits ¶
func (r *SearchResult) GetHits() *[]*SearchResultHit
func (*SearchResult) NumHits ¶
func (r *SearchResult) NumHits() int
func (*SearchResult) TotalHits ¶
func (r *SearchResult) TotalHits() int64
type SearchResultHit ¶
type SearchResultHit struct { ID string Source *json.RawMessage }
Directories ¶
Path | Synopsis |
---|---|
uritemplates
Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).
|
Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570). |