-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstorage.go
More file actions
32 lines (23 loc) · 810 Bytes
/
Copy pathstorage.go
File metadata and controls
32 lines (23 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package quota
import (
"time"
)
// Storage is an interface for storing and retrieving candles.
type Storage interface {
// All returns all the candle in the storage.
All() (*Quota, error)
// Get retrieves candle from the storage.
Get(openTime time.Time) (*Candle, error)
// GetByIndex retrieves candle from the storage by index.
GetByIndex(index int) (*Candle, error)
// Put stores the given candle in the storage.
Put(candle ...*Candle) error
// Update updates candle in the storage.
Update(candle ...*Candle) error
// Delete removes the candle from the storage.
Delete(candle *Candle) error
// Close closes the storage.
Close() error
// PersistOlds will store the old candles into a persistance storage and remove them from the quota.
PersistOlds(persist Storage, size int) error
}