Documentation ¶
Index ¶
- Constants
- func RegisterFlags()
- type Config
- type ESStore
- func (es *ESStore) AddEvidence(ctx context.Context, linkHash *types.Bytes32, evidence *cs.Evidence) error
- func (es *ESStore) AddStoreEventChannel(eventChan chan *store.Event)
- func (es *ESStore) CreateLink(ctx context.Context, link *cs.Link) (*types.Bytes32, error)
- func (es *ESStore) DeleteValue(ctx context.Context, key []byte) ([]byte, error)
- func (es *ESStore) FindSegments(ctx context.Context, filter *store.SegmentFilter) (cs.SegmentSlice, error)
- func (es *ESStore) GetEvidences(ctx context.Context, linkHash *types.Bytes32) (*cs.Evidences, error)
- func (es *ESStore) GetInfo(ctx context.Context) (interface{}, error)
- func (es *ESStore) GetMapIDs(ctx context.Context, filter *store.MapFilter) ([]string, error)
- func (es *ESStore) GetSegment(ctx context.Context, linkHash *types.Bytes32) (*cs.Segment, error)
- func (es *ESStore) GetValue(ctx context.Context, key []byte) ([]byte, error)
- func (es *ESStore) MultiMatchQuery(query *SearchQuery) (cs.SegmentSlice, error)
- func (es *ESStore) NewBatch(ctx context.Context) (store.Batch, error)
- func (es *ESStore) SetValue(ctx context.Context, key, value []byte) error
- func (es *ESStore) SimpleSearchQuery(query *SearchQuery) (cs.SegmentSlice, error)
- type Evidences
- type Info
- type SearchQuery
- type Value
Constants ¶
const ( // Name is the name set in the store's information. Name = "elasticsearch" // Description is the description set in the store's information. Description = "Indigo's ElasticSearch Store" // DefaultURL is the default URL of the database. DefaultURL = "http://elasticsearch:9200" )
Variables ¶
This section is empty.
Functions ¶
func RegisterFlags ¶
func RegisterFlags()
RegisterFlags registers the flags used by InitializeWithFlags.
Types ¶
type Config ¶
type Config struct { // A version string that will be set in the store's information. Version string // A git commit hash that will be set in the store's information. Commit string // The URL of the ElasticSearch database. URL string // Use sniffing feature of ElasticSearch. Sniffing bool // Logrus log level. LogLevel string }
Config contains configuration options for the store.
type ESStore ¶
type ESStore struct {
// contains filtered or unexported fields
}
ESStore is the type that implements github.com/stratumn/go-indigocore/store.Adapter.
func Initialize ¶
Initialize initializes a elasticsearch store adapter.
func InitializeWithFlags ¶
InitializeWithFlags should be called after RegisterFlags and flag.Parse to initialize an elasticsearch adapter using flag values.
func (*ESStore) AddEvidence ¶
func (es *ESStore) AddEvidence(ctx context.Context, linkHash *types.Bytes32, evidence *cs.Evidence) error
AddEvidence implements github.com/stratumn/go-indigocore/store.EvidenceWriter.AddEvidence.
func (*ESStore) AddStoreEventChannel ¶
AddStoreEventChannel implements github.com/stratumn/go-indigocore/store.Adapter.AddStoreEventChannel.
func (*ESStore) CreateLink ¶
CreateLink implements github.com/stratumn/go-indigocore/store.LinkWriter.CreateLink.
func (*ESStore) DeleteValue ¶
DeleteValue implements github.com/stratumn/go-indigocore/store.Adapter.DeleteValue.
func (*ESStore) FindSegments ¶
func (es *ESStore) FindSegments(ctx context.Context, filter *store.SegmentFilter) (cs.SegmentSlice, error)
FindSegments implements github.com/stratumn/go-indigocore/store.Adapter.FindSegments.
func (*ESStore) GetEvidences ¶
func (es *ESStore) GetEvidences(ctx context.Context, linkHash *types.Bytes32) (*cs.Evidences, error)
GetEvidences implements github.com/stratumn/go-indigocore/store.EvidenceReader.GetEvidences.
func (*ESStore) GetInfo ¶
GetInfo implements github.com/stratumn/go-indigocore/store.Adapter.GetInfo.
func (*ESStore) GetMapIDs ¶
GetMapIDs implements github.com/stratumn/go-indigocore/store.Adapter.GetMapIDs.
func (*ESStore) GetSegment ¶
GetSegment implements github.com/stratumn/go-indigocore/store.Adapter.GetSegment.
func (*ESStore) GetValue ¶
GetValue implements github.com/stratumn/go-indigocore/store.Adapter.GetValue.
func (*ESStore) MultiMatchQuery ¶
func (es *ESStore) MultiMatchQuery(query *SearchQuery) (cs.SegmentSlice, error)
MultiMatchQuery searches through the store for segments matching query criteria using ES multi match query
func (*ESStore) NewBatch ¶
NewBatch implements github.com/stratumn/go-indigocore/store.Adapter.NewBatch.
func (*ESStore) SetValue ¶
SetValue implements github.com/stratumn/go-indigocore/store.KeyValueStore.SetValue.
func (*ESStore) SimpleSearchQuery ¶
func (es *ESStore) SimpleSearchQuery(query *SearchQuery) (cs.SegmentSlice, error)
SimpleSearchQuery searches through the store for segments matching query criteria using ES simple query string feature
type Evidences ¶
Evidences is a wrapper around cs.Evidences for json ElasticSearch serialization compliance. Elastic Search does not allow indexing of arrays directly.
type Info ¶
type Info struct { Name string `json:"name"` Description string `json:"description"` Version string `json:"version"` Commit string `json:"commit"` }
Info is the info returned by GetInfo.
type SearchQuery ¶
type SearchQuery struct { store.SegmentFilter Query string }
SearchQuery contains pagination and query string information.