integration

package
v0.0.0-...-45caf90 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EquateWeakErrors = cmp.FilterValues(areErrors, cmp.Comparer(compareErrors))

Functions

func DoesNotHaveItem

func DoesNotHaveItem(it vocab.Item) itemCheckFn

func HasActor

func HasActor(maybeItems ...any) itemCheckFn

func HasAnyOf

func HasAnyOf(maybeItems ...any) itemCheckFn

func HasAttributedTo

func HasAttributedTo(maybeItems ...any) itemCheckFn

func HasAudience

func HasAudience(u ...vocab.Item) itemCheckFn

func HasBCC

func HasBCC(to ...vocab.Item) itemCheckFn

func HasBto

func HasBto(to ...vocab.Item) itemCheckFn

func HasCC

func HasCC(cc ...vocab.Item) itemCheckFn

func HasContent

func HasContent[T ~string | vocab.NaturalLanguageValues](cont T) itemCheckFn

func HasContext

func HasContext(u ...vocab.Item) itemCheckFn

func HasEndpoints

func HasEndpoints(e *vocab.Endpoints) itemCheckFn

func HasError

func HasError(wantErr error) errCheckFn

func HasExactItems

func HasExactItems(items ...vocab.Item) itemCheckFn

func HasFormerType

func HasFormerType(typ vocab.Typer) itemCheckFn

func HasID

func HasID(maybeIRI any) itemCheckFn

func HasInReplyTo

func HasInReplyTo(u ...vocab.Item) itemCheckFn

func HasInbox

func HasInbox(want vocab.IRI) itemCheckFn

func HasItem

func HasItem(it vocab.Item) itemCheckFn

func HasMediaType

func HasMediaType(mt vocab.MimeType) itemCheckFn

func HasName

func HasName[T ~string | vocab.NaturalLanguageValues](cont T) itemCheckFn

func HasOneOf

func HasOneOf(maybeItems ...any) itemCheckFn

func HasOrigin

func HasOrigin(maybeItems ...any) itemCheckFn

func HasOutbox

func HasOutbox(want vocab.IRI) itemCheckFn

func HasPreferredUsername

func HasPreferredUsername[T ~string | vocab.NaturalLanguageValues](name T) itemCheckFn

func HasProxyURL

func HasProxyURL(iri vocab.IRI) itemCheckFn

func HasPublicKey

func HasPublicKey(pub vocab.PublicKey) itemCheckFn

func HasReplies

func HasReplies(maybeIRI any) itemCheckFn

func HasSharedInbox

func HasSharedInbox(iri vocab.Item) itemCheckFn

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 HasTag

func HasTag(u ...vocab.Item) itemCheckFn

func HasTarget

func HasTarget(maybeItems ...any) itemCheckFn

func HasTo

func HasTo(to ...vocab.Item) itemCheckFn

func HasTotalItems

func HasTotalItems(cnt int) itemCheckFn

func HasType

func HasType(typ vocab.Typer) itemCheckFn

func HasURL

func HasURL(u ...vocab.Item) itemCheckFn

func PublicKey

func PublicKey(k any, id vocab.IRI) vocab.PublicKey

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 InitFn

type InitFn any

type LocalStorage

type LocalStorage conformance.MemStorage

func Storage

func Storage(fns ...InitFn) *LocalStorage

func (*LocalStorage) AddTo

func (l *LocalStorage) AddTo(iri vocab.IRI, item ...vocab.Item) error

func (*LocalStorage) CheckObject

func (l *LocalStorage) CheckObject(iri vocab.IRI, maybeItems ...any) itemCheckFn

func (*LocalStorage) Delete

func (l *LocalStorage) Delete(item vocab.Item) error

func (*LocalStorage) Load

func (l *LocalStorage) Load(iri vocab.IRI, check ...filters.Check) (vocab.Item, error)

func (*LocalStorage) RemoveFrom

func (l *LocalStorage) RemoveFrom(iri vocab.IRI, item ...vocab.Item) error

func (*LocalStorage) Save

func (l *LocalStorage) Save(item vocab.Item) (vocab.Item, error)

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 (mp *MockPlumbing) GenerateID(it vocab.Item, byActivity vocab.Item) (vocab.ID, error)

func (*MockPlumbing) InitP

func (mp *MockPlumbing) InitP(fns ...InitFn) *processing.P

func (*MockPlumbing) LocalIRI

func (mp *MockPlumbing) LocalIRI(i vocab.IRI) bool

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) Run

func (mr *MockRemote) Run(t *testing.T, _ vocab.Item, _ error)

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)

func Request

func Request(iri vocab.IRI, items ...vocab.Item) RemoteInitFn

type RemoteStorage

type RemoteStorage conformance.MemStorage

func (*RemoteStorage) AddTo

func (r *RemoteStorage) AddTo(iri vocab.IRI, item ...vocab.Item) error

func (*RemoteStorage) Delete

func (r *RemoteStorage) Delete(item vocab.Item) error

func (*RemoteStorage) Load

func (r *RemoteStorage) Load(iri vocab.IRI, check ...filters.Check) (vocab.Item, error)

func (*RemoteStorage) RemoveFrom

func (r *RemoteStorage) RemoveFrom(iri vocab.IRI, item ...vocab.Item) error

func (*RemoteStorage) Save

func (r *RemoteStorage) Save(item vocab.Item) (vocab.Item, error)

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 TestAssertion

type TestAssertion interface {
	Run(*testing.T, vocab.Item, error)
}

type TestAssertions

type TestAssertions []TestAssertion

type TestPair

type TestPair struct {
	Name       string
	Author     vocab.Actor
	ReceivedIn vocab.IRI

	Activity vocab.Item

	TestFns TestAssertions
}

func (TestPair) Label

func (tt TestPair) Label() string

func (TestPair) TestFn

func (tt TestPair) TestFn(P *processing.P) func(*testing.T)

type TestSuite

type TestSuite struct {
	Name  string
	Tests []RunnableTest
}

func (TestSuite) Label

func (ts TestSuite) Label() string

func (TestSuite) Run

func (ts TestSuite) Run(t *testing.T, P *processing.P)

func (TestSuite) TestFn

func (ts TestSuite) TestFn(P *processing.P) func(t *testing.T)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址