Documentation
¶
Index ¶
- Variables
- func DoesNotHaveItem(it vocab.Item) itemCheckFn
- func HasActor(maybeItems ...any) itemCheckFn
- func HasAnyOf(maybeItems ...any) itemCheckFn
- func HasAttributedTo(maybeItems ...any) itemCheckFn
- func HasAudience(u ...vocab.Item) itemCheckFn
- func HasBCC(to ...vocab.Item) itemCheckFn
- func HasBto(to ...vocab.Item) itemCheckFn
- func HasCC(cc ...vocab.Item) itemCheckFn
- func HasContent[T ~string | vocab.NaturalLanguageValues](cont T) itemCheckFn
- func HasContext(u ...vocab.Item) itemCheckFn
- func HasEndpoints(e *vocab.Endpoints) itemCheckFn
- func HasError(wantErr error) errCheckFn
- func HasExactItems(items ...vocab.Item) itemCheckFn
- func HasFormerType(typ vocab.Typer) itemCheckFn
- func HasID(maybeIRI any) itemCheckFn
- func HasInReplyTo(u ...vocab.Item) itemCheckFn
- func HasInbox(want vocab.IRI) itemCheckFn
- func HasItem(it vocab.Item) itemCheckFn
- func HasMediaType(mt vocab.MimeType) itemCheckFn
- func HasName[T ~string | vocab.NaturalLanguageValues](cont T) itemCheckFn
- func HasOneOf(maybeItems ...any) itemCheckFn
- func HasOrigin(maybeItems ...any) itemCheckFn
- func HasOutbox(want vocab.IRI) itemCheckFn
- func HasPreferredUsername[T ~string | vocab.NaturalLanguageValues](name T) itemCheckFn
- func HasProxyURL(iri vocab.IRI) itemCheckFn
- func HasPublicKey(pub vocab.PublicKey) itemCheckFn
- func HasReplies(maybeIRI any) itemCheckFn
- func HasSharedInbox(iri vocab.Item) itemCheckFn
- func HasSource[T ~string | vocab.NaturalLanguageValues](cont T, mt vocab.MimeType) itemCheckFn
- func HasStreams(maybeItems ...any) itemCheckFn
- func HasSummary[T ~string | vocab.NaturalLanguageValues](cont T) itemCheckFn
- func HasTag(u ...vocab.Item) itemCheckFn
- func HasTarget(maybeItems ...any) itemCheckFn
- func HasTo(to ...vocab.Item) itemCheckFn
- func HasTotalItems(cnt int) itemCheckFn
- func HasType(typ vocab.Typer) itemCheckFn
- func HasURL(u ...vocab.Item) itemCheckFn
- func PublicKey(k any, id vocab.IRI) vocab.PublicKey
- func RequestObject(maybeItems ...any) itemCheckFn
- func WasDeleted(maybeTime any) itemCheckFn
- func WasPublished(maybeTime any) itemCheckFn
- func WasUpdated(maybeTime any) itemCheckFn
- func WithRemote(mr *MockRemote) processing.OptionFn
- type InitFn
- type LocalStorage
- func (l *LocalStorage) AddTo(iri vocab.IRI, item ...vocab.Item) error
- func (l *LocalStorage) CheckObject(iri vocab.IRI, maybeItems ...any) itemCheckFn
- func (l *LocalStorage) Delete(item vocab.Item) error
- func (l *LocalStorage) Load(iri vocab.IRI, check ...filters.Check) (vocab.Item, error)
- func (l *LocalStorage) RemoveFrom(iri vocab.IRI, item ...vocab.Item) error
- func (l *LocalStorage) Save(item vocab.Item) (vocab.Item, error)
- type LocalStorageInitFn
- type MockPlumbing
- func (mp *MockPlumbing) GenerateID(it vocab.Item, byActivity vocab.Item) (vocab.ID, error)
- func (mp *MockPlumbing) InitP(fns ...InitFn) *processing.P
- func (mp *MockPlumbing) LocalIRI(i vocab.IRI) bool
- func (mp *MockPlumbing) Now() time.Time
- func (mp *MockPlumbing) PopTime() time.Time
- func (mp *MockPlumbing) ShiftIRI() vocab.IRI
- type MockRemote
- type RemoteInitFn
- type RemoteStorage
- func (r *RemoteStorage) AddTo(iri vocab.IRI, item ...vocab.Item) error
- func (r *RemoteStorage) Delete(item vocab.Item) error
- func (r *RemoteStorage) Load(iri vocab.IRI, check ...filters.Check) (vocab.Item, error)
- func (r *RemoteStorage) RemoveFrom(iri vocab.IRI, item ...vocab.Item) error
- func (r *RemoteStorage) Save(item vocab.Item) (vocab.Item, error)
- type RemoteStorageInitFn
- type RunnableTest
- type TestAssertion
- type TestAssertions
- type TestPair
- type TestSuite
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RootID = vocab.IRI("http://example.localdomain") AuthorID = RootID.AddPath("~jdoe") Author = build.Person( build.WithID(AuthorID), build.WithName(vocab.DefaultLangValue("Jane Doe")), build.WithPublished(time.Date(2001, time.January, 1, 0, 0, 0, 0, time.UTC)), build.WithAudience(vocab.PublicNS), build.WithInbox(), build.WithOutbox(), build.WithFollowing(), build.WithFollowers(), build.WithLiked(), build.WithLikes(), build.WithReplies(), build.WithShares(), build.WithPreferredUsername(vocab.DefaultLangValue("jdoe")), build.WithSharedInbox(vocab.Inbox.IRI(RootID)), build.WithProxyURL(RootID.AddPath("proxy")), build.WithPublicKey(PublicKey(ed2559Key.Public(), AuthorID)), ) RemoteAuthorID = vocab.IRI("http://example.com/~alice") RemoteAuthor = build.Person( build.WithID(RemoteAuthorID), build.WithName(vocab.DefaultLangValue("Alice L.")), build.WithAudience(vocab.PublicNS), build.WithInbox(), build.WithOutbox(), build.WithFollowing(), build.WithFollowers(), build.WithLiked(), build.WithLikes(), build.WithReplies(), build.WithShares(), build.WithPreferredUsername(vocab.DefaultLangValue("wonder_alice")), build.WithSharedInbox(vocab.Inbox.IRI(RemoteAuthorID)), build.WithProxyURL(RootID.AddPath("proxy")), build.WithPublicKey(PublicKey(rsaKey.Public(), RemoteAuthorID)), ) )
View Source
var EquateWeakErrors = cmp.FilterValues(areErrors, cmp.Comparer(compareErrors))
Functions ¶
func DoesNotHaveItem ¶
func HasAttributedTo ¶
func HasAttributedTo(maybeItems ...any) itemCheckFn
func HasAudience ¶
func HasContent ¶
func HasContent[T ~string | vocab.NaturalLanguageValues](cont T) itemCheckFn
func HasContext ¶
func HasEndpoints ¶
func HasExactItems ¶
func HasFormerType ¶
func HasInReplyTo ¶
func HasMediaType ¶
func HasName ¶
func HasName[T ~string | vocab.NaturalLanguageValues](cont T) itemCheckFn
func HasPreferredUsername ¶
func HasPreferredUsername[T ~string | vocab.NaturalLanguageValues](name T) itemCheckFn
func HasProxyURL ¶
func HasPublicKey ¶
func HasReplies ¶
func HasReplies(maybeIRI any) itemCheckFn
func HasSharedInbox ¶
func HasSource ¶
func HasSource[T ~string | vocab.NaturalLanguageValues](cont T, mt vocab.MimeType) itemCheckFn
func HasStreams ¶
func HasStreams(maybeItems ...any) itemCheckFn
func HasSummary ¶
func HasSummary[T ~string | vocab.NaturalLanguageValues](cont T) itemCheckFn
func HasTotalItems ¶
func HasTotalItems(cnt int) itemCheckFn
func RequestObject ¶
func RequestObject(maybeItems ...any) itemCheckFn
func WasDeleted ¶
func WasDeleted(maybeTime any) itemCheckFn
func WasPublished ¶
func WasPublished(maybeTime any) itemCheckFn
func WasUpdated ¶
func WasUpdated(maybeTime any) itemCheckFn
func WithRemote ¶
func WithRemote(mr *MockRemote) processing.OptionFn
Types ¶
type LocalStorage ¶
type LocalStorage conformance.MemStorage
func Storage ¶
func Storage(fns ...InitFn) *LocalStorage
func (*LocalStorage) CheckObject ¶
func (l *LocalStorage) CheckObject(iri vocab.IRI, maybeItems ...any) itemCheckFn
func (*LocalStorage) RemoveFrom ¶
type LocalStorageInitFn ¶
type LocalStorageInitFn func(storage *LocalStorage)
func WithLocalMocks ¶
func WithLocalMocks(it ...vocab.Item) LocalStorageInitFn
type MockPlumbing ¶
type MockPlumbing struct {
// contains filtered or unexported fields
}
func (*MockPlumbing) GenerateID ¶
func (*MockPlumbing) InitP ¶
func (mp *MockPlumbing) InitP(fns ...InitFn) *processing.P
func (*MockPlumbing) Now ¶
func (mp *MockPlumbing) Now() time.Time
func (*MockPlumbing) PopTime ¶
func (mp *MockPlumbing) PopTime() time.Time
func (*MockPlumbing) ShiftIRI ¶
func (mp *MockPlumbing) ShiftIRI() vocab.IRI
type MockRemote ¶
type MockRemote struct {
S *RemoteStorage
C processing.ActivityPubClient
// contains filtered or unexported fields
}
func Remote ¶
func Remote(fns ...InitFn) *MockRemote
func (*MockRemote) ServeHTTP ¶
func (mr *MockRemote) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*MockRemote) WillReceive ¶
func (mr *MockRemote) WillReceive(initFns ...RemoteInitFn) TestAssertion
type RemoteInitFn ¶
type RemoteInitFn func(storage *MockRemote)
type RemoteStorage ¶
type RemoteStorage conformance.MemStorage
func (*RemoteStorage) RemoveFrom ¶
type RemoteStorageInitFn ¶
type RemoteStorageInitFn func(storage *RemoteStorage)
func WithRemoteMocks ¶
func WithRemoteMocks(it ...vocab.Item) RemoteStorageInitFn
type RunnableTest ¶
type RunnableTest interface {
Label() string
// TestFn is one way to run the tests directly from a func(*testing.T)
TestFn(*processing.P) func(*testing.T)
}
type TestAssertions ¶
type TestAssertions []TestAssertion
type TestPair ¶
type TestSuite ¶
type TestSuite struct {
Name string
Tests []RunnableTest
}
Click to show internal directories.
Click to hide internal directories.