Documentation ¶
Index ¶
- Constants
- func GenerateURIForAttachment(accountID string, mediaType string, mediaSize string, mediaID string, ...) string
- func GenerateURIForBlock(username string, thisBlockID string) string
- func GenerateURIForEmailConfirm(token string) string
- func GenerateURIForEmoji(emojiID string) string
- func GenerateURIForFollow(username string, thisFollowID string) string
- func GenerateURIForLike(username string, thisFavedID string) string
- func GenerateURIForUpdate(username string, thisUpdateID string) string
- func IsBlockPath(id *url.URL) bool
- func IsFollowPath(id *url.URL) bool
- func IsFollowersPath(id *url.URL) bool
- func IsFollowingPath(id *url.URL) bool
- func IsInboxPath(id *url.URL) bool
- func IsInstanceActorPath(id *url.URL) bool
- func IsLikePath(id *url.URL) bool
- func IsLikedPath(id *url.URL) bool
- func IsOutboxPath(id *url.URL) bool
- func IsPublicKeyPath(id *url.URL) bool
- func IsStatusesPath(id *url.URL) bool
- func IsUserPath(id *url.URL) bool
- func ParseBlockPath(id *url.URL) (username string, ulid string, err error)
- func ParseFollowersPath(id *url.URL) (username string, err error)
- func ParseFollowingPath(id *url.URL) (username string, err error)
- func ParseInboxPath(id *url.URL) (username string, err error)
- func ParseLikedPath(id *url.URL) (username string, ulid string, err error)
- func ParseOutboxPath(id *url.URL) (username string, err error)
- func ParseStatusesPath(id *url.URL) (username string, ulid string, err error)
- func ParseUserPath(id *url.URL) (username string, err error)
- type UserURIs
Constants ¶
const ( UsersPath = "users" // UsersPath is for serving users info ActorsPath = "actors" // ActorsPath is for serving actors info StatusesPath = "statuses" // StatusesPath is for serving statuses InboxPath = "inbox" // InboxPath represents the activitypub inbox location OutboxPath = "outbox" // OutboxPath represents the activitypub outbox location FollowersPath = "followers" // FollowersPath represents the activitypub followers location FollowingPath = "following" // FollowingPath represents the activitypub following location LikedPath = "liked" // LikedPath represents the activitypub liked location CollectionsPath = "collections" // CollectionsPath represents the activitypub collections location FeaturedPath = "featured" // FeaturedPath represents the activitypub featured location PublicKeyPath = "main-key" // PublicKeyPath is for serving an account's public key FollowPath = "follow" // FollowPath used to generate the URI for an individual follow or follow request UpdatePath = "updates" // UpdatePath is used to generate the URI for an account update BlocksPath = "blocks" // BlocksPath is used to generate the URI for a block ConfirmEmailPath = "confirm_email" // ConfirmEmailPath is used to generate the URI for an email confirmation link FileserverPath = "fileserver" // FileserverPath is a path component for serving attachments + media EmojiPath = "emoji" // EmojiPath represents the activitypub emoji location )
Variables ¶
This section is empty.
Functions ¶
func GenerateURIForAttachment ¶
func GenerateURIForAttachment(accountID string, mediaType string, mediaSize string, mediaID string, extension string) string
GenerateURIForAttachment generates a URI for an attachment/emoji/header etc. Will produced something like https://example.org/fileserver/01FPST95B8FC3HG3AGCDKPQNQ2/attachment/original/01FPST9QK4V5XWS3F9Z4F2G1X7.gif
func GenerateURIForBlock ¶
GenerateURIForBlock returns the AP URI for a new block activity -- something like: https://example.org/users/whatever_user/blocks/01F7XTH1QGBAPMGF49WJZ91XGC
func GenerateURIForEmailConfirm ¶
GenerateURIForEmailConfirm returns a link for email confirmation -- something like: https://example.org/confirm_email?token=490e337c-0162-454f-ac48-4b22bb92a205
func GenerateURIForEmoji ¶
GenerateURIForEmoji generates an activitypub uri for a new emoji.
func GenerateURIForFollow ¶
GenerateURIForFollow returns the AP URI for a new follow -- something like: https://example.org/users/whatever_user/follow/01F7XTH1QGBAPMGF49WJZ91XGC
func GenerateURIForLike ¶
GenerateURIForLike returns the AP URI for a new like/fave -- something like: https://example.org/users/whatever_user/liked/01F7XTH1QGBAPMGF49WJZ91XGC
func GenerateURIForUpdate ¶
GenerateURIForUpdate returns the AP URI for a new update activity -- something like: https://example.org/users/whatever_user#updates/01F7XTH1QGBAPMGF49WJZ91XGC
func IsBlockPath ¶
IsBlockPath returns true if the given URL path corresponds to eg /users/example_username/blocks/SOME_ULID_OF_A_BLOCK
func IsFollowPath ¶
IsFollowPath returns true if the given URL path corresponds to eg /users/example_username/follow/SOME_ULID_OF_A_FOLLOW
func IsFollowersPath ¶
IsFollowersPath returns true if the given URL path corresponds to eg /users/example_username/followers
func IsFollowingPath ¶
IsFollowingPath returns true if the given URL path corresponds to eg /users/example_username/following
func IsInboxPath ¶
IsInboxPath returns true if the given URL path corresponds to eg /users/example_username/inbox
func IsInstanceActorPath ¶
IsInstanceActorPath returns true if the given URL path corresponds to eg /actors/example_username
func IsLikePath ¶
IsLikePath returns true if the given URL path corresponds to eg /users/example_username/liked/SOME_ULID_OF_A_STATUS
func IsLikedPath ¶
IsLikedPath returns true if the given URL path corresponds to eg /users/example_username/liked
func IsOutboxPath ¶
IsOutboxPath returns true if the given URL path corresponds to eg /users/example_username/outbox
func IsPublicKeyPath ¶
IsPublicKeyPath returns true if the given URL path corresponds to eg /users/example_username/main-key
func IsStatusesPath ¶
IsStatusesPath returns true if the given URL path corresponds to eg /users/example_username/statuses/SOME_ULID_OF_A_STATUS
func IsUserPath ¶
IsUserPath returns true if the given URL path corresponds to eg /users/example_username
func ParseBlockPath ¶
ParseBlockPath returns the username and ulid from a path such as /users/example_username/blocks/SOME_ULID_OF_A_BLOCK
func ParseFollowersPath ¶
ParseFollowersPath returns the username from a path such as /users/example_username/followers
func ParseFollowingPath ¶
ParseFollowingPath returns the username from a path such as /users/example_username/following
func ParseInboxPath ¶
ParseInboxPath returns the username from a path such as /users/example_username/inbox
func ParseLikedPath ¶
ParseLikedPath returns the username and ulid from a path such as /users/example_username/liked/SOME_ULID_OF_A_STATUS
func ParseOutboxPath ¶
ParseOutboxPath returns the username from a path such as /users/example_username/outbox
func ParseStatusesPath ¶
ParseStatusesPath returns the username and ulid from a path such as /users/example_username/statuses/SOME_ULID_OF_A_STATUS
Types ¶
type UserURIs ¶
type UserURIs struct { // The web URL of the instance host, eg https://example.org HostURL string // The web URL of the user, eg., https://example.org/@example_user UserURL string // The web URL for statuses of this user, eg., https://example.org/@example_user/statuses StatusesURL string // The activitypub URI of this user, eg., https://example.org/users/example_user UserURI string // The activitypub URI for this user's statuses, eg., https://example.org/users/example_user/statuses StatusesURI string // The activitypub URI for this user's activitypub inbox, eg., https://example.org/users/example_user/inbox InboxURI string // The activitypub URI for this user's activitypub outbox, eg., https://example.org/users/example_user/outbox OutboxURI string // The activitypub URI for this user's followers, eg., https://example.org/users/example_user/followers FollowersURI string // The activitypub URI for this user's following, eg., https://example.org/users/example_user/following FollowingURI string // The activitypub URI for this user's liked posts eg., https://example.org/users/example_user/liked LikedURI string // The activitypub URI for this user's featured collections, eg., https://example.org/users/example_user/collections/featured CollectionURI string // The URI for this user's public key, eg., https://example.org/users/example_user/publickey PublicKeyURI string }
UserURIs contains a bunch of UserURIs and URLs for a user, host, account, etc.
func GenerateURIsForAccount ¶
GenerateURIsForAccount throws together a bunch of URIs for the given username, with the given protocol and host.