Documentation ¶
Index ¶
- Variables
- type DynamodbStorage
- func (m *DynamodbStorage) Close() error
- func (m *DynamodbStorage) Delete(path string) error
- func (m *DynamodbStorage) Exists(path string) (bool, error)
- func (m *DynamodbStorage) Get(path string) ([]byte, error)
- func (m *DynamodbStorage) List(prefix string) ([]string, error)
- func (m *DynamodbStorage) Put(path string, value []byte) error
- type EtcdStorage
- func (m *EtcdStorage) Close() error
- func (m *EtcdStorage) Delete(path string) error
- func (m *EtcdStorage) Exists(path string) (bool, error)
- func (m *EtcdStorage) Get(path string) ([]byte, error)
- func (m *EtcdStorage) List(prefix string) ([]string, error)
- func (m *EtcdStorage) Put(path string, content []byte) error
- type FileSystemStorage
- func (m *FileSystemStorage) Close() error
- func (m *FileSystemStorage) Delete(path string) error
- func (m *FileSystemStorage) Exists(path string) (bool, error)
- func (m *FileSystemStorage) Get(path string) ([]byte, error)
- func (m *FileSystemStorage) List(prefix string) ([]string, error)
- func (m *FileSystemStorage) Put(path string, content []byte) error
- type IndexMetadata
- type Metastore
- func (m *Metastore) Close() error
- func (m *Metastore) DeleteIndexMetadata(indexName string) error
- func (m *Metastore) Events() chan MetastoreEvent
- func (m *Metastore) GetIndexMetadata(indexName string) (*IndexMetadata, error)
- func (m *Metastore) GetIndexNames() []string
- func (m *Metastore) GetMapping(indexName string) (mapping.IndexMapping, error)
- func (m *Metastore) GetResponsibleShard(indexName string, key string) string
- func (m *Metastore) GetShardMetadata(indexName string, shardName string) (*ShardMetadata, error)
- func (m *Metastore) GetShardNames(indexName string) []string
- func (m *Metastore) IndexMetadataExists(indexName string) bool
- func (m *Metastore) NumShards(indexName string) int
- func (m *Metastore) SetIndexMetadata(indexName string, indexMetadata *IndexMetadata) error
- func (m *Metastore) TouchShardMetadata(indexName string, shardName string) error
- type MetastoreEvent
- type MetastoreEventType
- type SchemeType
- type ShardMetadata
- type Storage
- type StorageEvent
- type StorageEventType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MetastoreEventType_name = map[MetastoreEventType]string{ MetastoreEventTypeUnknown: "unknown", MetastoreEventTypePutIndex: "put_index", MetastoreEventTypeDeleteIndex: "delete_index", MetastoreEventTypePutShard: "put_shard", MetastoreEventTypeDeleteShard: "delete_shard", } MetastoreEventType_value = map[string]MetastoreEventType{ "unknown": MetastoreEventTypeUnknown, "put_index": MetastoreEventTypePutIndex, "delete_index": MetastoreEventTypeDeleteIndex, "put_shard": MetastoreEventTypePutShard, "delete_shard": MetastoreEventTypeDeleteShard, } )
Event value maps for MetastoreEventType.
View Source
var ( SchemeType_name = map[SchemeType]string{ SchemeTypeUnknown: "unknown", SchemeTypeFile: "file", SchemeTypeEtcd: "etcd", SchemeTypeDynamodb: "dynamodb", } SchemeType_value = map[string]SchemeType{ "unknown": SchemeTypeUnknown, "file": SchemeTypeFile, "etcd": SchemeTypeEtcd, "dynamodb": SchemeTypeDynamodb, } )
Enum value maps for SchemeType.
View Source
var ( StorageEventType_name = map[StorageEventType]string{ StorageEventTypeUnknown: "unknown", StorageEventTypePut: "put", StorageEventTypeDelete: "delete", } StorageEventType_value = map[string]StorageEventType{ "unknown": StorageEventTypeUnknown, "put": StorageEventTypePut, "delete": StorageEventTypeDelete, } )
Enum value maps for StorageEventType.
View Source
var ( // ErrRecordNotFound returned when a get returns no results ErrRecordNotFound = errors.New("record not found") // ErrDuplicateRecord returned when a conflict occurs putting a record due to duplicate ErrDuplicateRecord = errors.New("record already exists") )
Functions ¶
This section is empty.
Types ¶
type DynamodbStorage ¶ added in v0.4.0
type DynamodbStorage struct {
// contains filtered or unexported fields
}
func NewDynamodbStorage ¶ added in v0.4.0
func NewDynamodbStorage(uri string, logger *zap.Logger) (*DynamodbStorage, error)
func (*DynamodbStorage) Close ¶ added in v0.4.0
func (m *DynamodbStorage) Close() error
func (*DynamodbStorage) Delete ¶ added in v0.4.0
func (m *DynamodbStorage) Delete(path string) error
func (*DynamodbStorage) Exists ¶ added in v0.4.0
func (m *DynamodbStorage) Exists(path string) (bool, error)
func (*DynamodbStorage) Get ¶ added in v0.4.0
func (m *DynamodbStorage) Get(path string) ([]byte, error)
type EtcdStorage ¶
type EtcdStorage struct {
// contains filtered or unexported fields
}
func NewEtcdStorageWithUri ¶
func NewEtcdStorageWithUri(uri string, logger *zap.Logger) (*EtcdStorage, error)
func (*EtcdStorage) Close ¶
func (m *EtcdStorage) Close() error
func (*EtcdStorage) Delete ¶
func (m *EtcdStorage) Delete(path string) error
type FileSystemStorage ¶
type FileSystemStorage struct {
// contains filtered or unexported fields
}
func NewFileSystemStorageWithPath ¶
func NewFileSystemStorageWithPath(path string, logger *zap.Logger) (*FileSystemStorage, error)
func NewFileSystemStorageWithUri ¶
func NewFileSystemStorageWithUri(uri string, logger *zap.Logger) (*FileSystemStorage, error)
func (*FileSystemStorage) Close ¶
func (m *FileSystemStorage) Close() error
func (*FileSystemStorage) Delete ¶
func (m *FileSystemStorage) Delete(path string) error
type IndexMetadata ¶
type IndexMetadata struct { IndexName string `json:"index_name"` IndexUri string `json:"index_uri"` IndexLockUri string `json:"index_lock_uri"` IndexMapping mapping.IndexMapping `json:"index_mapping"` IndexMappingVersion int64 `json:"index_mapping_version"` DefaultSearchField string `json:"default_search_field"` DefaultAnalyzer analyzer.AnalyzerSetting `json:"default_analyzer"` ShardMetadataMap map[string]*ShardMetadata `json:"-"` }
func NewIndexMetadataWithBytes ¶
func NewIndexMetadataWithBytes(bytes []byte) (*IndexMetadata, error)
func (*IndexMetadata) Marshal ¶
func (m *IndexMetadata) Marshal() ([]byte, error)
type Metastore ¶
type Metastore struct {
// contains filtered or unexported fields
}
func NewMetastoreWithUri ¶
func (*Metastore) DeleteIndexMetadata ¶
func (*Metastore) Events ¶
func (m *Metastore) Events() chan MetastoreEvent
func (*Metastore) GetIndexMetadata ¶
func (m *Metastore) GetIndexMetadata(indexName string) (*IndexMetadata, error)
func (*Metastore) GetIndexNames ¶
func (*Metastore) GetMapping ¶
func (m *Metastore) GetMapping(indexName string) (mapping.IndexMapping, error)
func (*Metastore) GetResponsibleShard ¶
func (*Metastore) GetShardMetadata ¶
func (m *Metastore) GetShardMetadata(indexName string, shardName string) (*ShardMetadata, error)
func (*Metastore) GetShardNames ¶
func (*Metastore) IndexMetadataExists ¶
func (*Metastore) SetIndexMetadata ¶
func (m *Metastore) SetIndexMetadata(indexName string, indexMetadata *IndexMetadata) error
type MetastoreEvent ¶
type MetastoreEvent struct { Type MetastoreEventType Index string Shard string }
type MetastoreEventType ¶
type MetastoreEventType int
const ( MetastoreEventTypeUnknown MetastoreEventType = iota MetastoreEventTypePutIndex MetastoreEventTypeDeleteIndex MetastoreEventTypePutShard MetastoreEventTypeDeleteShard )
type SchemeType ¶
type SchemeType int
const ( SchemeTypeUnknown SchemeType = iota SchemeTypeFile SchemeTypeEtcd SchemeTypeDynamodb )
type ShardMetadata ¶
type ShardMetadata struct { ShardName string `json:"shard_name"` ShardUri string `json:"shard_uri"` ShardLockUri string `json:"shard_lock_uri"` ShardVersion int64 `json:"shard_update_timestamp"` }
func NewShardMetadataWithBytes ¶
func NewShardMetadataWithBytes(bytes []byte) (*ShardMetadata, error)
func (*ShardMetadata) Marshal ¶
func (m *ShardMetadata) Marshal() ([]byte, error)
type Storage ¶
type StorageEvent ¶
type StorageEvent struct { Type StorageEventType Path string Value []byte }
type StorageEventType ¶
type StorageEventType int
const ( StorageEventTypeUnknown StorageEventType = iota StorageEventTypePut StorageEventTypeDelete )
Click to show internal directories.
Click to hide internal directories.