Files
play-with-docker/storage/storage.go
Jonathan Leibiusky @xetorthio d8ec0eb754 Make storage NotFoundError available
2017-09-01 20:29:54 -03:00

38 lines
1.0 KiB
Go

package storage
import (
"errors"
"github.com/play-with-docker/play-with-docker/pwd/types"
)
var NotFoundError = errors.New("NotFound")
func NotFound(e error) bool {
return e == NotFoundError
}
type StorageApi interface {
SessionGet(id string) (*types.Session, error)
SessionGetAll() ([]*types.Session, error)
SessionPut(session *types.Session) error
SessionDelete(id string) error
SessionCount() (int, error)
InstanceGet(name string) (*types.Instance, error)
InstancePut(instance *types.Instance) error
InstanceDelete(name string) error
InstanceCount() (int, error)
InstanceFindBySessionId(sessionId string) ([]*types.Instance, error)
WindowsInstanceGetAll() ([]*types.WindowsInstance, error)
WindowsInstancePut(instance *types.WindowsInstance) error
WindowsInstanceDelete(id string) error
ClientGet(id string) (*types.Client, error)
ClientPut(client *types.Client) error
ClientDelete(id string) error
ClientCount() (int, error)
ClientFindBySessionId(sessionId string) ([]*types.Client, error)
}