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) StatusMutePOSTHandler(c *gin.Context)
- func (m *Module) StatusPinPOSTHandler(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" )
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 statusContext
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: Status context object. schema: "$ref": "#/definitions/statusContext" '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.
The parameters can also be given in the body of the request, as JSON, if the content-type is set to 'application/json'. The parameters can also be given in the body of the request, as XML, if the content-type is set to 'application/xml'.
--- tags: - statuses consumes: - application/json - application/xml - application/x-www-form-urlencoded 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
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) 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) 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