Allow to create new storage NotFound errors

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-08-09 11:38:17 -03:00
parent bcfed75412
commit 5f96321c24

View File

@@ -1,6 +1,10 @@
package storage
import "github.com/play-with-docker/play-with-docker/pwd/types"
import (
"fmt"
"github.com/play-with-docker/play-with-docker/pwd/types"
)
const notFound = "NotFound"
@@ -8,6 +12,10 @@ func NotFound(e error) bool {
return e.Error() == notFound
}
func NewNotFoundError() error {
return fmt.Errorf("%s", notFound)
}
type StorageApi interface {
SessionGet(string) (*types.Session, error)
SessionPut(*types.Session) error