Allow to create new storage NotFound errors
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
package storage
|
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"
|
const notFound = "NotFound"
|
||||||
|
|
||||||
@@ -8,6 +12,10 @@ func NotFound(e error) bool {
|
|||||||
return e.Error() == notFound
|
return e.Error() == notFound
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewNotFoundError() error {
|
||||||
|
return fmt.Errorf("%s", notFound)
|
||||||
|
}
|
||||||
|
|
||||||
type StorageApi interface {
|
type StorageApi interface {
|
||||||
SessionGet(string) (*types.Session, error)
|
SessionGet(string) (*types.Session, error)
|
||||||
SessionPut(*types.Session) error
|
SessionPut(*types.Session) error
|
||||||
|
|||||||
Reference in New Issue
Block a user