Documentation ¶
Index ¶
- Constants
- func RegisterFlags()
- type Config
- type ESStore
- func (es *ESStore) AddEvidence(ctx context.Context, linkHash chainscript.LinkHash, ...) error
- func (es *ESStore) AddStoreEventChannel(eventChan chan *store.Event)
- func (es *ESStore) CreateLink(ctx context.Context, link *chainscript.Link) (chainscript.LinkHash, error)
- func (es *ESStore) DeleteValue(ctx context.Context, key []byte) ([]byte, error)
- func (es *ESStore) FindSegments(ctx context.Context, filter *store.SegmentFilter) (*types.PaginatedSegments, error)
- func (es *ESStore) GetEvidences(ctx context.Context, linkHash chainscript.LinkHash) (types.EvidenceSlice, 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 chainscript.LinkHash) (*chainscript.Segment, error)
- func (es *ESStore) GetValue(ctx context.Context, key []byte) ([]byte, error)
- func (es *ESStore) MultiMatchQuery(ctx context.Context, query *SearchQuery) (*types.PaginatedSegments, 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(ctx context.Context, query *SearchQuery) (*types.PaginatedSegments, 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 = "Stratumn'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-core/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 chainscript.LinkHash, evidence *chainscript.Evidence) error
AddEvidence implements github.com/stratumn/go-core/store.EvidenceWriter.AddEvidence.
func (*ESStore) AddStoreEventChannel ¶
AddStoreEventChannel implements github.com/stratumn/go-core/store.Adapter.AddStoreEventChannel.
func (*ESStore) CreateLink ¶
func (es *ESStore) CreateLink(ctx context.Context, link *chainscript.Link) (chainscript.LinkHash, error)
CreateLink implements github.com/stratumn/go-core/store.LinkWriter.CreateLink.
func (*ESStore) DeleteValue ¶
DeleteValue implements github.com/stratumn/go-core/store.Adapter.DeleteValue.
func (*ESStore) FindSegments ¶
func (es *ESStore) FindSegments(ctx context.Context, filter *store.SegmentFilter) (*types.PaginatedSegments, error)
FindSegments implements github.com/stratumn/go-core/store.Adapter.FindSegments.
func (*ESStore) GetEvidences ¶
func (es *ESStore) GetEvidences(ctx context.Context, linkHash chainscript.LinkHash) (types.EvidenceSlice, error)
GetEvidences implements github.com/stratumn/go-core/store.EvidenceReader.GetEvidences.
func (*ESStore) GetMapIDs ¶
GetMapIDs implements github.com/stratumn/go-core/store.Adapter.GetMapIDs.
func (*ESStore) GetSegment ¶
func (es *ESStore) GetSegment(ctx context.Context, linkHash chainscript.LinkHash) (*chainscript.Segment, error)
GetSegment implements github.com/stratumn/go-core/store.Adapter.GetSegment.
func (*ESStore) MultiMatchQuery ¶
func (es *ESStore) MultiMatchQuery(ctx context.Context, query *SearchQuery) (*types.PaginatedSegments, error)
MultiMatchQuery searches through the store for segments matching query criteria using ES multi match query
func (*ESStore) SetValue ¶
SetValue implements github.com/stratumn/go-core/store.KeyValueStore.SetValue.
func (*ESStore) SimpleSearchQuery ¶
func (es *ESStore) SimpleSearchQuery(ctx context.Context, query *SearchQuery) (*types.PaginatedSegments, error)
SimpleSearchQuery searches through the store for segments matching query criteria using ES simple query string feature
type Evidences ¶
type Evidences struct {
Evidences types.EvidenceSlice `json:"evidences,omitempty"`
}
Evidences is a wrapper around types.EvidenceSlice 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.