mirror of
https://github.com/skidoodle/pastebin
synced 2026-04-29 03:37:40 +02:00
small refactor
This commit is contained in:
+12
-5
@@ -1,8 +1,15 @@
|
||||
package store
|
||||
|
||||
// Store is the interface for a key-value store.
|
||||
type Store interface {
|
||||
Get(key string) (string, bool, error)
|
||||
Set(key, value string) error
|
||||
Del(key string) error
|
||||
import "time"
|
||||
|
||||
type Paste struct {
|
||||
Content string `json:"content"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type Store interface {
|
||||
Get(id string) (*Paste, bool, error)
|
||||
GetIDByHash(hash string) (string, bool, error)
|
||||
Set(id, hash, content string) error
|
||||
Del(id string) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user