Documentation
¶
Overview ¶
Package rethinkstore implements a store that saves all the segments in a RethinkDB database.
Index ¶
- Constants
- func RegisterFlags()
- type Config
- type Info
- type Store
- func (a *Store) AddEvidence(linkHash *types.Bytes32, evidence *cs.Evidence) error
- func (a *Store) AddStoreEventChannel(eventChan chan *store.Event)
- func (a *Store) Clean() (err error)
- func (a *Store) Create() (err error)
- func (a *Store) CreateLink(link *cs.Link) (*types.Bytes32, error)
- func (a *Store) DeleteValue(key []byte) ([]byte, error)
- func (a *Store) Drop() (err error)
- func (a *Store) Exists() (bool, error)
- func (a *Store) FindSegments(filter *store.SegmentFilter) (cs.SegmentSlice, error)
- func (a *Store) GetEvidences(linkHash *types.Bytes32) (*cs.Evidences, error)
- func (a *Store) GetInfo() (interface{}, error)
- func (a *Store) GetMapIDs(filter *store.MapFilter) ([]string, error)
- func (a *Store) GetSegment(linkHash *types.Bytes32) (*cs.Segment, error)
- func (a *Store) GetValue(key []byte) ([]byte, error)
- func (a *Store) NewBatch() (store.Batch, error)
- func (a *Store) SetValue(key, value []byte) error
Constants ¶
const ( // Name is the name set in the store's information. Name = "rethink" // Description is the description set in the store's information. Description = "Indigo's RethinkDB Store" // DefaultURL is the default URL of the database. DefaultURL = "rethinkdb:28015" // DefaultDB is the default database. DefaultDB = "test" // DefaultHard is whether to use hard durability by default. DefaultHard = true )
Variables ¶
This section is empty.
Functions ¶
func RegisterFlags ¶
func RegisterFlags()
RegisterFlags register 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 PostgreSQL database, such as "localhost:28015" order
// "localhost:28015,localhost:28016,localhost:28017".
URL string
// The database name
DB string
// Whether to use hard durability.
Hard bool
}
Config contains configuration options for the store.
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 Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the type that implements github.com/stratumn/sdk/store.Adapter.
func Initialize ¶
Initialize initializes a rethinkdb store adapter
func InitializeWithFlags ¶
InitializeWithFlags should be called after RegisterFlags and flag.Parse to intialize a rethinkdb adapter using flag values.
func (*Store) AddEvidence ¶
AddEvidence implements github.com/stratumn/sdk/store.EvidenceWriter.AddEvidence.
func (*Store) AddStoreEventChannel ¶
AddStoreEventChannel implements github.com/stratumn/sdk/store.Adapter.AddStoreEventChannel.
func (*Store) CreateLink ¶
CreateLink implements github.com/stratumn/sdk/store.LinkWriter.CreateLink.
func (*Store) DeleteValue ¶
DeleteValue implements github.com/stratumn/sdk/store.KeyValueStore.DeleteValue.
func (*Store) FindSegments ¶
func (a *Store) FindSegments(filter *store.SegmentFilter) (cs.SegmentSlice, error)
FindSegments implements github.com/stratumn/sdk/store.SegmentReader.FindSegments.
func (*Store) GetEvidences ¶
GetEvidences implements github.com/stratumn/sdk/store.EvidenceReader.GetEvidences.
func (*Store) GetMapIDs ¶
GetMapIDs implements github.com/stratumn/sdk/store.SegmentReader.GetMapIDs.
func (*Store) GetSegment ¶
GetSegment implements github.com/stratumn/sdk/store.SegmentReader.GetSegment.