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(ctx context.Context, linkHash chainscript.LinkHash, ...) error
- func (a *Store) AddStoreEventChannel(eventChan chan *store.Event)
- func (a *Store) Clean() error
- func (a *Store) Create() error
- func (a *Store) CreateLink(ctx context.Context, link *chainscript.Link) (chainscript.LinkHash, error)
- func (a *Store) DeleteValue(ctx context.Context, key []byte) ([]byte, error)
- func (a *Store) Drop() error
- func (a *Store) Exists() (bool, error)
- func (a *Store) FindSegments(ctx context.Context, filter *store.SegmentFilter) (*types.PaginatedSegments, error)
- func (a *Store) GetEvidences(ctx context.Context, linkHash chainscript.LinkHash) (types.EvidenceSlice, error)
- func (a *Store) GetInfo(ctx context.Context) (interface{}, error)
- func (a *Store) GetMapIDs(ctx context.Context, filter *store.MapFilter) ([]string, error)
- func (a *Store) GetSegment(ctx context.Context, linkHash chainscript.LinkHash) (*chainscript.Segment, error)
- func (a *Store) GetValue(ctx context.Context, key []byte) ([]byte, error)
- func (a *Store) NewBatch(ctx context.Context) (store.Batch, error)
- func (a *Store) SetValue(ctx context.Context, 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 = "Stratumn'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/go-core/store.Adapter.
func Initialize ¶
Initialize initializes a rethinkdb store adapter
func InitializeWithFlags ¶
InitializeWithFlags should be called after RegisterFlags and flag.Parse to initialize a rethinkdb adapter using flag values.
func (*Store) AddEvidence ¶
func (a *Store) AddEvidence(ctx context.Context, linkHash chainscript.LinkHash, evidence *chainscript.Evidence) error
AddEvidence implements github.com/stratumn/go-core/store.EvidenceWriter.AddEvidence.
func (*Store) AddStoreEventChannel ¶
AddStoreEventChannel implements github.com/stratumn/go-core/store.Adapter.AddStoreEventChannel.
func (*Store) CreateLink ¶
func (a *Store) CreateLink(ctx context.Context, link *chainscript.Link) (chainscript.LinkHash, error)
CreateLink implements github.com/stratumn/go-core/store.LinkWriter.CreateLink.
func (*Store) DeleteValue ¶
DeleteValue implements github.com/stratumn/go-core/store.KeyValueStore.DeleteValue.
func (*Store) FindSegments ¶
func (a *Store) FindSegments(ctx context.Context, filter *store.SegmentFilter) (*types.PaginatedSegments, error)
FindSegments implements github.com/stratumn/go-core/store.SegmentReader.FindSegments.
func (*Store) GetEvidences ¶
func (a *Store) GetEvidences(ctx context.Context, linkHash chainscript.LinkHash) (types.EvidenceSlice, error)
GetEvidences implements github.com/stratumn/go-core/store.EvidenceReader.GetEvidences.
func (*Store) GetMapIDs ¶
GetMapIDs implements github.com/stratumn/go-core/store.SegmentReader.GetMapIDs.
func (*Store) GetSegment ¶
func (a *Store) GetSegment(ctx context.Context, linkHash chainscript.LinkHash) (*chainscript.Segment, error)
GetSegment implements github.com/stratumn/go-core/store.SegmentReader.GetSegment.
func (*Store) GetValue ¶
GetValue implements github.com/stratumn/go-core/store.KeyValueStore.GetValue.