mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-28 07:19:08 +01:00
Remove unused event store methods
This commit is contained in:
@@ -16,8 +16,6 @@ type Type string
|
|||||||
type Store interface {
|
type Store interface {
|
||||||
// Save an event in the store
|
// Save an event in the store
|
||||||
Save(event Event) (*Event, error)
|
Save(event Event) (*Event, error)
|
||||||
// GetSince returns a list of events from the store for a given account since the specified time
|
|
||||||
GetSince(accountID string, from time.Time) ([]Event, error)
|
|
||||||
// Get returns "limit" number of events from the "offset" index ordered descending or ascending by a timestamp
|
// Get returns "limit" number of events from the "offset" index ordered descending or ascending by a timestamp
|
||||||
Get(accountID string, offset, limit int, descending bool) ([]Event, error)
|
Get(accountID string, offset, limit int, descending bool) ([]Event, error)
|
||||||
// Close the sink flushing events if necessary
|
// Close the sink flushing events if necessary
|
||||||
|
|||||||
@@ -90,23 +90,6 @@ func (store *SQLiteStore) Get(accountID string, offset, limit int, descending bo
|
|||||||
return processResult(result)
|
return processResult(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSince returns a list of events from the store for a given account since the specified time
|
|
||||||
func (store *SQLiteStore) GetSince(accountID string, from time.Time) ([]Event, error) {
|
|
||||||
stmt, err := store.db.Prepare("SELECT id, operation, timestamp, modifier, target, account, type" +
|
|
||||||
" FROM events WHERE account = ? and timestamp >= ?;")
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
result, err := stmt.Query(accountID, from)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
defer result.Close() //nolint
|
|
||||||
return processResult(result)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save an event in the SQLite events table
|
// Save an event in the SQLite events table
|
||||||
func (store *SQLiteStore) Save(event Event) (*Event, error) {
|
func (store *SQLiteStore) Save(event Event) (*Event, error) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user