ap

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActivityAccept          = "Accept"          // ActivityStreamsAccept https://www.w3.org/TR/activitystreams-vocabulary/#dfn-accept
	ActivityAdd             = "Add"             // ActivityStreamsAdd https://www.w3.org/TR/activitystreams-vocabulary/#dfn-add
	ActivityAnnounce        = "Announce"        // ActivityStreamsAnnounce https://www.w3.org/TR/activitystreams-vocabulary/#dfn-announce
	ActivityArrive          = "Arrive"          // ActivityStreamsArrive https://www.w3.org/TR/activitystreams-vocabulary/#dfn-arrive
	ActivityBlock           = "Block"           // ActivityStreamsBlock https://www.w3.org/TR/activitystreams-vocabulary/#dfn-block
	ActivityCreate          = "Create"          // ActivityStreamsCreate https://www.w3.org/TR/activitystreams-vocabulary/#dfn-create
	ActivityDelete          = "Delete"          // ActivityStreamsDelete https://www.w3.org/TR/activitystreams-vocabulary/#dfn-delete
	ActivityDislike         = "Dislike"         // ActivityStreamsDislike https://www.w3.org/TR/activitystreams-vocabulary/#dfn-dislike
	ActivityFlag            = "Flag"            // ActivityStreamsFlag https://www.w3.org/TR/activitystreams-vocabulary/#dfn-flag
	ActivityFollow          = "Follow"          // ActivityStreamsFollow https://www.w3.org/TR/activitystreams-vocabulary/#dfn-follow
	ActivityIgnore          = "Ignore"          // ActivityStreamsIgnore https://www.w3.org/TR/activitystreams-vocabulary/#dfn-ignore
	ActivityInvite          = "Invite"          // ActivityStreamsInvite https://www.w3.org/TR/activitystreams-vocabulary/#dfn-invite
	ActivityJoin            = "Join"            // ActivityStreamsJoin https://www.w3.org/TR/activitystreams-vocabulary/#dfn-join
	ActivityLeave           = "Leave"           // ActivityStreamsLeave https://www.w3.org/TR/activitystreams-vocabulary/#dfn-leave
	ActivityLike            = "Like"            // ActivityStreamsLike https://www.w3.org/TR/activitystreams-vocabulary/#dfn-like
	ActivityListen          = "Listen"          // ActivityStreamsListen https://www.w3.org/TR/activitystreams-vocabulary/#dfn-listen
	ActivityMove            = "Move"            // ActivityStreamsMove https://www.w3.org/TR/activitystreams-vocabulary/#dfn-move
	ActivityOffer           = "Offer"           // ActivityStreamsOffer https://www.w3.org/TR/activitystreams-vocabulary/#dfn-offer
	ActivityQuestion        = "Question"        // ActivityStreamsQuestion https://www.w3.org/TR/activitystreams-vocabulary/#dfn-question
	ActivityReject          = "Reject"          // ActivityStreamsReject https://www.w3.org/TR/activitystreams-vocabulary/#dfn-reject
	ActivityRead            = "Read"            // ActivityStreamsRead https://www.w3.org/TR/activitystreams-vocabulary/#dfn-read
	ActivityRemove          = "Remove"          // ActivityStreamsRemove https://www.w3.org/TR/activitystreams-vocabulary/#dfn-remove
	ActivityTentativeReject = "TentativeReject" // ActivityStreamsTentativeReject https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tentativereject
	ActivityTentativeAccept = "TentativeAccept" // ActivityStreamsTentativeAccept https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tentativeaccept
	ActivityTravel          = "Travel"          // ActivityStreamsTravel https://www.w3.org/TR/activitystreams-vocabulary/#dfn-travel
	ActivityUndo            = "Undo"            // ActivityStreamsUndo https://www.w3.org/TR/activitystreams-vocabulary/#dfn-undo
	ActivityUpdate          = "Update"          // ActivityStreamsUpdate https://www.w3.org/TR/activitystreams-vocabulary/#dfn-update
	ActivityView            = "View"            // ActivityStreamsView https://www.w3.org/TR/activitystreams-vocabulary/#dfn-view

	ActorApplication  = "Application"  // ActivityStreamsApplication https://www.w3.org/TR/activitystreams-vocabulary/#dfn-application
	ActorGroup        = "Group"        // ActivityStreamsGroup https://www.w3.org/TR/activitystreams-vocabulary/#dfn-group
	ActorOrganization = "Organization" // ActivityStreamsOrganization https://www.w3.org/TR/activitystreams-vocabulary/#dfn-organization
	ActorPerson       = "Person"       // ActivityStreamsPerson https://www.w3.org/TR/activitystreams-vocabulary/#dfn-person
	ActorService      = "Service"      // ActivityStreamsService https://www.w3.org/TR/activitystreams-vocabulary/#dfn-service

	ObjectArticle               = "Article"               // ActivityStreamsArticle https://www.w3.org/TR/activitystreams-vocabulary/#dfn-article
	ObjectAudio                 = "Audio"                 // ActivityStreamsAudio https://www.w3.org/TR/activitystreams-vocabulary/#dfn-audio
	ObjectDocument              = "Document"              // ActivityStreamsDocument https://www.w3.org/TR/activitystreams-vocabulary/#dfn-document
	ObjectEvent                 = "Event"                 // ActivityStreamsEvent https://www.w3.org/TR/activitystreams-vocabulary/#dfn-event
	ObjectImage                 = "Image"                 // ActivityStreamsImage https://www.w3.org/TR/activitystreams-vocabulary/#dfn-image
	ObjectNote                  = "Note"                  // ActivityStreamsNote https://www.w3.org/TR/activitystreams-vocabulary/#dfn-note
	ObjectPage                  = "Page"                  // ActivityStreamsPage https://www.w3.org/TR/activitystreams-vocabulary/#dfn-page
	ObjectPlace                 = "Place"                 // ActivityStreamsPlace https://www.w3.org/TR/activitystreams-vocabulary/#dfn-place
	ObjectProfile               = "Profile"               // ActivityStreamsProfile https://www.w3.org/TR/activitystreams-vocabulary/#dfn-profile
	ObjectRelationship          = "Relationship"          // ActivityStreamsRelationship https://www.w3.org/TR/activitystreams-vocabulary/#dfn-relationship
	ObjectTombstone             = "Tombstone"             // ActivityStreamsTombstone https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tombstone
	ObjectVideo                 = "Video"                 // ActivityStreamsVideo https://www.w3.org/TR/activitystreams-vocabulary/#dfn-video
	ObjectCollection            = "Collection"            // ActivityStreamsCollection https://www.w3.org/TR/activitystreams-vocabulary/#dfn-collection
	ObjectCollectionPage        = "CollectionPage"        // ActivityStreamsCollectionPage https://www.w3.org/TR/activitystreams-vocabulary/#dfn-collectionpage
	ObjectOrderedCollection     = "OrderedCollection"     // ActivityStreamsOrderedCollection https://www.w3.org/TR/activitystreams-vocabulary/#dfn-orderedcollection
	ObjectOrderedCollectionPage = "OrderedCollectionPage" // ActivityStreamsOrderedCollectionPage https://www.w3.org/TR/activitystreams-vocabulary/#dfn-orderedcollectionPage

	// Hashtag is not in the AS spec per se, but it tends to get used
	// as though 'Hashtag' is a named type under the Tag property.
	//
	// See https://www.w3.org/TR/activitystreams-vocabulary/#microsyntaxes
	// and https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tag
	TagHashtag = "Hashtag"
)

https://www.w3.org/TR/activitystreams-vocabulary

Variables

This section is empty.

Functions

func AppendActorIRIs added in v0.13.0

func AppendActorIRIs(with WithActor, actor ...*url.URL)

AppendActorIRIs appends the given IRIs to the Actor property of 'with'.

func AppendAttributedTo added in v0.13.0

func AppendAttributedTo(with WithAttributedTo, attribTo ...*url.URL)

AppendAttributedTo appends the given IRIs to the AttributedTo property of 'with'.

func AppendBcc added in v0.13.0

func AppendBcc(with WithBcc, bcc ...*url.URL)

AppendBcc appends the given IRIs to the Bcc property of 'with'.

func AppendCc added in v0.13.0

func AppendCc(with WithCc, cc ...*url.URL)

AppendCc appends the given IRIs to the Cc property of 'with'.

func AppendClosed added in v0.13.0

func AppendClosed(with WithClosed, closed ...time.Time)

AppendClosed appends the given times to the Closed property of 'with'.

func AppendInReplyTo added in v0.13.0

func AppendInReplyTo(with WithInReplyTo, replyTo ...*url.URL)

AppendInReplyTo appends the given IRIs to the InReplyTo property of 'with'.

func AppendObjectIRIs added in v0.13.0

func AppendObjectIRIs(with WithObject)

AppendObjectIRIs appends the given IRIs to the Object property of 'with'.

func AppendTo added in v0.13.0

func AppendTo(with WithTo, to ...*url.URL)

AppendTo appends the given IRIs to the To property of 'with'.

func AppendURL added in v0.13.0

func AppendURL(with WithURL, url ...*url.URL)

AppendURL appends the given URLs to the URL property of 'with'.

func ExtractAccountables added in v0.13.0

func ExtractAccountables(arr []TypeOrIRI) ([]Accountable, []TypeOrIRI)

ExtractAccountables extracts Accountable objects from a slice TypeOrIRI, returning extracted and remaining TypeOrIRIs.

func ExtractActorURI added in v0.10.0

func ExtractActorURI(withActor WithActor) (*url.URL, error)

ExtractActorURI extracts the first Actor URI it can find from a WithActor interface.

func ExtractAttachment

func ExtractAttachment(i Attachmentable) (*gtsmodel.MediaAttachment, error)

ExtractAttachment extracts a minimal gtsmodel.Attachment (just remote URL, description, and blurhash) from the given Attachmentable interface, or an error if no remote URL is set.

func ExtractAttachments

func ExtractAttachments(i WithAttachment) ([]*gtsmodel.MediaAttachment, error)

ExtractAttachments attempts to extract barebones MediaAttachment objects from given AS interface type.

func ExtractAttributedToURI added in v0.10.0

func ExtractAttributedToURI(i WithAttributedTo) (*url.URL, error)

ExtractAttributedToURI returns the first URI it can find in the given WithAttributedTo, or an error if no URI can be found.

func ExtractBlurhash added in v0.2.0

func ExtractBlurhash(i WithBlurhash) string

ExtractBlurhash extracts the blurhash string value from the given WithBlurhash interface, or returns an empty string if nothing is found.

func ExtractCcURIs added in v0.10.0

func ExtractCcURIs(i WithCc) []*url.URL

ExtractCcURIs returns a slice of URIs that the given WithCC addresses as Cc.

func ExtractContent

func ExtractContent(i WithContent) gtsmodel.Content

ExtractContent returns an intermediary representation of the given interface's Content and/or ContentMap property.

func ExtractDescription added in v0.13.0

func ExtractDescription(i Attachmentable) string

ExtractDescription extracts the image description of an attachmentable, if present. Will try the 'summary' prop first, then fall back to 'name'.

func ExtractDiscoverable

func ExtractDiscoverable(i WithDiscoverable) (bool, error)

ExtractDiscoverable extracts the Discoverable boolean of the given WithDiscoverable interface. Will return an error if Discoverable was nil.

func ExtractEmoji

func ExtractEmoji(i Emojiable) (*gtsmodel.Emoji, error)

ExtractEmoji extracts a minimal gtsmodel.Emoji from the given Emojiable.

func ExtractEmojis

func ExtractEmojis(i WithTag) ([]*gtsmodel.Emoji, error)

ExtractEmojis extracts a slice of minimal gtsmodel.Emojis from a WithTag. If an entry in the WithTag is not an emoji, it will be quietly ignored.

func ExtractFields added in v0.9.0

func ExtractFields(i WithAttachment) []*gtsmodel.Field

ExtractFields extracts property/value fields from the given WithAttachment interface. Will return an empty slice if no property/value fields can be found. Attachments that are not (well-formed) PropertyValues will be ignored.

func ExtractHashtags

func ExtractHashtags(i WithTag) ([]*gtsmodel.Tag, error)

ExtractHashtags extracts a slice of minimal gtsmodel.Tags from a WithTag. If an entry in the WithTag is not a hashtag, or has a name that cannot be normalized, it will be ignored.

TODO: find a better heuristic for determining if something is a hashtag or not, since looking for type name "Hashtag" is non-normative. Perhaps look for things that are either type "Hashtag" or have no type name set at all?

func ExtractIconURI added in v0.10.0

func ExtractIconURI(i WithIcon) (*url.URL, error)

ExtractIconURI extracts the first URI it can find from the given WithIcon which links to a supported image file. Input will look something like this:

"icon": {
  "mediaType": "image/jpeg",
  "type": "Image",
  "url": "http://example.org/path/to/some/file.jpeg"
},

If no valid URI can be found, this will return an error.

func ExtractImageURI added in v0.10.0

func ExtractImageURI(i WithImage) (*url.URL, error)

ExtractImageURI extracts the first URI it can find from the given WithImage which links to a supported image file. Input will look something like this:

"image": {
  "mediaType": "image/jpeg",
  "type": "Image",
  "url": "http://example.org/path/to/some/file.jpeg"
},

If no valid URI can be found, this will return an error.

func ExtractInReplyToURI

func ExtractInReplyToURI(i WithInReplyTo) *url.URL

ExtractInReplyToURI extracts the first inReplyTo URI property it can find from an interface. Will return nil if no valid URI can be found.

func ExtractItemsURIs added in v0.10.0

func ExtractItemsURIs(i WithItems) []*url.URL

ExtractItemsURIs extracts each URI it can find for an item from the provided WithItems.

func ExtractMention

func ExtractMention(i Mentionable) (*gtsmodel.Mention, error)

ExtractMention extracts a minimal gtsmodel.Mention from a Mentionable.

func ExtractMentions

func ExtractMentions(i WithTag) ([]*gtsmodel.Mention, error)

ExtractMentions extracts a slice of minimal gtsmodel.Mentions from a WithTag. If an entry in the WithTag is not a mention, it will be quietly ignored.

func ExtractName

func ExtractName(i WithName) string

ExtractName returns the first string representation it can find of an interface's name property, or an empty string if this is not found.

func ExtractObjectURI added in v0.10.0

func ExtractObjectURI(withObject WithObject) (*url.URL, error)

ExtractObjectURI extracts the first Object URI it can find from a WithObject interface.

func ExtractObjectURIs added in v0.10.0

func ExtractObjectURIs(withObject WithObject) ([]*url.URL, error)

ExtractObjectURIs extracts the URLs of each Object it can find from a WithObject interface.

func ExtractPoll added in v0.13.0

func ExtractPoll(poll Pollable) (*gtsmodel.Poll, error)

ExtractPoll extracts a placeholder Poll from Pollable interface, with available options and flags populated.

func ExtractPollOptionables added in v0.13.0

func ExtractPollOptionables(arr []TypeOrIRI) ([]PollOptionable, []TypeOrIRI)

ExtractPollOptionables extracts PollOptionable objects from a slice TypeOrIRI, returning extracted and remaining TypeOrIRIs.

func ExtractPreferredUsername

func ExtractPreferredUsername(i WithPreferredUsername) (string, error)

ExtractPreferredUsername returns a string representation of an interface's preferredUsername property. Will return an error if preferredUsername is nil, not a string, or empty.

func ExtractPublicKey added in v0.10.0

func ExtractPublicKey(i WithPublicKey) (
	*rsa.PublicKey,
	*url.URL,
	*url.URL,
	error,
)

ExtractPublicKey extracts the public key, public key ID, and public key owner ID from an interface, or an error if something goes wrong.

func ExtractSensitive

func ExtractSensitive(withSensitive WithSensitive) bool

ExtractSensitive extracts whether or not an item should be marked as sensitive according to its ActivityStreams sensitive property.

If no sensitive property is set on the item at all, or if this property isn't a boolean, then false will be returned by default.

func ExtractSharedInbox added in v0.5.0

func ExtractSharedInbox(withEndpoints WithEndpoints) *url.URL

ExtractSharedInbox extracts the sharedInbox URI property from an Actor. Returns nil if this property is not set.

func ExtractStatusables added in v0.13.0

func ExtractStatusables(arr []TypeOrIRI) ([]Statusable, []TypeOrIRI)

ExtractStatusables extracts Statusable objects from a slice TypeOrIRI, returning extracted and remaining TypeOrIRIs.

func ExtractSummary

func ExtractSummary(i WithSummary) string

ExtractSummary extracts the summary/content warning of the given WithSummary interface. Will return an empty string if no summary/content warning was present.

func ExtractToURIs added in v0.10.0

func ExtractToURIs(i WithTo) []*url.URL

ExtractToURIs returns a slice of URIs that the given WithTo addresses as To.

func ExtractURL

func ExtractURL(i WithURL) (*url.URL, error)

ExtractURL extracts the first URI it can find from the given WithURL interface, or an error if no URL was set. The ID of a type will not work, this function wants a URI specifically.

func ExtractVisibility

func ExtractVisibility(addressable Addressable, actorFollowersURI string) (gtsmodel.Visibility, error)

ExtractVisibility extracts the gtsmodel.Visibility of a given addressable with a To and CC property.

ActorFollowersURI is needed to check whether the visibility is FollowersOnly or not. The passed-in value should just be the string value representation of the followers URI of the actor who created the activity, eg., `https://example.org/users/whoever/followers`.

func GetActorIRIs added in v0.13.0

func GetActorIRIs(with WithActor) []*url.URL

GetActorIRIs returns the IRIs contained in the Actor property of 'with'.

func GetAttributedTo added in v0.13.0

func GetAttributedTo(with WithAttributedTo) []*url.URL

GetAttributedTo returns the IRIs contained in the AttributedTo property of 'with'.

func GetBcc added in v0.13.0

func GetBcc(with WithBcc) []*url.URL

GetBcc returns the IRIs contained in the Bcc property of 'with'. Panics on entries with missing ID.

func GetCc added in v0.13.0

func GetCc(with WithCc) []*url.URL

GetCc returns the IRIs contained in the Cc property of 'with'. Panics on entries with missing ID.

func GetClosed added in v0.13.0

func GetClosed(with WithClosed) []time.Time

GetEndTime returns the times contained in the Closed property of 'with'.

func GetDiscoverable added in v0.13.0

func GetDiscoverable(with WithDiscoverable) bool

GetDiscoverable returns the boolean contained in the Discoverable property of 'with'.

func GetEndTime added in v0.13.0

func GetEndTime(with WithEndTime) time.Time

GetEndTime returns the time contained in the EndTime property of 'with'.

func GetFeatured added in v0.13.0

func GetFeatured(with WithFeatured) *url.URL

GetFeatured returns the IRI contained in the Featured property of 'with'.

func GetFollowers added in v0.13.0

func GetFollowers(with WithFollowers) *url.URL

GetFollowers returns the IRI contained in the Followers property of 'with'.

func GetFollowing added in v0.13.0

func GetFollowing(with WithFollowing) *url.URL

GetFollowers returns the IRI contained in the Following property of 'with'.

func GetInReplyTo added in v0.13.0

func GetInReplyTo(with WithInReplyTo) []*url.URL

GetInReplyTo returns the IRIs contained in the InReplyTo property of 'with'.

func GetInbox added in v0.13.0

func GetInbox(with WithInbox) *url.URL

GetInbox returns the IRI contained in the Inbox property of 'with'.

func GetJSONLDId added in v0.13.0

func GetJSONLDId(with WithJSONLDId) *url.URL

GetJSONLDId returns the ID of 'with', or nil.

func GetObjectIRIs added in v0.13.0

func GetObjectIRIs(with WithObject) []*url.URL

GetObjectIRIs returns the IRIs contained in the Object property of 'with'.

func GetOutbox added in v0.13.0

func GetOutbox(with WithOutbox) *url.URL

GetOutbox returns the IRI contained in the Outbox property of 'with'.

func GetPublished added in v0.13.0

func GetPublished(with WithPublished) time.Time

GetPublished returns the time contained in the Published property of 'with'.

func GetTo added in v0.13.0

func GetTo(with WithTo) []*url.URL

GetTo returns the IRIs contained in the To property of 'with'. Panics on entries with missing ID.

func GetURL added in v0.13.0

func GetURL(with WithURL) []*url.URL

GetURL returns the IRIs contained in the URL property of 'with'.

func GetVotersCount added in v0.13.0

func GetVotersCount(with WithVotersCount) int

GetVotersCount returns the integer contained in the VotersCount property of 'with', if found.

func IsAccountable added in v0.12.0

func IsAccountable(typeName string) bool

IsAccountable returns whether AS vocab type name is acceptable as Accountable.

func IsActivityable added in v0.13.0

func IsActivityable(typeName string) bool

IsActivityable returns whether AS vocab type name is acceptable as Activityable.

func IsPollOptionable added in v0.13.0

func IsPollOptionable(typeName string) bool

IsPollOptionable returns whether AS vocab type name is acceptable as PollOptionable.

func IsPollable added in v0.12.0

func IsPollable(typeName string) bool

IsPollable returns whether AS vocab type name is acceptable as Pollable.

func IsStatusable added in v0.12.0

func IsStatusable(typeName string) bool

IsStatusable returns whether AS vocab type name is acceptable as Statusable.

func IterateAnyOf added in v0.12.0

func IterateAnyOf(withAnyOf WithAnyOf, foreach func(vocab.ActivityStreamsAnyOfPropertyIterator))

IterateAnyOf will attempt to extract anyOf property from given interface, and passes each iterated item to function.

func IterateOneOf added in v0.12.0

func IterateOneOf(withOneOf WithOneOf, foreach func(vocab.ActivityStreamsOneOfPropertyIterator))

IterateOneOf will attempt to extract oneOf property from given interface, and passes each iterated item to function.

func MustSet added in v0.13.0

func MustSet[W, T any](fn func(W, T) error, with W, value T)

MustSet performs the given 'Set$Property(with, T) error' signature function, panicking on error.

func NewASCollection added in v0.12.0

func NewASCollection(params CollectionParams) vocab.ActivityStreamsCollection

NewASCollection builds and returns a new ActivityStreams Collection from given parameters.

func NewASCollectionPage added in v0.12.0

func NewASCollectionPage(params CollectionPageParams) vocab.ActivityStreamsCollectionPage

NewASCollectionPage builds and returns a new ActivityStreams CollectionPage from given parameters (including item property appending function).

func NewASOrderedCollection added in v0.12.0

func NewASOrderedCollection(params CollectionParams) vocab.ActivityStreamsOrderedCollection

NewASOrderedCollection builds and returns a new ActivityStreams OrderedCollection from given parameters.

func NewASOrderedCollectionPage added in v0.12.0

func NewASOrderedCollectionPage(params CollectionPageParams) vocab.ActivityStreamsOrderedCollectionPage

NewASOrderedCollectionPage builds and returns a new ActivityStreams OrderedCollectionPage from given parameters (including item property appending function).

func NormalizeIncomingActivity added in v0.12.0

func NormalizeIncomingActivity(activity pub.Activity, rawJSON map[string]interface{})

NormalizeIncomingActivityObject normalizes the 'object'.'content' field of the given Activity.

The rawActivity map should the freshly deserialized json representation of the Activity.

This function is a noop if the type passed in is anything except a Create or Update with a Statusable or Accountable as its Object.

func NormalizeIncomingAttachments added in v0.9.0

func NormalizeIncomingAttachments(item WithAttachment, rawJSON map[string]interface{})

NormalizeIncomingAttachments normalizes all attachments (if any) of the given item, replacing the 'name' (aka content warning) field of each attachment with the raw 'name' value from the raw json object map, and doing sanitization on the result.

noop if there are no attachments; noop if attachment is not a format we can understand.

func NormalizeIncomingContent added in v0.9.0

func NormalizeIncomingContent(item WithContent, rawJSON map[string]interface{})

NormalizeIncomingContent replaces the Content property of the given item with the normalized versions of the raw 'content' and 'contentMap' values from the raw json object map.

noop if there was no 'content' or 'contentMap' in the json object map.

func NormalizeIncomingName added in v0.9.0

func NormalizeIncomingName(item WithName, rawJSON map[string]interface{})

NormalizeIncomingName replaces the Name of the given item with the raw 'name' value from the raw json object map.

noop if there was no name in the json object map or the name was not a plain string.

func NormalizeIncomingPollOptions added in v0.12.0

func NormalizeIncomingPollOptions(item WithOneOf, rawJSON map[string]interface{})

NormalizeIncomingOneOf normalizes all oneOf (if any) of the given item, replacing the 'name' field of each oneOf with the raw 'name' value from the raw json object map, and doing sanitization on the result.

noop if there are no oneOf; noop if oneOf is not expected format.

func NormalizeIncomingSummary added in v0.9.0

func NormalizeIncomingSummary(item WithSummary, rawJSON map[string]interface{})

NormalizeIncomingSummary replaces the Summary of the given item with the sanitized version of the raw 'summary' value from the raw json object map.

noop if there was no summary in the json object map or the summary was not a plain string.

func NormalizeOutgoingAttachmentProp added in v0.13.0

func NormalizeOutgoingAttachmentProp(item WithAttachment, rawJSON map[string]interface{})

NormalizeOutgoingAttachmentProp replaces single-entry Attachment objects with single-entry arrays, for better compatibility with other AP implementations.

Ie:

"attachment": {
  ...
}

becomes:

"attachment": [
  {
    ...
  }
]

Noop for items with no attachments, or with attachments that are already a slice.

func NormalizeOutgoingContentProp added in v0.13.0

func NormalizeOutgoingContentProp(item WithContent, rawJSON map[string]interface{})

NormalizeOutgoingContentProp normalizes go-fed's funky formatting of content and contentMap properties to a format better understood by other AP implementations.

Ie., incoming "content" property like this:

"content": [
  "hello world!",
  {
    "en": "hello world!"
  }
]

Is unpacked to:

"content": "hello world!",
"contentMap": {
  "en": "hello world!"
}

Noop if neither content nor contentMap are set.

func NormalizeOutgoingObjectProp added in v0.13.0

func NormalizeOutgoingObjectProp(item WithObject, rawJSON map[string]interface{}) error

NormalizeOutgoingObjectProp normalizes each Object entry in the rawJSON of the given item by calling custom serialization / normalization functions on them in turn.

This function also unnests single-entry arrays, so that:

"object": [
  {
    ...
  }
]

Becomes:

"object": {
  ...
}

Noop for each Object entry that isn't an Accountable or Statusable.

func ResolveIncomingActivity added in v0.12.0

func ResolveIncomingActivity(r *http.Request) (pub.Activity, bool, gtserror.WithCode)

ResolveActivity is a util function for pulling a pub.Activity type out of an incoming request body, returning the resolved activity type, error and whether to accept activity (false = transient i.e. ignore).

func Serialize added in v0.9.0

func Serialize(t vocab.Type) (m map[string]interface{}, e error)

Serialize is a custom serializer for ActivityStreams types.

In most cases, it will simply call the go-fed streams.Serialize function under the hood. However, if custom serialization is required on a specific type (eg for inter-implementation compatibility), it can be inserted into the switch as necessary.

Callers should always call this function instead of streams.Serialize, unless there's a very good reason to do otherwise.

Currently, the following things will be custom serialized:

  • OrderedCollection: 'orderedItems' property will always be made into an array.
  • OrderedCollectionPage: 'orderedItems' property will always be made into an array.
  • Any Accountable type: 'attachment' property will always be made into an array.
  • Any Statusable type: 'attachment' property will always be made into an array; 'content' and 'contentMap' will be normalized.
  • Any Activityable type: any 'object's set on an activity will be custom serialized as above.

func SetDiscoverable added in v0.13.0

func SetDiscoverable(with WithDiscoverable, discoverable bool)

SetDiscoverable sets the given boolean on the Discoverable property of 'with'.

func SetEndTime added in v0.13.0

func SetEndTime(with WithEndTime, end time.Time)

SetEndTime sets the given time on the EndTime property of 'with'.

func SetFeatured added in v0.13.0

func SetFeatured(with WithFeatured, featured *url.URL)

SetFeatured sets the given IRI on the Featured property of 'with'.

func SetFollowers added in v0.13.0

func SetFollowers(with WithFollowers, followers *url.URL)

SetFollowers sets the given IRI on the Followers property of 'with'.

func SetFollowing added in v0.13.0

func SetFollowing(with WithFollowing, following *url.URL)

SetFollowers sets the given IRI on the Following property of 'with'.

func SetInbox added in v0.13.0

func SetInbox(with WithInbox, inbox *url.URL)

SetInbox sets the given IRI on the Inbox property of 'with'.

func SetJSONLDId added in v0.13.0

func SetJSONLDId(with WithJSONLDId, id *url.URL)

SetJSONLDId sets the given URL to the JSONLD ID of 'with'.

func SetJSONLDIdStr added in v0.13.0

func SetJSONLDIdStr(with WithJSONLDId, id string) error

SetJSONLDIdStr sets the given string to the JSONLDID of 'with'. Returns error

func SetOutbox added in v0.13.0

func SetOutbox(with WithOutbox, outbox *url.URL)

SetOutbox sets the given IRI on the Outbox property of 'with'.

func SetPublished added in v0.13.0

func SetPublished(with WithPublished, published time.Time)

SetPublished sets the given time on the Published property of 'with'.

func SetVotersCount added in v0.13.0

func SetVotersCount(with WithVotersCount, count int)

SetVotersCount sets the given count on the VotersCount property of 'with'.

Types

type Accountable

Accountable represents the minimum activitypub interface for representing an 'account'. (see: IsAccountable() for types implementing this, though you MUST make sure to check the typeName as this bare interface may be implementable by non-Accountable types).

func ResolveAccountable added in v0.8.0

func ResolveAccountable(ctx context.Context, b []byte) (Accountable, error)

ResolveStatusable tries to resolve the given bytes into an ActivityPub Accountable representation. It will then perform normalization on the Accountable.

Works for: Application, Group, Organization, Person, Service

func ToAccountable added in v0.12.0

func ToAccountable(t vocab.Type) (Accountable, bool)

ToAccountable safely tries to cast vocab.Type as Accountable, also checking for expected AS type names.

type Activityable added in v0.13.0

type Activityable interface {
	// Activity is also a vocab.Type
	vocab.Type

	WithTo
	WithCc
	WithBcc
	WithAttributedTo
	WithActor
	WithObject
	WithPublished
}

Activityable represents the minimum activitypub interface for representing an 'activity'. (see: IsActivityable() for types implementing this, though you MUST make sure to check the typeName as this bare interface may be implementable by non-Activityable types).

func ToActivityable added in v0.13.0

func ToActivityable(t vocab.Type) (Activityable, bool)

ToActivityable safely tries to cast vocab.Type as Activityable, also checking for expected AS type names.

type Addressable

type Addressable interface {
	WithTo
	WithCc
}

Addressable represents the minimum interface for an addressed activity.

type Announceable

Announceable represents the minimum interface for an activitystreams 'announce' activity.

type Attachmentable

Attachmentable represents the minimum activitypub interface for representing a 'mediaAttachment'. (see: IsAttachmentable). This interface is fulfilled by: Audio, Document, Image, Video

type Blockable

type Blockable interface {
	WithJSONLDId
	WithTypeName

	WithActor
	WithObject
}

Blockable represents the minimum interface for an activitystreams 'block' activity.

type CollectionBuilder added in v0.12.0

type CollectionBuilder interface {
	SetJSONLDId(vocab.JSONLDIdProperty)
	SetActivityStreamsFirst(vocab.ActivityStreamsFirstProperty)
	SetActivityStreamsTotalItems(i vocab.ActivityStreamsTotalItemsProperty)
}

CollectionPage is a simplified interface type that can be fulfilled by either of (where required): vocab.ActivityStreamsCollection vocab.ActivityStreamsOrderedCollection

type CollectionPageBuilder added in v0.12.0

type CollectionPageBuilder interface {
	SetJSONLDId(vocab.JSONLDIdProperty)
	SetActivityStreamsPartOf(vocab.ActivityStreamsPartOfProperty)
	SetActivityStreamsNext(vocab.ActivityStreamsNextProperty)
	SetActivityStreamsPrev(vocab.ActivityStreamsPrevProperty)
	SetActivityStreamsTotalItems(i vocab.ActivityStreamsTotalItemsProperty)
}

CollectionPageBuilder is a simplified interface type that can be fulfilled by either of (where required): vocab.ActivityStreamsCollectionPage vocab.ActivityStreamsOrderedCollectionPage

type CollectionPageIterator added in v0.12.0

type CollectionPageIterator interface {
	vocab.Type

	NextPage() WithIRI
	PrevPage() WithIRI

	NextItem() TypeOrIRI
	PrevItem() TypeOrIRI
}

CollectionPageIterator represents the minimum interface for interacting with a wrapped CollectionPage or OrderedCollectionPage in order to access both next / prev pages and items.

func ToCollectionPageIterator added in v0.12.0

func ToCollectionPageIterator(t vocab.Type) (CollectionPageIterator, error)

ToCollectionPageIterator attempts to resolve the given vocab type as a CollectionPage like object and wrap in a standardised interface in order to iterate its contents.

func WrapCollectionPage added in v0.12.0

WrapCollectionPage wraps an ActivityStreamsCollectionPage in a standardised collection page interface.

func WrapOrderedCollectionPage added in v0.12.0

WrapOrderedCollectionPage wraps an ActivityStreamsOrderedCollectionPage in a standardised collection page interface.

type CollectionPageParams added in v0.12.0

type CollectionPageParams struct {
	// containing collection.
	CollectionParams

	// Paging details.
	Current *paging.Page
	Next    *paging.Page
	Prev    *paging.Page
	Query   url.Values

	// Item appender for each item at index.
	Append func(int, ItemsPropertyBuilder)
	Count  int
}

type CollectionParams added in v0.12.0

type CollectionParams struct {
	// Containing collection
	// ID (i.e. NOT the page).
	ID *url.URL

	// First page details.
	First paging.Page
	Query url.Values

	// Total no. items.
	Total int
}

type Emojiable

type Emojiable interface {
	WithJSONLDId
	WithTypeName
	WithName
	WithUpdated
	WithIcon
}

Emojiable represents the minimum interface for an 'emoji' tag.

type Flaggable added in v0.7.0

Flaggable represents the minimum interface for an activitystreams 'Flag' activity.

type Followable

type Followable interface {
	WithJSONLDId
	WithTypeName

	WithActor
	WithObject
}

Followable represents the minimum interface for an activitystreams 'follow' activity.

type Hashtaggable

type Hashtaggable interface {
	WithTypeName
	WithHref
	WithName
}

Hashtaggable represents the minimum activitypub interface for representing a 'hashtag' tag.

type ItemsPropertyBuilder added in v0.12.0

type ItemsPropertyBuilder interface {
	AppendIRI(*url.URL)
}

ItemsPropertyBuilder is a simplified interface type that can be fulfilled by either of (where required): vocab.ActivityStreamsItemsProperty vocab.ActivityStreamsOrderedItemsProperty

type Likeable

type Likeable interface {
	WithJSONLDId
	WithTypeName

	WithActor
	WithObject
}

Likeable represents the minimum interface for an activitystreams 'like' activity.

type Mentionable

type Mentionable interface {
	WithName
	WithHref
}

Mentionable represents the minimum interface for a 'mention' tag.

type PollOptionable added in v0.12.0

type PollOptionable interface {
	vocab.Type

	WithName
	WithTo
	WithInReplyTo
	WithReplies
	WithAttributedTo
}

PollOptionable represents the minimum activitypub interface for representing a poll 'vote'. (see: IsPollOptionable() for types implementing this, though you MUST make sure to check the typeName as this bare interface may be implementable by non-Pollable types).

func ToPollOptionable added in v0.13.0

func ToPollOptionable(t vocab.Type) (PollOptionable, bool)

ToPollOptionable safely tries to cast vocab.Type as PollOptionable, also checking for expected AS type names.

type Pollable added in v0.12.0

type Pollable interface {
	WithOneOf
	WithAnyOf
	WithEndTime
	WithClosed
	WithVotersCount

	// base-interfaces
	Statusable
}

Pollable represents the minimum activitypub interface for representing a 'poll' (it's a subset of a status). (see: IsPollable() for types implementing this, though you MUST make sure to check the typeName as this bare interface may be implementable by non-Pollable types).

func ToPollable added in v0.12.0

func ToPollable(t vocab.Type) (Pollable, bool)

ToPollable safely tries to cast vocab.Type as Pollable, also checking for expected AS type names.

type Property added in v0.13.0

type Property[T TypeOrIRI] interface {
	Len() int
	At(int) T

	AppendIRI(*url.URL)
	SetIRI(int, *url.URL)
}

Property represents the minimum interface for an ActivityStreams property with IRIs.

type ReplyToable added in v0.3.4

type ReplyToable interface {
	WithInReplyTo
}

ReplyToable represents the minimum interface for an Activity that can be InReplyTo another activity.

type Statusable

Statusable represents the minimum activitypub interface for representing a 'status'. (see: IsStatusable() for types implementing this, though you MUST make sure to check the typeName as this bare interface may be implementable by non-Statusable types).

func ResolveStatusable added in v0.8.0

func ResolveStatusable(ctx context.Context, b []byte) (Statusable, error)

ResolveStatusable tries to resolve the given bytes into an ActivityPub Statusable representation. It will then perform normalization on the Statusable.

Works for: Article, Document, Image, Video, Note, Page, Event, Place, Profile, Question.

func ToStatusable added in v0.12.0

func ToStatusable(t vocab.Type) (Statusable, bool)

ToStatusable safely tries to cast vocab.Type as Statusable, also checking for expected AS type names.

type TypeOrIRI added in v0.12.0

type TypeOrIRI interface {
	WithIRI
	WithType
}

TypeOrIRI represents the minimum interface for something that may be a vocab.Type OR IRI.

func ExtractActivityData added in v0.12.0

func ExtractActivityData(activity pub.Activity, rawJSON map[string]any) ([]TypeOrIRI, []any, bool)

ExtractActivityData will extract the usable data type (e.g. Note, Question, etc) and corresponding JSON, from activity.

func ExtractObjects added in v0.7.0

func ExtractObjects(with WithObject) []TypeOrIRI

ExtractObjects will extract object vocab.Types from given implementing interface.

type WithActor

type WithActor interface {
	GetActivityStreamsActor() vocab.ActivityStreamsActorProperty
	SetActivityStreamsActor(vocab.ActivityStreamsActorProperty)
}

WithActor represents an activity with ActivityStreamsActorProperty

type WithAnyOf added in v0.12.0

type WithAnyOf interface {
	GetActivityStreamsAnyOf() vocab.ActivityStreamsAnyOfProperty
	SetActivityStreamsAnyOf(vocab.ActivityStreamsAnyOfProperty)
}

WithOneOf represents an activity with the oneOf property.

type WithAttachment

type WithAttachment interface {
	GetActivityStreamsAttachment() vocab.ActivityStreamsAttachmentProperty
	SetActivityStreamsAttachment(vocab.ActivityStreamsAttachmentProperty)
}

WithAttachment represents an activity with ActivityStreamsAttachmentProperty

type WithAttributedTo

type WithAttributedTo interface {
	GetActivityStreamsAttributedTo() vocab.ActivityStreamsAttributedToProperty
	SetActivityStreamsAttributedTo(vocab.ActivityStreamsAttributedToProperty)
}

WithAttributedTo represents an activity with ActivityStreamsAttributedToProperty

type WithBcc added in v0.13.0

type WithBcc interface {
	GetActivityStreamsBcc() vocab.ActivityStreamsBccProperty
	SetActivityStreamsBcc(vocab.ActivityStreamsBccProperty)
}

WithCC represents an activity with ActivityStreamsBccProperty

type WithBlurhash added in v0.2.0

type WithBlurhash interface {
	GetTootBlurhash() vocab.TootBlurhashProperty
	SetTootBlurhash(vocab.TootBlurhashProperty)
}

WithBlurhash represents an activity with TootBlurhashProperty

type WithCc added in v0.13.0

type WithCc interface {
	GetActivityStreamsCc() vocab.ActivityStreamsCcProperty
	SetActivityStreamsCc(vocab.ActivityStreamsCcProperty)
}

WithCC represents an activity with ActivityStreamsCcProperty

type WithClosed added in v0.12.0

type WithClosed interface {
	GetActivityStreamsClosed() vocab.ActivityStreamsClosedProperty
	SetActivityStreamsClosed(vocab.ActivityStreamsClosedProperty)
}

WithClosed represents an activity with the closed property.

type WithContent

type WithContent interface {
	GetActivityStreamsContent() vocab.ActivityStreamsContentProperty
	SetActivityStreamsContent(vocab.ActivityStreamsContentProperty)
}

WithContent represents an activity with ActivityStreamsContentProperty

type WithConversation

type WithConversation interface {
}

WithConversation ...

type WithDiscoverable

type WithDiscoverable interface {
	GetTootDiscoverable() vocab.TootDiscoverableProperty
	SetTootDiscoverable(vocab.TootDiscoverableProperty)
}

WithDiscoverable represents an activity with TootDiscoverableProperty

type WithEndTime added in v0.12.0

type WithEndTime interface {
	GetActivityStreamsEndTime() vocab.ActivityStreamsEndTimeProperty
	SetActivityStreamsEndTime(vocab.ActivityStreamsEndTimeProperty)
}

WithEndTime represents an activity with the endTime property.

type WithEndpoints added in v0.5.0

type WithEndpoints interface {
	GetActivityStreamsEndpoints() vocab.ActivityStreamsEndpointsProperty
	SetActivityStreamsEndpoints(vocab.ActivityStreamsEndpointsProperty)
}

WithEndpoints represents a Person or profile with the endpoints property

type WithFeatured

type WithFeatured interface {
	GetTootFeatured() vocab.TootFeaturedProperty
	SetTootFeatured(vocab.TootFeaturedProperty)
}

WithFeatured represents an activity with TootFeaturedProperty

type WithFollowers

type WithFollowers interface {
	GetActivityStreamsFollowers() vocab.ActivityStreamsFollowersProperty
	SetActivityStreamsFollowers(vocab.ActivityStreamsFollowersProperty)
}

WithFollowers represents an activity with ActivityStreamsFollowersProperty

type WithFollowing

type WithFollowing interface {
	GetActivityStreamsFollowing() vocab.ActivityStreamsFollowingProperty
	SetActivityStreamsFollowing(vocab.ActivityStreamsFollowingProperty)
}

WithFollowing represents an activity with ActivityStreamsFollowingProperty

type WithHref

type WithHref interface {
	GetActivityStreamsHref() vocab.ActivityStreamsHrefProperty
	SetActivityStreamsHref(vocab.ActivityStreamsHrefProperty)
}

WithHref represents an activity with ActivityStreamsHrefProperty

type WithIRI added in v0.12.0

type WithIRI interface {
	GetIRI() *url.URL
	IsIRI() bool
	SetIRI(*url.URL)
}

WithIRI represents an object (possibly) representable as an IRI.

type WithIcon

type WithIcon interface {
	GetActivityStreamsIcon() vocab.ActivityStreamsIconProperty
	SetActivityStreamsIcon(vocab.ActivityStreamsIconProperty)
}

WithIcon represents an activity with ActivityStreamsIconProperty

type WithImage

type WithImage interface {
	GetActivityStreamsImage() vocab.ActivityStreamsImageProperty
}

WithImage represents an activity with ActivityStreamsImageProperty

type WithInReplyTo

type WithInReplyTo interface {
	GetActivityStreamsInReplyTo() vocab.ActivityStreamsInReplyToProperty
	SetActivityStreamsInReplyTo(vocab.ActivityStreamsInReplyToProperty)
}

WithInReplyTo represents an activity with ActivityStreamsInReplyToProperty

type WithInbox

type WithInbox interface {
	GetActivityStreamsInbox() vocab.ActivityStreamsInboxProperty
	SetActivityStreamsInbox(vocab.ActivityStreamsInboxProperty)
}

WithInbox represents an activity with ActivityStreamsInboxProperty

type WithItems

type WithItems interface {
	GetActivityStreamsItems() vocab.ActivityStreamsItemsProperty
	SetActivityStreamsItems(vocab.ActivityStreamsItemsProperty)
}

WithItems represents an activity with ActivityStreamsItemsProperty

type WithJSONLDId

type WithJSONLDId interface {
	GetJSONLDId() vocab.JSONLDIdProperty
	SetJSONLDId(vocab.JSONLDIdProperty)
}

WithJSONLDId represents an activity with JSONLDIdProperty.

type WithManuallyApprovesFollowers

type WithManuallyApprovesFollowers interface {
	GetActivityStreamsManuallyApprovesFollowers() vocab.ActivityStreamsManuallyApprovesFollowersProperty
	SetActivityStreamsManuallyApprovesFollowers(vocab.ActivityStreamsManuallyApprovesFollowersProperty)
}

WithManuallyApprovesFollowers represents a Person or profile with the ManuallyApprovesFollowers property.

type WithMediaType

type WithMediaType interface {
	GetActivityStreamsMediaType() vocab.ActivityStreamsMediaTypeProperty
	SetActivityStreamsMediaType(vocab.ActivityStreamsMediaTypeProperty)
}

WithMediaType represents an activity with ActivityStreamsMediaTypeProperty

type WithName

type WithName interface {
	GetActivityStreamsName() vocab.ActivityStreamsNameProperty
	SetActivityStreamsName(vocab.ActivityStreamsNameProperty)
}

WithName represents an activity with ActivityStreamsNameProperty

type WithNext

type WithNext interface {
	GetActivityStreamsNext() vocab.ActivityStreamsNextProperty
	SetActivityStreamsNext(vocab.ActivityStreamsNextProperty)
}

WithNext represents an activity with ActivityStreamsNextProperty

type WithObject

type WithObject interface {
	GetActivityStreamsObject() vocab.ActivityStreamsObjectProperty
	SetActivityStreamsObject(vocab.ActivityStreamsObjectProperty)
}

WithObject represents an activity with ActivityStreamsObjectProperty

type WithOneOf added in v0.12.0

type WithOneOf interface {
	GetActivityStreamsOneOf() vocab.ActivityStreamsOneOfProperty
	SetActivityStreamsOneOf(vocab.ActivityStreamsOneOfProperty)
}

WithOneOf represents an activity with the oneOf property.

type WithOutbox

type WithOutbox interface {
	GetActivityStreamsOutbox() vocab.ActivityStreamsOutboxProperty
	SetActivityStreamsOutbox(vocab.ActivityStreamsOutboxProperty)
}

WithOutbox represents an activity with ActivityStreamsOutboxProperty

type WithPartOf

type WithPartOf interface {
	GetActivityStreamsPartOf() vocab.ActivityStreamsPartOfProperty
	SetActivityStreamsPartOf(vocab.ActivityStreamsPartOfProperty)
}

WithPartOf represents an activity with ActivityStreamsPartOfProperty

type WithPreferredUsername

type WithPreferredUsername interface {
	GetActivityStreamsPreferredUsername() vocab.ActivityStreamsPreferredUsernameProperty
	SetActivityStreamsPreferredUsername(vocab.ActivityStreamsPreferredUsernameProperty)
}

WithPreferredUsername represents an activity with ActivityStreamsPreferredUsernameProperty

type WithPublicKey

type WithPublicKey interface {
	GetW3IDSecurityV1PublicKey() vocab.W3IDSecurityV1PublicKeyProperty
	SetW3IDSecurityV1PublicKey(vocab.W3IDSecurityV1PublicKeyProperty)
}

WithPublicKey represents an activity with W3IDSecurityV1PublicKeyProperty

type WithPublished

type WithPublished interface {
	GetActivityStreamsPublished() vocab.ActivityStreamsPublishedProperty
	SetActivityStreamsPublished(vocab.ActivityStreamsPublishedProperty)
}

WithPublished represents an activity with ActivityStreamsPublishedProperty

type WithReplies

type WithReplies interface {
	GetActivityStreamsReplies() vocab.ActivityStreamsRepliesProperty
	SetActivityStreamsReplies(vocab.ActivityStreamsRepliesProperty)
}

WithReplies represents an activity with ActivityStreamsRepliesProperty

type WithSensitive

type WithSensitive interface {
	GetActivityStreamsSensitive() vocab.ActivityStreamsSensitiveProperty
	SetActivityStreamsSensitive(vocab.ActivityStreamsSensitiveProperty)
}

WithSensitive represents an activity with ActivityStreamsSensitiveProperty

type WithSharedInbox added in v0.13.0

type WithSharedInbox interface {
	GetActivityStreamsSharedInbox() vocab.ActivityStreamsSharedInboxProperty
	SetActivityStreamsSharedInbox(vocab.ActivityStreamsSharedInboxProperty)
}

WithSharedInbox represents an activity with ActivityStreamsSharedInboxProperty

type WithSummary

type WithSummary interface {
	GetActivityStreamsSummary() vocab.ActivityStreamsSummaryProperty
	SetActivityStreamsSummary(vocab.ActivityStreamsSummaryProperty)
}

WithSummary represents an activity with ActivityStreamsSummaryProperty

type WithTag

type WithTag interface {
	GetActivityStreamsTag() vocab.ActivityStreamsTagProperty
	SetActivityStreamsTag(vocab.ActivityStreamsTagProperty)
}

WithTag represents an activity with ActivityStreamsTagProperty

type WithTo

type WithTo interface {
	GetActivityStreamsTo() vocab.ActivityStreamsToProperty
	SetActivityStreamsTo(vocab.ActivityStreamsToProperty)
}

WithTo represents an activity with ActivityStreamsToProperty

type WithType added in v0.12.0

type WithType interface {
	GetType() vocab.Type
}

WithType ...

type WithTypeName

type WithTypeName interface {
	GetTypeName() string
}

WithTypeName represents an activity with a type name

type WithURL

type WithURL interface {
	GetActivityStreamsUrl() vocab.ActivityStreamsUrlProperty
	SetActivityStreamsUrl(vocab.ActivityStreamsUrlProperty)
}

WithURL represents an activity with ActivityStreamsUrlProperty

type WithUpdated

type WithUpdated interface {
	GetActivityStreamsUpdated() vocab.ActivityStreamsUpdatedProperty
	SetActivityStreamsUpdated(vocab.ActivityStreamsUpdatedProperty)
}

WithUpdated represents an activity with ActivityStreamsUpdatedProperty

type WithVotersCount added in v0.12.0

type WithVotersCount interface {
	GetTootVotersCount() vocab.TootVotersCountProperty
	SetTootVotersCount(vocab.TootVotersCountProperty)
}

WithVotersCount represents an activity with the votersCount property.

Jump to

Keyboard shortcuts

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