Documentation ¶
Index ¶
- func AddImageAttachmentToNote(note vocab.ActivityStreamsNote, image, mediaType string)
- func CreateCreateActivity(id string, localAccountIRI *url.URL) vocab.ActivityStreamsCreate
- func GetFullUsernameFromExternalEntity(entity ExternalEntity) string
- func GetLogoType() string
- func MakeActivityDirect(activity vocab.ActivityStreamsCreate, toIRI *url.URL) vocab.ActivityStreamsCreate
- func MakeActivityPublic(activity vocab.ActivityStreamsCreate) vocab.ActivityStreamsCreate
- func MakeActorPropertyWithID(idIRI *url.URL) vocab.ActivityStreamsActorProperty
- func MakeCreateActivity(activityID *url.URL) vocab.ActivityStreamsCreate
- func MakeHashtag(name string) vocab.TootHashtag
- func MakeLocalIRIForAccount(account string) *url.URL
- func MakeLocalIRIForResource(resourcePath string) *url.URL
- func MakeLocalIRIForStreamURL() *url.URL
- func MakeLocalIRIforLogo() *url.URL
- func MakeNote(text string, noteIRI *url.URL, attributedToIRI *url.URL) vocab.ActivityStreamsNote
- func MakeNoteDirect(note vocab.ActivityStreamsNote, toIRI *url.URL) vocab.ActivityStreamsNote
- func MakeNotePublic(note vocab.ActivityStreamsNote) vocab.ActivityStreamsNote
- func MakeRemoteIRIForResource(resourcePath string, host string) (*url.URL, error)
- func MakeServiceForAccount(accountName string) vocab.ActivityStreamsService
- func MakeUpdateActivity(activityID *url.URL) vocab.ActivityStreamsUpdate
- func Serialize(obj vocab.Type) ([]byte, error)
- type ActivityPubActor
- type DeleteRequest
- type ExternalEntity
- type InboxRequest
- type Link
- type PrivacyAudience
- type WebfingerProfileRequestResponse
- type WebfingerResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddImageAttachmentToNote ¶
func AddImageAttachmentToNote(note vocab.ActivityStreamsNote, image, mediaType string)
AddImageAttachmentToNote will add the provided image URL to the provided note object.
func CreateCreateActivity ¶
func CreateCreateActivity(id string, localAccountIRI *url.URL) vocab.ActivityStreamsCreate
CreateCreateActivity will create a new Create Activity model with the provided ID and IRI.
func GetFullUsernameFromExternalEntity ¶
func GetFullUsernameFromExternalEntity(entity ExternalEntity) string
GetFullUsernameFromExternalEntity will return the full username from an internal representation of an ExternalEntity. Returns user@host.tld.
func GetLogoType ¶ added in v0.1.1
func GetLogoType() string
GetLogoType will return the rel value for the webfinger response and the default static image is of type png.
func MakeActivityDirect ¶ added in v0.0.12
func MakeActivityDirect(activity vocab.ActivityStreamsCreate, toIRI *url.URL) vocab.ActivityStreamsCreate
MakeActivityDirect sets the required properties to make this activity seen as a direct message.
func MakeActivityPublic ¶ added in v0.0.12
func MakeActivityPublic(activity vocab.ActivityStreamsCreate) vocab.ActivityStreamsCreate
MakeActivityPublic sets the required properties to make this activity seen as public.
func MakeActorPropertyWithID ¶
func MakeActorPropertyWithID(idIRI *url.URL) vocab.ActivityStreamsActorProperty
MakeActorPropertyWithID will return an actor property filled with the provided IRI.
func MakeCreateActivity ¶
func MakeCreateActivity(activityID *url.URL) vocab.ActivityStreamsCreate
MakeCreateActivity will return a new Create activity with the provided ID.
func MakeHashtag ¶
func MakeHashtag(name string) vocab.TootHashtag
MakeHashtag will create and return a mastodon toot hashtag object with the provided name.
func MakeLocalIRIForAccount ¶
MakeLocalIRIForAccount will return a full IRI for the local server account username.
func MakeLocalIRIForResource ¶
MakeLocalIRIForResource will create an IRI for the local server.
func MakeLocalIRIForStreamURL ¶ added in v0.1.1
MakeLocalIRIForStreamURL will return a full IRI for the local server stream url.
func MakeLocalIRIforLogo ¶ added in v0.1.1
MakeLocalIRIforLogo will return a full IRI for the local server logo.
func MakeNoteDirect ¶ added in v0.0.12
func MakeNoteDirect(note vocab.ActivityStreamsNote, toIRI *url.URL) vocab.ActivityStreamsNote
MakeNoteDirect sets the required properties to make this note seen as a direct message.
func MakeNotePublic ¶ added in v0.0.12
func MakeNotePublic(note vocab.ActivityStreamsNote) vocab.ActivityStreamsNote
MakeNotePublic ses the required proeprties to make this note seen as public.
func MakeRemoteIRIForResource ¶
MakeRemoteIRIForResource will create an IRI for a remote location.
func MakeServiceForAccount ¶
func MakeServiceForAccount(accountName string) vocab.ActivityStreamsService
MakeServiceForAccount will create a new local actor service with the the provided username.
func MakeUpdateActivity ¶
func MakeUpdateActivity(activityID *url.URL) vocab.ActivityStreamsUpdate
MakeUpdateActivity will return a new Update activity with the provided aID.
Types ¶
type ActivityPubActor ¶
type ActivityPubActor struct { // RequestObject is the actual follow request object. RequestObject vocab.ActivityStreamsFollow // W3IDSecurityV1PublicKey is the public key of the actor. W3IDSecurityV1PublicKey vocab.W3IDSecurityV1PublicKeyProperty // ActorIRI is the IRI of the remote actor. ActorIri *url.URL // FollowRequestIRI is the unique identifier of the follow request. FollowRequestIri *url.URL // Inbox is the inbox URL of the remote follower Inbox *url.URL // Image is the avatar image of the Actor. Image *url.URL // DisabledAt is the time, if any, this follower was blocked/removed. DisabledAt *time.Time // Name is the display name of the follower. Name string // Username is the account username of the remote actor. Username string // FullUsername is the username@account.tld representation of the user. FullUsername string }
ActivityPubActor represents a single actor in handling ActivityPub activity.
func MakeActorFromExernalAPEntity ¶
func MakeActorFromExernalAPEntity(entity ExternalEntity) (*ActivityPubActor, error)
MakeActorFromExernalAPEntity takes a full ActivityPub entity and returns our internal representation of an actor.
type DeleteRequest ¶
type DeleteRequest struct {
ActorIri string
}
DeleteRequest represents a request for delete.
type ExternalEntity ¶
type ExternalEntity interface { GetJSONLDId() vocab.JSONLDIdProperty GetActivityStreamsInbox() vocab.ActivityStreamsInboxProperty GetActivityStreamsName() vocab.ActivityStreamsNameProperty GetActivityStreamsPreferredUsername() vocab.ActivityStreamsPreferredUsernameProperty GetActivityStreamsIcon() vocab.ActivityStreamsIconProperty GetW3IDSecurityV1PublicKey() vocab.W3IDSecurityV1PublicKeyProperty }
ExternalEntity represents an ActivityPub Person, Service or Application.
type InboxRequest ¶
InboxRequest represents an inbound request to the ActivityPub inbox.
type PrivacyAudience ¶
type PrivacyAudience = string
PrivacyAudience represents the audience for an activity.
const ( // PUBLIC is an audience meaning anybody can view the item. PUBLIC PrivacyAudience = "https://www.w3.org/ns/activitystreams#Public" )
type WebfingerProfileRequestResponse ¶ added in v0.0.12
type WebfingerProfileRequestResponse struct {
Self string
}
WebfingerProfileRequestResponse represents a Webfinger profile request response.
func MakeWebFingerRequestResponseFromData ¶ added in v0.0.12
func MakeWebFingerRequestResponseFromData(data []map[string]interface{}) WebfingerProfileRequestResponse
MakeWebFingerRequestResponseFromData converts WebFinger data to an easier to use model.
type WebfingerResponse ¶
type WebfingerResponse struct { Aliases []string `json:"aliases"` Subject string `json:"subject"` Links []Link `json:"links"` }
WebfingerResponse represents a Webfinger response.
func MakeWebfingerResponse ¶
func MakeWebfingerResponse(account string, inbox string, host string) WebfingerResponse
MakeWebfingerResponse will create a new Webfinger response.