aptestutil

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package aptestutil contains ActivityPub test utilities.

Index

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.

Jump to

Keyboard shortcuts

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