*: add gRPC server for interacting with storages

This commit is contained in:
Eric Chiang
2016-07-31 23:25:06 -07:00
parent cab271f304
commit 94e26782b4
5 changed files with 217 additions and 1 deletions

View File

@@ -77,13 +77,14 @@ func Open(driverName string, config map[string]string) (Storage, error) {
type Storage interface {
Close() error
// TODO(ericchiang): Let the storages set the IDs of these objects.
CreateAuthRequest(a AuthRequest) error
CreateClient(c Client) error
CreateAuthCode(c AuthCode) error
CreateRefresh(r Refresh) error
// TODO(ericchiang): return (T, bool, error) so we can indicate not found
// requests that way.
// requests that way instead of using ErrNotFound.
GetAuthRequest(id string) (AuthRequest, error)
GetAuthCode(id string) (AuthCode, error)
GetClient(id string) (Client, error)