accounts

package
v0.10.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExcludeReblogsKey = "exclude_reblogs"
	ExcludeRepliesKey = "exclude_replies"
	LimitKey          = "limit"
	MaxIDKey          = "max_id"
	MinIDKey          = "min_id"
	OnlyMediaKey      = "only_media"
	OnlyPublicKey     = "only_public"
	PinnedKey         = "pinned"

	BasePath       = "/v1/accounts"
	IDKey          = "id"
	BasePathWithID = BasePath + "/:" + IDKey

	BlockPath         = BasePathWithID + "/block"
	DeletePath        = BasePath + "/delete"
	FollowersPath     = BasePathWithID + "/followers"
	FollowingPath     = BasePathWithID + "/following"
	FollowPath        = BasePathWithID + "/follow"
	ListsPath         = BasePathWithID + "/lists"
	LookupPath        = BasePath + "/lookup"
	RelationshipsPath = BasePath + "/relationships"
	SearchPath        = BasePath + "/search"
	StatusesPath      = BasePathWithID + "/statuses"
	UnblockPath       = BasePathWithID + "/unblock"
	UnfollowPath      = BasePathWithID + "/unfollow"
	UpdatePath        = BasePath + "/update_credentials"
	VerifyPath        = BasePath + "/verify_credentials"
)

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) AccountBlockPOSTHandler

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

AccountBlockPOSTHandler swagger:operation POST /api/v1/accounts/{id}/block accountBlock

Block account with id.

---
tags:
- accounts

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: The id of the account to block.
	in: path
	required: true

security:
- OAuth2 Bearer:
	- write:blocks

responses:
	'200':
		description: Your relationship to the account.
		schema:
			"$ref": "#/definitions/accountRelationship"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountCreatePOSTHandler

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

AccountCreatePOSTHandler swagger:operation POST /api/v1/accounts accountCreate

Create a new account using an application token.

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:
- accounts

consumes:
- application/json
- application/xml
- application/x-www-form-urlencoded

produces:
- application/json

security:
- OAuth2 Application:
	- write:accounts

responses:
	'200':
		description: "An OAuth2 access token for the newly-created account."
		schema:
			"$ref": "#/definitions/oauthToken"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountDeletePOSTHandler

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

AccountDeletePOSTHandler swagger:operation POST /api/v1/accounts/delete accountDelete

Delete your account.

---
tags:
- accounts

consumes:
- multipart/form-data

parameters:
-
	name: password
	in: formData
	description: Password of the account user, for confirmation.
	type: string
	required: true

security:
- OAuth2 Bearer:
	- write:accounts

responses:
	'202':
		description: "The account deletion has been accepted and the account will be deleted."
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountFollowPOSTHandler

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

AccountFollowPOSTHandler swagger:operation POST /api/v1/accounts/{id}/follow accountFollow

Follow account with id.

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'.

If you already follow (request) the given account, then the follow (request) will be updated instead using the `reblogs` and `notify` parameters.

---
tags:
- accounts

consumes:
- application/json
- application/xml
- application/x-www-form-urlencoded

parameters:
-
	name: id
	required: true
	in: path
	description: ID of the account to follow.
	type: string
-
	name: reblogs
	type: boolean
	default: true
	description: Show reblogs from this account.
	in: formData
-
	name: notify
	type: boolean
	default: false
	description: Notify when this account posts.
	in: formData

produces:
- application/json

security:
- OAuth2 Bearer:
	- write:follows

responses:
	'200':
		name: account relationship
		description: Your relationship to this account.
		schema:
			"$ref": "#/definitions/accountRelationship"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountFollowersGETHandler

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

AccountFollowersGETHandler swagger:operation GET /api/v1/accounts/{id}/followers accountFollowers

See followers of account with given id.

---
tags:
- accounts

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: Account ID.
	in: path
	required: true

security:
- OAuth2 Bearer:
	- read:accounts

responses:
	'200':
		name: accounts
		description: Array of accounts that follow this account.
		schema:
			type: array
			items:
				"$ref": "#/definitions/account"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountFollowingGETHandler

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

AccountFollowingGETHandler swagger:operation GET /api/v1/accounts/{id}/following accountFollowing

See accounts followed by given account id.

---
tags:
- accounts

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: Account ID.
	in: path
	required: true

security:
- OAuth2 Bearer:
	- read:accounts

responses:
	'200':
		name: accounts
		description: Array of accounts that are followed by this account.
		schema:
		type: array
		items:
			"$ref": "#/definitions/account"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountGETHandler

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

AccountGETHandler swagger:operation GET /api/v1/accounts/{id} accountGet

Get information about an account with the given ID.

---
tags:
- accounts

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: The id of the requested account.
	in: path
	required: true

security:
- OAuth2 Bearer:
	- read:accounts

responses:
	'200':
		description: The requested account.
		schema:
			"$ref": "#/definitions/account"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountListsGETHandler added in v0.10.0

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

AccountListsGETHandler swagger:operation GET /api/v1/accounts/{id}/lists accountLists

See all lists of yours that contain requested account.

---
tags:
- accounts

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: Account ID.
	in: path
	required: true

security:
- OAuth2 Bearer:
	- read:lists

responses:
	'200':
		name: lists
		description: Array of all lists containing this account.
		schema:
			type: array
			items:
				"$ref": "#/definitions/list"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountLookupGETHandler added in v0.10.0

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

AccountLookupGETHandler swagger:operation GET /api/v1/accounts/lookup accountLookupGet

Quickly lookup a username to see if it is available, skipping WebFinger resolution.

---
tags:
- accounts

produces:
- application/json

parameters:
-
	name: acct
	type: string
	description: The username or Webfinger address to lookup.
	in: query
	required: true

security:
- OAuth2 Bearer:
	- read:accounts

responses:
	'200':
		name: lookup result
		description: Result of the lookup.
		schema:
			"$ref": "#/definitions/account"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountRelationshipsGETHandler

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

AccountRelationshipsGETHandler swagger:operation GET /api/v1/accounts/relationships accountRelationships

See your account's relationships with the given account IDs.

---
tags:
- accounts

produces:
- application/json

parameters:
-
	name: id
	type: array
	items:
		type: string
	description: Account IDs.
	in: query
	required: true

security:
- OAuth2 Bearer:
	- read:accounts

responses:
	'200':
		name: account relationships
		description: Array of account relationships.
		schema:
			type: array
			items:
				"$ref": "#/definitions/accountRelationship"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountSearchGETHandler added in v0.10.0

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

AccountSearchGETHandler swagger:operation GET /api/v1/accounts/search accountSearchGet

Search for accounts by username and/or display name.

---
tags:
- accounts

produces:
- application/json

parameters:
-
	name: limit
	type: integer
	description: Number of results to try to return.
	default: 40
	maximum: 80
	minimum: 1
	in: query
-
	name: offset
	type: integer
	description: >-
		Page number of results to return (starts at 0).
		This parameter is currently not used, offsets
		over 0 will always return 0 results.
	default: 0
	maximum: 10
	minimum: 0
	in: query
-
	name: q
	type: string
	description: |-
		Query string to search for. This can be in the following forms:
		- `@[username]` -- search for an account with the given username on any domain. Can return multiple results.
		- `@[username]@[domain]` -- search for a remote account with exact username and domain. Will only ever return 1 result at most.
		- any arbitrary string -- search for accounts containing the given string in their username or display name. Can return multiple results.
	in: query
	required: true
-
	name: resolve
	type: boolean
	description: >-
		If query is for `@[username]@[domain]`, or a URL, allow the GoToSocial instance to resolve
		the search by making calls to remote instances (webfinger, ActivityPub, etc).
	default: false
	in: query
-
	name: following
	type: boolean
	description: >-
		Show only accounts that the requesting account follows. If this is set to `true`, then the GoToSocial instance
		will enhance the search by also searching within account notes, not just in usernames and display names.
	default: false
	in: query

security:
- OAuth2 Bearer:
	- read:accounts

responses:
	'200':
		name: search results
		description: Results of the search.
		schema:
			type: array
			items:
				"$ref": "#/definitions/account"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountStatusesGETHandler

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

AccountStatusesGETHandler swagger:operation GET /api/v1/accounts/{id}/statuses accountStatuses

See statuses posted by the requested account.

The statuses will be returned in descending chronological order (newest first), with sequential IDs (bigger = newer).

---
tags:
- accounts

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: Account ID.
	in: path
	required: true
-
	name: limit
	type: integer
	description: Number of statuses to return.
	default: 30
	in: query
	required: false
-
	name: exclude_replies
	type: boolean
	description: Exclude statuses that are a reply to another status.
	default: false
	in: query
	required: false
-
	name: exclude_reblogs
	type: boolean
	description: Exclude statuses that are a reblog/boost of another status.
	default: false
	in: query
	required: false
-
	name: max_id
	type: string
	description: >-
		Return only statuses *OLDER* than the given max status ID.
		The status with the specified ID will not be included in the response.
	in: query
-
	name: min_id
	type: string
	description: >-
		Return only statuses *NEWER* than the given min status ID.
		The status with the specified ID will not be included in the response.
	in: query
	required: false
-
	name: pinned_only
	type: boolean
	description: Show only pinned statuses. In other words, exclude statuses that are not pinned to the given account ID.
	default: false
	in: query
	required: false
-
	name: only_media
	type: boolean
	description: Show only statuses with media attachments.
	default: false
	in: query
	required: false
-
	name: only_public
	type: boolean
	description: Show only statuses with a privacy setting of 'public'.
	default: false
	in: query
	required: false

security:
- OAuth2 Bearer:
	- read:accounts

responses:
	'200':
		name: statuses
		description: Array of statuses.
		schema:
			type: array
			items:
				"$ref": "#/definitions/status"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountUnblockPOSTHandler

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

AccountUnblockPOSTHandler swagger:operation POST /api/v1/accounts/{id}/unblock accountUnblock

Unblock account with ID.

---
tags:
- accounts

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: The id of the account to unblock.
	in: path
	required: true

security:
- OAuth2 Bearer:
	- write:blocks

responses:
	'200':
		name: account relationship
		description: Your relationship to this account.
		schema:
			"$ref": "#/definitions/accountRelationship"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountUnfollowPOSTHandler

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

AccountUnfollowPOSTHandler swagger:operation POST /api/v1/accounts/{id}/unfollow accountUnfollow

Unfollow account with id.

---
tags:
- accounts

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: The id of the account to unfollow.
	in: path
	required: true

security:
- OAuth2 Bearer:
	- write:follows

responses:
	'200':
		name: account relationship
		description: Your relationship to this account.
		schema:
	 		"$ref": "#/definitions/accountRelationship"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountUpdateCredentialsPATCHHandler

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

AccountUpdateCredentialsPATCHHandler swagger:operation PATCH /api/v1/accounts/update_credentials accountUpdate

Update your account.

---
tags:
- accounts

consumes:
- multipart/form-data
- application/x-www-form-urlencoded
- application/json

produces:
- application/json

parameters:
-
	name: discoverable
	in: formData
	description: Account should be made discoverable and shown in the profile directory (if enabled).
	type: boolean
-
	name: bot
	in: formData
	description: Account is flagged as a bot.
	type: boolean
-
	name: display_name
	in: formData
	description: The display name to use for the account.
	type: string
	allowEmptyValue: true
-
	name: note
	in: formData
	description: Bio/description of this account.
	type: string
	allowEmptyValue: true
-
	name: avatar
	in: formData
	description: Avatar of the user.
	type: file
-
	name: header
	in: formData
	description: Header of the user.
	type: file
-
	name: locked
	in: formData
	description: Require manual approval of follow requests.
	type: boolean
-
	name: source[privacy]
	in: formData
	description: Default post privacy for authored statuses.
	type: string
-
	name: source[sensitive]
	in: formData
	description: Mark authored statuses as sensitive by default.
	type: boolean
-
	name: source[language]
	in: formData
	description: Default language to use for authored statuses (ISO 6391).
	type: string
-
	name: source[status_content_type]
	in: formData
	description: Default content type to use for authored statuses (text/plain or text/markdown).
	type: string
-
	name: custom_css
	in: formData
	description: >-
		Custom CSS to use when rendering this account's profile or statuses.
		String must be no more than 5,000 characters (~5kb).
	type: string
-
	name: enable_rss
	in: formData
	description: Enable RSS feed for this account's Public posts at `/[username]/feed.rss`
	type: boolean
-
	name: fields_attributes
	in: formData
	description: Profile fields to be added to this account's profile
	type: array
	items:
		type: object

security:
- OAuth2 Bearer:
	- write:accounts

responses:
	'200':
		description: "The newly updated account."
		schema:
			"$ref": "#/definitions/account"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) AccountVerifyGETHandler

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

AccountVerifyGETHandler swagger:operation GET /api/v1/accounts/verify_credentials accountVerify

Verify a token by returning account details pertaining to it.

---
tags:
- accounts

produces:
- application/json

security:
- OAuth2 Bearer:
	- read:accounts

responses:
	'200':
		schema:
			"$ref": "#/definitions/account"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) Route

func (m *Module) Route(attachHandler func(method string, path string, f ...gin.HandlerFunc) gin.IRoutes)

Jump to

Keyboard shortcuts

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