func NewCriteria(opts ...CriteriaOpt) *Criteria {
	q := &Criteria{}
	for _, opt := range opts {
		opt(q)
	}
	return q
}
NewCriteria returns new Criteria which may be used to perform a query.
package spi
import (
	"fmt"
	"net/url"
	"github.com/trustbloc/orb/pkg/activitypub/vocab"
)
var ErrNotFound = fmt.Errorf("not found in ActivityPub store")
type ReferenceType string
const (
	Inbox ReferenceType = "INBOX"
	Outbox ReferenceType = "OUTBOX"
	PublicOutbox ReferenceType = "PUBLIC_OUTBOX"
	Follower ReferenceType = "FOLLOWER"
	Following ReferenceType = "FOLLOWING"
	Witness ReferenceType = "WITNESS"
	Witnessing ReferenceType = "WITNESSING"
	Like ReferenceType = "LIKE"
	Liked ReferenceType = "LIKED"
	Share ReferenceType = "SHARE"
	AnchorEvent ReferenceType = "ANCHOR_EVENT"
)
type Store interface {
	PutActor(actor *vocab.ActorType) error
	GetActor(actorIRI *url.URL) (*vocab.ActorType, error)
	AddActivity(activity *vocab.ActivityType) error
	GetActivity(activityID *url.URL) (*vocab.ActivityType, error)
	QueryActivities(query *Criteria, opts ...QueryOpt) (ActivityIterator, error)
	AddReference(refType ReferenceType, objectIRI *url.URL, referenceIRI *url.URL, metaDataOpts ...RefMetadataOpt) error
	DeleteReference(refType ReferenceType, objectIRI *url.URL, referenceIRI *url.URL) error
	QueryReferences(refType ReferenceType, query *Criteria, opts ...QueryOpt) (ReferenceIterator, error)
}
type SortOrder int
const (
	SortAscending SortOrder = iota
	SortDescending
)
type QueryOptions struct {
	PageNumber int
	PageSize   int
	SortOrder  SortOrder
}
type QueryOpt func(options *QueryOptions)
func WithPageSize(pageSize int) QueryOpt {
	return func(options *QueryOptions) {
		options.PageSize = pageSize
	}
}
func WithPageNum(pageNum int) QueryOpt {
	return func(options *QueryOptions) {
		options.PageNumber = pageNum
	}
}
func WithSortOrder(sortOrder SortOrder) QueryOpt {
	return func(options *QueryOptions) {
		options.SortOrder = sortOrder
	}
}
type RefMetadata struct {
	ActivityType vocab.Type
}
type RefMetadataOpt func(refMetaData *RefMetadata)
func WithActivityType(activityType vocab.Type) RefMetadataOpt {
	return func(refMetaData *RefMetadata) {
		refMetaData.ActivityType = activityType
	}
}
type Criteria struct {
	Types         []vocab.Type
	ReferenceType ReferenceType
	ObjectIRI     *url.URL
	ReferenceIRI  *url.URL
	ActivityIRIs  []*url.URL
}
type CriteriaOpt func(q *Criteria)