Documentation ¶
Overview ¶
Package aptestutil contains ActivityPub test utilities.
Index ¶
- func NewMockCollection(id, first *url.URL, totalItems int) *vocab.CollectionType
- func NewMockCollectionPage(id, next, collID *url.URL, totalItems int, iris ...*url.URL) *vocab.CollectionPageType
- func NewMockCreateActivities(num int) []*vocab.ActivityType
- func NewMockCreateActivity(id, objID string) *vocab.ActivityType
- func NewMockLikeActivities(num int) []*vocab.ActivityType
- func NewMockLikeActivity(id, objID string) *vocab.ActivityType
- func NewMockOrderedCollection(id, first *url.URL, totalItems int) *vocab.OrderedCollectionType
- func NewMockOrderedCollectionPage(id, next, collID *url.URL, totalItems int, iris ...*url.URL) *vocab.OrderedCollectionPageType
- func NewMockPublicKey(serviceIRI *url.URL) *vocab.PublicKeyType
- func NewMockService(serviceIRI *url.URL, opts ...ServiceOpt) *vocab.ActorType
- type ServiceOpt
- type ServiceOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockCollection ¶
func NewMockCollection(id, first *url.URL, totalItems int) *vocab.CollectionType
NewMockCollection returns a mock 'Collection' with the given ID and items.
func NewMockCollectionPage ¶
func NewMockCollectionPage(id, next, collID *url.URL, totalItems int, iris ...*url.URL) *vocab.CollectionPageType
NewMockCollectionPage returns a mock 'CollectionPage' with the given ID and items.
func NewMockCreateActivities ¶ added in v0.1.3
func NewMockCreateActivities(num int) []*vocab.ActivityType
NewMockCreateActivities returns the given number of mock 'Create' activities.
func NewMockCreateActivity ¶ added in v0.1.3
func NewMockCreateActivity(id, objID string) *vocab.ActivityType
NewMockCreateActivity returns a mock 'Create' activity.
func NewMockLikeActivities ¶ added in v0.1.3
func NewMockLikeActivities(num int) []*vocab.ActivityType
NewMockLikeActivities returns the given number of mock 'Like' activities.
func NewMockLikeActivity ¶ added in v0.1.3
func NewMockLikeActivity(id, objID string) *vocab.ActivityType
NewMockLikeActivity returns a mock 'Like' activity.
func NewMockOrderedCollection ¶
func NewMockOrderedCollection(id, first *url.URL, totalItems int) *vocab.OrderedCollectionType
NewMockOrderedCollection returns a mock 'OrderedCollection' with the given ID and items.
func NewMockOrderedCollectionPage ¶
func NewMockOrderedCollectionPage(id, next, collID *url.URL, totalItems int, iris ...*url.URL) *vocab.OrderedCollectionPageType
NewMockOrderedCollectionPage returns a mock 'OrderedCollectionPage' with the given ID and items.
func NewMockPublicKey ¶
func NewMockPublicKey(serviceIRI *url.URL) *vocab.PublicKeyType
NewMockPublicKey returns a mock public key using the given service IRI.
func NewMockService ¶
func NewMockService(serviceIRI *url.URL, opts ...ServiceOpt) *vocab.ActorType
NewMockService returns a mock 'Service' type actor with the given IRI and options.
Types ¶
type ServiceOpt ¶
type ServiceOpt func(options *ServiceOptions)
ServiceOpt is a mock service option.
func WithPublicKey ¶
func WithPublicKey(pubKey *vocab.PublicKeyType) ServiceOpt
WithPublicKey sets the public key on the mock service.
type ServiceOptions ¶
type ServiceOptions struct {
PublicKey *vocab.PublicKeyType
}
ServiceOptions are options passed in to NewMockService.