Documentation ¶
Index ¶
- Variables
- func NewQueriesForTable(tableName string) *queries
- func QueryWithParams(d *Datastore, q dsq.Query) (*sql.Rows, error)
- type Datastore
- func (d *Datastore) Batch() (ds.Batch, error)
- func (d *Datastore) Close() error
- func (d *Datastore) Delete(key ds.Key) error
- func (d *Datastore) Get(key ds.Key) (value []byte, err error)
- func (d *Datastore) GetSize(key ds.Key) (int, error)
- func (d *Datastore) Has(key ds.Key) (exists bool, err error)
- func (d *Datastore) Put(key ds.Key, value []byte) error
- func (d *Datastore) Query(q dsq.Query) (dsq.Results, error)
- func (d *Datastore) RawQuery(q dsq.Query) (dsq.Results, error)
- func (*Datastore) Sync(prefix ds.Key) error
- type Options
- type Queries
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidType = errors.New("invalid value type")
)
Functions ¶
func NewQueriesForTable ¶
func NewQueriesForTable(tableName string) *queries
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
func NewDatastore ¶
NewDatastore returns a new datastore
func (*Datastore) Sync ¶
Sync guarantees that any Put or Delete calls under prefix that returned before Sync(prefix) was called will be observed after Sync(prefix) returns, even if the program crashes. If Put/Delete operations already satisfy these requirements then Sync may be a no-op.
If the prefix fails to Sync this method returns an error.
type Options ¶
type Options struct { Host string Port string User string Password string Database string Table string }
Options are the postgres datastore options, reexported here for convenience.
func (*Options) CreatePostgres ¶
Create returns a datastore connected to postgres initialized with a table
Click to show internal directories.
Click to hide internal directories.