Documentation ¶
Index ¶
- Constants
- func New(processor processing.Processor) api.ClientModule
- type Module
- func (m *Module) Route(r router.Router) error
- 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) StatusUnboostPOSTHandler(c *gin.Context)
- func (m *Module) StatusUnfavePOSTHandler(c *gin.Context)
Constants ¶
const ( // IDKey is for status UUIDs IDKey = "id" // BasePath is the base path for serving the status API BasePath = "/api/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 // ContextPath is used for fetching context of posts ContextPath = BasePathWithID + "/context" // 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" )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(processor processing.Processor) api.ClientModule
New returns a new account module
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module implements the ClientAPIModule interface for every related to posting/deleting/interacting with statuses
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
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
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" '401': description: unauthorized '400': description: bad request '404': description: not found '500': description: internal 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 newly deleted status." schema: "$ref": "#/definitions/status" '400': description: bad request '401': description: unauthorized '403': description: forbidden '404': description: not found
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
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
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 created status." schema: "$ref": "#/definitions/status" '401': description: unauthorized '400': description: bad request '404': description: not found '500': description: internal 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
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