combluotion/internal/testmocks/store.go
Dan Jones e7b88bcc09 Improve Store
Still need to fill out SQLite bootstrap

Also setup plug-in system mechanism
2024-09-14 20:37:51 -05:00

45 lines
810 B
Go

package testmocks
import (
"codeberg.org/danjones000/lenore/config"
vocab "github.com/go-ap/activitypub"
"github.com/go-ap/filters"
)
type st struct{}
func (s *st) Bootstrap(config.Config) error {
return nil
}
func (s *st) Load(iri vocab.IRI, filters ...filters.Check) (vocab.Item, error) {
i := vocab.ActorNew(iri, vocab.ActorType)
return i, nil
}
func (s *st) Save(v vocab.Item) (vocab.Item, error) {
return v, nil
}
func (s *st) Delete(v vocab.Item) error {
return nil
}
func (s *st) Create(col vocab.CollectionInterface) (vocab.CollectionInterface, error) {
return col, nil
}
func (s *st) AddTo(col vocab.IRI, it vocab.Item) error {
return nil
}
func (s *st) RemoveFrom(col vocab.IRI, it vocab.Item) error {
return nil
}
func (s *st) Close() {
}
func GetStore() *st {
return &st{}
}