Documentation
¶
Index ¶
- Constants
- type Module
- func (m *Module) Route(...)
- func (m *Module) StatusBookmarkPOSTHandler(c *gin.Context)
- func (m *Module) StatusBoostPOSTHandler(c *gin.Context)
- func (m *Module) StatusBoostedByGETHandler(c *gin.Context)
- func (m *Module) StatusContextGETHandler(c *gin.Context)
- func (m *Module) StatusCreatePOSTHandler(c *gin.Context)
- func (m *Module) StatusDELETEHandler(c *gin.Context)
- func (m *Module) StatusFavePOSTHandler(c *gin.Context)
- func (m *Module) StatusFavedByGETHandler(c *gin.Context)
- func (m *Module) StatusGETHandler(c *gin.Context)
- func (m *Module) StatusHistoryGETHandler(c *gin.Context)
- func (m *Module) StatusMutePOSTHandler(c *gin.Context)
- func (m *Module) StatusPinPOSTHandler(c *gin.Context)
- func (m *Module) StatusSourceGETHandler(c *gin.Context)
- func (m *Module) StatusUnbookmarkPOSTHandler(c *gin.Context)
- func (m *Module) StatusUnboostPOSTHandler(c *gin.Context)
- func (m *Module) StatusUnfavePOSTHandler(c *gin.Context)
- func (m *Module) StatusUnmutePOSTHandler(c *gin.Context)
- func (m *Module) StatusUnpinPOSTHandler(c *gin.Context)
Constants ¶
const ( // IDKey is for status UUIDs IDKey = "id" // BasePath is the base path for serving the statuses API, minus the 'api' prefix BasePath = "/v1/statuses" // BasePathWithID is just the base path with the ID key in it. // Use this anywhere you need to know the ID of the status being queried. BasePathWithID = BasePath + "/:" + IDKey // FavouritedPath is for seeing who's faved a given status FavouritedPath = BasePathWithID + "/favourited_by" // FavouritePath is for posting a fave on a status FavouritePath = BasePathWithID + "/favourite" // UnfavouritePath is for removing a fave from a status UnfavouritePath = BasePathWithID + "/unfavourite" // RebloggedPath is for seeing who's boosted a given status RebloggedPath = BasePathWithID + "/reblogged_by" // ReblogPath is for boosting/reblogging a given status ReblogPath = BasePathWithID + "/reblog" // UnreblogPath is for undoing a boost/reblog of a given status UnreblogPath = BasePathWithID + "/unreblog" // BookmarkPath is for creating a bookmark on a given status BookmarkPath = BasePathWithID + "/bookmark" // UnbookmarkPath is for removing a bookmark from a given status UnbookmarkPath = BasePathWithID + "/unbookmark" // MutePath is for muting a given status so that notifications will no longer be received about it. MutePath = BasePathWithID + "/mute" // UnmutePath is for undoing an existing mute UnmutePath = BasePathWithID + "/unmute" // PinPath is for pinning a status to an account profile so that it's the first thing people see PinPath = BasePathWithID + "/pin" // UnpinPath is for undoing a pin and returning a status to the ever-swirling drain of time and entropy UnpinPath = BasePathWithID + "/unpin" // ContextPath is used for fetching context of posts ContextPath = BasePathWithID + "/context" // HistoryPath is used for fetching history of posts. HistoryPath = BasePathWithID + "/history" // SourcePath is used for fetching source of a post. SourcePath = BasePathWithID + "/source" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func New ¶
func New(processor *processing.Processor) *Module
func (*Module) StatusBookmarkPOSTHandler ¶
StatusBookmarkPOSTHandler swagger:operation POST /api/v1/statuses/{id}/bookmark statusBookmark
Bookmark status with the given ID.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - write:statuses responses: '200': name: status description: The status. schema: "$ref": "#/definitions/status" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusBoostPOSTHandler ¶
StatusBoostPOSTHandler swagger:operation POST /api/v1/statuses/{id}/reblog statusReblog
Reblog/boost status with the given ID.
If the target status is rebloggable/boostable, it will be shared with your followers. This is equivalent to an ActivityPub 'Announce' activity.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - write:statuses responses: '200': name: status description: The boost of the status. schema: "$ref": "#/definitions/status" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusBoostedByGETHandler ¶
StatusBoostedByGETHandler swagger:operation GET /api/v1/statuses/{id}/reblogged_by statusBoostedBy
View accounts that have reblogged/boosted the target status.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - read:accounts responses: '200': schema: type: array items: "$ref": "#/definitions/account" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found
func (*Module) StatusContextGETHandler ¶
StatusContextGETHandler swagger:operation GET /api/v1/statuses/{id}/context threadContext
Return ancestors and descendants of the given status.
The returned statuses will be ordered in a thread structure, so they are suitable to be displayed in the order in which they were returned.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - read:statuses responses: '200': name: statuses description: Thread context object. schema: "$ref": "#/definitions/threadContext" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusCreatePOSTHandler ¶
StatusCreatePOSTHandler swagger:operation POST /api/v1/statuses statusCreate
Create a new status using the given form field parameters.
The parameters can also be given in the body of the request, as JSON, if the content-type is set to 'application/json'.
The 'interaction_policy' field can be used to set an interaction policy for this status.
If submitting using form data, use the following pattern to set an interaction policy:
`interaction_policy[INTERACTION_TYPE][CONDITION][INDEX]=Value`
For example: `interaction_policy[can_reply][always][0]=author`
Using `curl` this might look something like:
`curl -F 'interaction_policy[can_reply][always][0]=author' -F 'interaction_policy[can_reply][always][1]=followers' [... other form fields ...]`
The JSON equivalent would be:
`curl -H 'Content-Type: application/json' -d '{"interaction_policy":{"can_reply":{"always":["author","followers"]}} [... other json fields ...]}'`
The server will perform some normalization on the submitted policy so that you can't submit something totally invalid.
--- tags: - statuses consumes: - application/json - application/x-www-form-urlencoded parameters: - name: status x-go-name: Status description: |- Text content of the status. If media_ids is provided, this becomes optional. Attaching a poll is optional while status is provided. type: string in: formData - name: media_ids x-go-name: MediaIDs description: |- Array of Attachment ids to be attached as media. If provided, status becomes optional, and poll cannot be used. If the status is being submitted as a form, the key is 'media_ids[]', but if it's json or xml, the key is 'media_ids'. type: array items: type: string in: formData - name: poll[options][] x-go-name: PollOptions description: |- Array of possible poll answers. If provided, media_ids cannot be used, and poll[expires_in] must be provided. type: array items: type: string in: formData - name: poll[expires_in] x-go-name: PollExpiresIn description: |- Duration the poll should be open, in seconds. If provided, media_ids cannot be used, and poll[options] must be provided. type: integer format: int64 in: formData - name: poll[multiple] x-go-name: PollMultiple description: Allow multiple choices on this poll. type: boolean default: false in: formData - name: poll[hide_totals] x-go-name: PollHideTotals description: Hide vote counts until the poll ends. type: boolean default: true in: formData - name: in_reply_to_id x-go-name: InReplyToID description: ID of the status being replied to, if status is a reply. type: string in: formData - name: sensitive x-go-name: Sensitive description: Status and attached media should be marked as sensitive. type: boolean in: formData - name: spoiler_text x-go-name: SpoilerText description: |- Text to be shown as a warning or subject before the actual content. Statuses are generally collapsed behind this field. type: string in: formData - name: visibility x-go-name: Visibility description: Visibility of the posted status. type: string enum: - public - unlisted - private - mutuals_only - direct in: formData - name: local_only x-go-name: LocalOnly description: >- If set to true, this status will be "local only" and will NOT be federated beyond the local timeline(s). If set to false (default), this status will be federated to your followers beyond the local timeline(s). type: boolean in: formData default: false - name: federated x-go-name: Federated description: >- ***DEPRECATED***. Included for back compat only. Only used if set and local_only is not yet. If set to true, this status will be federated beyond the local timeline(s). If set to false, this status will NOT be federated beyond the local timeline(s). in: formData type: boolean - name: scheduled_at x-go-name: ScheduledAt description: |- ISO 8601 Datetime at which to schedule a status. Providing this parameter will cause ScheduledStatus to be returned instead of Status. Must be at least 5 minutes in the future. This feature isn't implemented yet; attemping to set it will return 501 Not Implemented. type: string in: formData - name: language x-go-name: Language description: ISO 639 language code for this status. type: string in: formData - name: content_type x-go-name: ContentType description: Content type to use when parsing this status. type: string enum: - text/plain - text/markdown in: formData - name: interaction_policy[can_favourite][always][0] in: formData description: Nth entry for interaction_policy.can_favourite.always. type: string - name: interaction_policy[can_favourite][with_approval][0] in: formData description: Nth entry for interaction_policy.can_favourite.with_approval. type: string - name: interaction_policy[can_reply][always][0] in: formData description: Nth entry for interaction_policy.can_reply.always. type: string - name: interaction_policy[can_reply][with_approval][0] in: formData description: Nth entry for interaction_policy.can_reply.with_approval. type: string - name: interaction_policy[can_reblog][always][0] in: formData description: Nth entry for interaction_policy.can_reblog.always. type: string - name: interaction_policy[can_reblog][with_approval][0] in: formData description: Nth entry for interaction_policy.can_reblog.with_approval. type: string produces: - application/json security: - OAuth2 Bearer: - write:statuses responses: '200': description: "The newly created status." schema: "$ref": "#/definitions/status" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error '501': description: scheduled_at was set, but this feature is not yet implemented
func (*Module) StatusDELETEHandler ¶
StatusDELETEHandler swagger:operation DELETE /api/v1/statuses/{id} statusDelete
Delete status with the given ID. The status must belong to you.
The deleted status will be returned in the response. The `text` field will contain the original text of the status as it was submitted. This is useful when doing a 'delete and redraft' type operation.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - write:statuses responses: '200': description: "The status that was just deleted." schema: "$ref": "#/definitions/status" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusFavePOSTHandler ¶
StatusFavePOSTHandler swagger:operation POST /api/v1/statuses/{id}/favourite statusFave
Star/like/favourite the given status, if permitted.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - write:statuses responses: '200': description: "The newly faved status." schema: "$ref": "#/definitions/status" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusFavedByGETHandler ¶
StatusFavedByGETHandler swagger:operation GET /api/v1/statuses/{id}/favourited_by statusFavedBy
View accounts that have faved/starred/liked the target status.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - read:accounts responses: '200': schema: type: array items: "$ref": "#/definitions/account" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusGETHandler ¶
StatusGETHandler swagger:operation GET /api/v1/statuses/{id} statusGet
View status with the given ID.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - read:statuses responses: '200': description: "The requested status." schema: "$ref": "#/definitions/status" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusHistoryGETHandler ¶ added in v0.16.0
StatusHistoryGETHandler swagger:operation GET /api/v1/statuses/{id}/history statusHistoryGet
View edit history of status with the given ID.
UNIMPLEMENTED: Currently this endpoint will always return an array of length 1, containing only the latest/current version of the status.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - read:statuses responses: '200': schema: type: array items: "$ref": "#/definitions/statusEdit" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusMutePOSTHandler ¶ added in v0.13.0
StatusMutePOSTHandler swagger:operation POST /api/v1/statuses/{id}/mute statusMute
Mute a status's thread. This prevents notifications from being created for future replies, likes, boosts etc in the thread of which the target status is a part.
Target status must belong to you or mention you.
Status thread mutes and unmutes are idempotent. If you already mute a thread, muting it again just means it stays muted and you'll get 200 OK back.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - write:mutes responses: '200': name: status description: The now-muted status. schema: "$ref": "#/definitions/status" '400': description: bad request; you're not part of the target status thread '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusPinPOSTHandler ¶ added in v0.8.0
StatusPinPOSTHandler swagger:operation POST /api/v1/statuses/{id}/pin statusPin
Pin a status to the top of your profile, and add it to your Featured ActivityPub collection.
You can only pin original posts (not reblogs) that you authored yourself.
Supported privacy levels for pinned posts are public, unlisted, and private/followers-only, but only public posts will appear on the web version of your profile.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - write:accounts responses: '200': name: status description: The status. schema: "$ref": "#/definitions/status" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusSourceGETHandler ¶ added in v0.16.0
StatusSourceGETHandler swagger:operation GET /api/v1/statuses/{id}/source statusSourceGet
View source text of status with the given ID. Requester must own the status.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - read:statuses responses: '200': schema: type: array items: "$ref": "#/definitions/statusSource" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusUnbookmarkPOSTHandler ¶
StatusUnbookmarkPOSTHandler swagger:operation POST /api/v1/statuses/{id}/unbookmark statusUnbookmark
Unbookmark status with the given ID.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - write:statuses responses: '200': name: status description: The status. schema: "$ref": "#/definitions/status" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusUnboostPOSTHandler ¶
StatusUnboostPOSTHandler swagger:operation POST /api/v1/statuses/{id}/unreblog statusUnreblog
Unreblog/unboost status with the given ID.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - write:statuses responses: '200': name: status description: The unboosted status. schema: "$ref": "#/definitions/status" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusUnfavePOSTHandler ¶
StatusUnfavePOSTHandler swagger:operation POST /api/v1/statuses/{id}/unfavourite statusUnfave
Unstar/unlike/unfavourite the given status.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - write:statuses responses: '200': description: "The unfaved status." schema: "$ref": "#/definitions/status" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusUnmutePOSTHandler ¶ added in v0.13.0
StatusUnmutePOSTHandler swagger:operation POST /api/v1/statuses/{id}/unmute statusUnmute
Unmute a status's thread. This reenables notifications for future replies, likes, boosts etc in the thread of which the target status is a part.
Target status must belong to you or mention you.
Status thread mutes and unmutes are idempotent. If you already unmuted a thread, unmuting it again just means it stays unmuted and you'll get 200 OK back.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - write:mutes responses: '200': name: status description: The now-unmuted status. schema: "$ref": "#/definitions/status" '400': description: bad request; you're not part of the target status thread '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error
func (*Module) StatusUnpinPOSTHandler ¶ added in v0.8.0
StatusUnpinPOSTHandler swagger:operation POST /api/v1/statuses/{id}/unpin statusUnpin
Unpin one of your pinned statuses.
--- tags: - statuses produces: - application/json parameters: - name: id type: string description: Target status ID. in: path required: true security: - OAuth2 Bearer: - write:accounts responses: '200': name: status description: The status. schema: "$ref": "#/definitions/status" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found '406': description: not acceptable '500': description: internal server error