Documentation ¶
Index ¶
- Constants
- Variables
- func Clean(db *sql.DB, tableName string) error
- func CreateTable(db *sql.DB, tableName string) error
- type DBOption
- type DBStore
- func (d *DBStore) Count() (int, error)
- func (d *DBStore) GetAll() ([]gowakuPersistence.StoredMessage, error)
- func (d *DBStore) GetStoredMessage(row *sql.Rows) (gowakuPersistence.StoredMessage, error)
- func (d *DBStore) MostRecentTimestamp() (int64, error)
- func (d *DBStore) Put(env *protocol.Envelope) error
- func (d *DBStore) Query(query *storepb.HistoryQuery) (*storepb.Index, []gowakuPersistence.StoredMessage, error)
- func (d *DBStore) Start(ctx context.Context, timesource timesource.Timesource) error
- func (d *DBStore) Stop()
- func (d *DBStore) Validate(env *protocol.Envelope) error
- type ProtectedTopic
- type ProtectedTopicsStore
- func (p *ProtectedTopicsStore) Close() error
- func (p *ProtectedTopicsStore) FetchPrivateKey(topic string) (privKey *ecdsa.PrivateKey, err error)
- func (p *ProtectedTopicsStore) Insert(pubsubTopic string, privKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey) error
- func (p *ProtectedTopicsStore) ProtectedTopics() ([]ProtectedTopic, error)
- type Queries
Constants ¶
const MaxTimeVariance = time.Duration(20) * time.Second
MaxTimeVariance is the maximum duration in the future allowed for a message timestamp
Variables ¶
var ErrFutureMessage = errors.New("message timestamp in the future")
var ErrInvalidCursor = errors.New("invalid cursor")
var ErrMessageTooOld = errors.New("message too old")
Functions ¶
Types ¶
type DBOption ¶ added in v0.106.1
DBOption is an optional setting that can be used to configure the DBStore
type DBStore ¶ added in v0.106.1
type DBStore struct {
// contains filtered or unexported fields
}
DBStore is a MessageProvider that has a *sql.DB connection
func NewDBStore ¶ added in v0.106.1
Creates a new DB store using the db specified via options. It will create a messages table if it does not exist and clean up records according to the retention policy used
func (*DBStore) GetAll ¶ added in v0.106.1
func (d *DBStore) GetAll() ([]gowakuPersistence.StoredMessage, error)
GetAll returns all the stored WakuMessages
func (*DBStore) GetStoredMessage ¶ added in v0.106.1
func (d *DBStore) GetStoredMessage(row *sql.Rows) (gowakuPersistence.StoredMessage, error)
GetStoredMessage is a helper function used to convert a `*sql.Rows` into a `StoredMessage`
func (*DBStore) MostRecentTimestamp ¶ added in v0.106.1
MostRecentTimestamp returns an unix timestamp with the most recent senderTimestamp in the message table
func (*DBStore) Query ¶ added in v0.106.1
func (d *DBStore) Query(query *storepb.HistoryQuery) (*storepb.Index, []gowakuPersistence.StoredMessage, error)
Query retrieves messages from the DB
func (*DBStore) Start ¶ added in v0.117.1
func (d *DBStore) Start(ctx context.Context, timesource timesource.Timesource) error
type ProtectedTopic ¶ added in v0.166.1
type ProtectedTopicsStore ¶ added in v0.166.1
type ProtectedTopicsStore struct {
// contains filtered or unexported fields
}
DBStore is a MessageProvider that has a *sql.DB connection
func NewProtectedTopicsStore ¶ added in v0.166.1
Creates a new DB store using the db specified via options. It will create a messages table if it does not exist and clean up records according to the retention policy used
func (*ProtectedTopicsStore) Close ¶ added in v0.166.1
func (p *ProtectedTopicsStore) Close() error
func (*ProtectedTopicsStore) FetchPrivateKey ¶ added in v0.166.1
func (p *ProtectedTopicsStore) FetchPrivateKey(topic string) (privKey *ecdsa.PrivateKey, err error)
func (*ProtectedTopicsStore) Insert ¶ added in v0.166.1
func (p *ProtectedTopicsStore) Insert(pubsubTopic string, privKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey) error
func (*ProtectedTopicsStore) ProtectedTopics ¶ added in v0.166.1
func (p *ProtectedTopicsStore) ProtectedTopics() ([]ProtectedTopic, error)
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
Queries are the sqlite queries for a given table.
func NewQueries ¶
NewQueries creates a new set of queries for the passed table