Documentation ¶
Index ¶
- type Store
- func (p *Store) AddBeaconID(ctx context.Context, beaconName string) (int, error)
- func (p *Store) AddFK(ctx context.Context) error
- func (p *Store) BatchPut(ctx context.Context, bs []common.Beacon) error
- func (p *Store) Close() error
- func (p *Store) Cursor(ctx context.Context, fn func(context.Context, chain.Cursor) error) error
- func (p *Store) Del(ctx context.Context, round uint64) error
- func (p *Store) DropFK(ctx context.Context) error
- func (p *Store) Get(ctx context.Context, round uint64) (*common.Beacon, error)
- func (p *Store) Last(ctx context.Context) (*common.Beacon, error)
- func (p *Store) Len(ctx context.Context) (int, error)
- func (p *Store) Put(ctx context.Context, b *common.Beacon) error
- func (p *Store) SaveTo(ctx context.Context, _ io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents access to the postgres database for beacon management.
func NewStore ¶
NewStore returns a new store that provides the CRUD based API needed for supporting drand serialization.
func (*Store) AddBeaconID ¶
AddBeaconID adds the beacon to the database if it does not exist.
func (*Store) AddFK ¶
AddFK reconstructs the relation between beacons and beacon_details tables after Store.DropFK was called.
func (*Store) BatchPut ¶
BatchPut is useful if you want to write a lot of beacons to the database at once.
func (*Store) DropFK ¶
DropFK is used to optimize the calls to Store.BatchPut and should be called before it. It drops the relation between beacons and beacon_details tables.
Click to show internal directories.
Click to hide internal directories.