💥 Add store
This commit is contained in:
parent
0e2d302804
commit
bdc625b57e
6 changed files with 127 additions and 6 deletions
31
store/store.go
Normal file
31
store/store.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package store
|
||||
|
||||
import (
|
||||
st "github.com/go-ap/fedbox/storage"
|
||||
proc "github.com/go-ap/processing"
|
||||
"github.com/openshift/osin"
|
||||
)
|
||||
|
||||
type ClientSaver interface {
|
||||
// UpdateClient updates the client (identified by it's id) and replaces the values with the values of client.
|
||||
UpdateClient(c osin.Client) error
|
||||
// CreateClient stores the client in the database and returns an error, if something went wrong.
|
||||
CreateClient(c osin.Client) error
|
||||
// RemoveClient removes a client (identified by id) from the database. Returns an error if something went wrong.
|
||||
RemoveClient(id string) error
|
||||
}
|
||||
|
||||
type ClientLister interface {
|
||||
// ListClients lists existing clients
|
||||
ListClients() ([]osin.Client, error)
|
||||
GetClient(id string) (osin.Client, error)
|
||||
}
|
||||
|
||||
type Store interface {
|
||||
ClientSaver
|
||||
ClientLister
|
||||
proc.Store
|
||||
proc.KeyLoader
|
||||
osin.Storage
|
||||
st.MetadataTyper
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue