storage

package module
v0.0.0-...-43d0dcf Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: MIT Imports: 1 Imported by: 1

README

MIT Licensed Build Status Test Coverage Go Report Card

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterItem

func FilterItem(i pub.Item) itemFilter

Types

type CollectionStore

type CollectionStore interface {
	// Create creates the "col" collection.
	Create(col pub.CollectionInterface) (pub.CollectionInterface, error)
	// AddTo adds "it" element to the "col" collection.
	AddTo(col pub.IRI, it pub.Item) error
	// RemoveFrom removes "it" item from "col" collection
	RemoveFrom(col pub.IRI, it pub.Item) error
}

CollectionStore allows operations on ActivityStreams collections

type Filterable

type Filterable interface {
	GetLink() pub.IRI
}

Filterable can filter objects by Type and ID This should be the minimal interface a filter object should implement for the storage layer to work. It also allows for an activitypub.IRI to be used as a filter.

type FilterableActivity

type FilterableActivity interface {
	FilterableObject
	Actors() pub.IRIs
	Objects() pub.IRIs
	Targets() pub.IRIs
}

FilterableActivity can filter activities

type FilterableCollection

type FilterableCollection interface {
	FilterableObject
	TotalItemsGt() uint
	TotalItemsLt() uint
	TotalItemsEq() uint
	TotalItemsGtE() uint
	TotalItemsLtE() uint
	Contains() pub.IRIs
}

FilterableCollection can filter collections

type FilterableItems

type FilterableItems interface {
	Filterable
	Types() pub.ActivityVocabularyTypes
	IRIs() pub.IRIs
}

type FilterableObject

type FilterableObject interface {
	FilterableItems
	AttributedTo() pub.IRIs
	InReplyTo() pub.IRIs
	MediaTypes() []pub.MimeType
	Names() []string
	Content() []string
	//PublishedBefore() time.Time
	//PublishedAfter() time.Time
	URLs() pub.IRIs
	// Audience returns the list of IRIs to check against full Audience targeting for the object
	// It should include all relevant fields: To, CC, BTo, BCC, and Audience
	// ---
	// An element of the Audience is used to get its Inbox end-point and then disseminate the current Activity
	// to it.
	Audience() pub.IRIs
	// Context returns the list of IRIs to check against an Object's Context property.
	Context() pub.IRIs
	// Generator returns the list of IRIs to check against an Object's Generator property.
	Generator() pub.IRIs
}

FilterableObject can filter objects

type ReadStore

type ReadStore interface {
	// Load returns an Item or an ItemCollection from an IRI
	Load(pub.IRI) (pub.Item, error)
}

ReadStore

type Store

type Store interface {
	ReadStore
	WriteStore
}

type WriteStore

type WriteStore interface {
	// Save saves the incoming ActivityStreams Object, and returns it together with any properties
	// populated by the method's side effects. (eg, Published property can point to the current time, etc.).
	Save(pub.Item) (pub.Item, error)
	// Delete deletes completely from storage the ActivityStreams Object
	Delete(pub.Item) error
}

WriteStore saves ActivityStreams objects.

Jump to

Keyboard shortcuts

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