status

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
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) Route

func (m *Module) Route(r router.Router) error

Route attaches all routes from this module to the given router

func (*Module) StatusBoostPOSTHandler

func (m *Module) StatusBoostPOSTHandler(c *gin.Context)

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

func (m *Module) StatusBoostedByGETHandler(c *gin.Context)

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

func (m *Module) StatusContextGETHandler(c *gin.Context)

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

func (m *Module) StatusCreatePOSTHandler(c *gin.Context)

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

func (m *Module) StatusDELETEHandler(c *gin.Context)

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

func (m *Module) StatusFavePOSTHandler(c *gin.Context)

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

func (m *Module) StatusFavedByGETHandler(c *gin.Context)

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

func (m *Module) StatusGETHandler(c *gin.Context)

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

func (m *Module) StatusUnboostPOSTHandler(c *gin.Context)

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

func (m *Module) StatusUnfavePOSTHandler(c *gin.Context)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL