mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-11 17:30:18 +01:00
Use a type block for backend interfaces.
This commit is contained in:
parent
efe6c6abb8
commit
37eb407572
28
backend.go
28
backend.go
@ -4,17 +4,19 @@
|
|||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
type Session interface {
|
type (
|
||||||
Fetch(hash, key []byte) ([]byte, error)
|
Session interface {
|
||||||
InTransaction() bool
|
Fetch(hash, key []byte) ([]byte, error)
|
||||||
Store(hash, key, value []byte) (bool, error)
|
InTransaction() bool
|
||||||
AllKeys(hash []byte) (chan []byte, int, error)
|
Store(hash, key, value []byte) (bool, error)
|
||||||
BeginTransaction() error
|
AllKeys(hash []byte) (chan []byte, int, error)
|
||||||
CommitTransaction() error
|
BeginTransaction() error
|
||||||
Close() error
|
CommitTransaction() error
|
||||||
}
|
Close() error
|
||||||
|
}
|
||||||
|
|
||||||
type Backend interface {
|
Backend interface {
|
||||||
NewSession() (Session, error)
|
NewSession() (Session, error)
|
||||||
Shutdown() error
|
Shutdown() error
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user