mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-09-07 05:10:40 +02:00
21 lines
485 B
Go
21 lines
485 B
Go
// Copyright 2014 by Sascha L. Teichmann
|
|
// Use of this source code is governed by the MIT license
|
|
// that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
type Session interface {
|
|
Fetch(hash, key []byte) ([]byte, error)
|
|
InTransaction() bool
|
|
Store(hash, key, value []byte) (bool, error)
|
|
AllKeys(hash []byte) (chan []byte, int, error)
|
|
BeginTransaction() error
|
|
CommitTransaction() error
|
|
Close() error
|
|
}
|
|
|
|
type Backend interface {
|
|
NewSession() (Session, error)
|
|
Shutdown() error
|
|
}
|