💥 Add store

This commit is contained in:
Dan Jones 2024-09-14 11:27:28 -05:00
commit bdc625b57e
6 changed files with 127 additions and 6 deletions

View file

@ -1,9 +1,9 @@
package testmocks
import (
"codeberg.org/danjones000/lenore/store"
vocab "github.com/go-ap/activitypub"
"github.com/go-ap/filters"
proc "github.com/go-ap/processing"
)
type st struct{}
@ -33,6 +33,9 @@ func (s *st) RemoveFrom(col vocab.IRI, it vocab.Item) error {
return nil
}
func GetStore() proc.Store {
func (s *st) Close() {
}
func GetStore() store.Store {
return &st{}
}

View file

@ -0,0 +1,20 @@
package testmocks
import (
"crypto"
vocab "github.com/go-ap/activitypub"
proc "github.com/go-ap/processing"
)
func (s *st) LoadKey(vocab.IRI) (crypto.PrivateKey, error) {
return nil, nil
}
func (s *st) LoadMetadata(vocab.IRI) (*proc.Metadata, error) {
return nil, nil
}
func (s *st) SaveMetadata(proc.Metadata, vocab.IRI) error {
return nil
}

View file

@ -0,0 +1,37 @@
package testmocks
import (
"github.com/openshift/osin"
)
func (s *st) LoadAccess(string) (*osin.AccessData, error) {
return nil, nil
}
func (s *st) SaveAccess(*osin.AccessData) error {
return nil
}
func (s *st) RemoveAccess(string) error {
return nil
}
func (s *st) LoadAuthorize(string) (*osin.AuthorizeData, error) {
return nil, nil
}
func (s *st) SaveAuthorize(*osin.AuthorizeData) error {
return nil
}
func (s *st) RemoveAuthorize(string) error {
return nil
}
func (s *st) LoadRefresh(string) (*osin.AccessData, error) {
return nil, nil
}
func (s *st) RemoveRefresh(string) error {
return nil
}

View file

@ -0,0 +1,30 @@
package testmocks
import (
"github.com/openshift/osin"
)
func (s *st) Clone() osin.Storage {
n := *s
return &n
}
func (s *st) GetClient(string) (osin.Client, error) {
return &osin.DefaultClient{}, nil
}
func (s *st) CreateClient(osin.Client) error {
return nil
}
func (s *st) UpdateClient(osin.Client) error {
return nil
}
func (s *st) RemoveClient(string) error {
return nil
}
func (s *st) ListClients() (cl []osin.Client, er error) {
return
}