✅ Test app
This commit is contained in:
parent
e441e541c7
commit
6498f3d56b
4 changed files with 142 additions and 2 deletions
38
internal/testmocks/store.go
Normal file
38
internal/testmocks/store.go
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
package testmocks
|
||||
|
||||
import (
|
||||
vocab "github.com/go-ap/activitypub"
|
||||
"github.com/go-ap/filters"
|
||||
proc "github.com/go-ap/processing"
|
||||
)
|
||||
|
||||
type st struct{}
|
||||
|
||||
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 GetStore() proc.Store {
|
||||
return &st{}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue