Add storage API abstraction
This commit is contained in:
committed by
Marcos Lilljedahl
commit
08b64dadde
@@ -9,16 +9,17 @@ func NotFound(e error) bool {
|
||||
}
|
||||
|
||||
type StorageApi interface {
|
||||
SessionGet(sessionId string) (*types.Session, error)
|
||||
SessionGet(string) (*types.Session, error)
|
||||
SessionPut(*types.Session) error
|
||||
SessionCount() (int, error)
|
||||
SessionDelete(sessionId string) error
|
||||
SessionDelete(string) error
|
||||
|
||||
InstanceFindByAlias(sessionPrefix, alias string) (*types.Instance, error)
|
||||
// Should have the session id too, soon
|
||||
InstanceFindByIP(ip string) (*types.Instance, error)
|
||||
InstanceFindByIPAndSession(sessionPrefix, ip string) (*types.Instance, error)
|
||||
InstanceCount() (int, error)
|
||||
InstanceCreate(sessionId string, instance *types.Instance) error
|
||||
InstanceDelete(sessionId, instanceName string) error
|
||||
|
||||
ClientCount() (int, error)
|
||||
InstanceCount() (int, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user