Documentation ¶
Index ¶
- type IMemberController
- type MemberController
- func (mc *MemberController) AcceptFollow(c *fiber.Ctx) error
- func (mc *MemberController) Ban(c *fiber.Ctx) error
- func (mc *MemberController) CancelFollowRequest(c *fiber.Ctx) error
- func (mc *MemberController) Check(c *fiber.Ctx) error
- func (mc *MemberController) Export(c *fiber.Ctx) error
- func (mc *MemberController) Follow(c *fiber.Ctx) error
- func (mc *MemberController) FollowStatus(c *fiber.Ctx) error
- func (mc *MemberController) GetFollowRequests(c *fiber.Ctx) error
- func (mc *MemberController) GetFollowers(c *fiber.Ctx) error
- func (mc *MemberController) GetID(c *fiber.Ctx) error
- func (mc *MemberController) GetMemberByNickOrEmail(c *fiber.Ctx) error
- func (mc *MemberController) GetMemberByWebfinger(c *fiber.Ctx) error
- func (mc *MemberController) RejectFollow(c *fiber.Ctx) error
- func (mc *MemberController) Unban(c *fiber.Ctx) error
- func (mc *MemberController) Unfollow(c *fiber.Ctx) error
- func (mc *MemberController) Update(c *fiber.Ctx) (err error)
- func (mc *MemberController) UpdatePrefs(c *fiber.Ctx) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMemberController ¶
type IMemberController interface { GetMember(c *fiber.Ctx) error UpdateMember(c *fiber.Ctx) error DeleteMember(c *fiber.Ctx) error }
IMemberController is the interface for the member controller It defines the methods that the member controller must implement This is useful for mocking the member controller in unit tests
type MemberController ¶
type MemberController struct {
// contains filtered or unexported fields
}
MemberController is the controller for member endpoints
func NewController ¶
func (*MemberController) AcceptFollow ¶ added in v0.9.0
func (mc *MemberController) AcceptFollow(c *fiber.Ctx) error
@Summary Accept a follow request @Description Accept a follow request @Param Authorization header string true "The accepter's JWT" @Param id body int64 true "The ID of the follow request" @Accept json @Success 200 {object} h.ResponseHTTP{} @Failure 400 {object} h.ResponseHTTP{} @Failure 401 {object} h.ResponseHTTP{} @Failure 404 {object} h.ResponseHTTP{} @Failure 500 {object} h.ResponseHTTP{} @Router /members/follow/requests/in/{id} [put]
func (*MemberController) Ban ¶ added in v0.9.0
func (mc *MemberController) Ban(c *fiber.Ctx) error
@Summary Ban user @Description issues a ban to a user with the given UUID @Tags members,accounts,administration @Accept json @Produce json @Param uuid path string true "UUID of the member to ban" @Param input body member.BanInput true "Ban details" @Param X-CSRF-Token header string true "X-CSRF-Token header" @Success 200 {object} h.ResponseHTTP{} @Failure 400 {object} h.ResponseHTTP{} @Failure 400 {object} h.ResponseHTTP{} @Failure 500 {object} h.ResponseHTTP{} @Router /members/{uuid}/ban [post]
func (*MemberController) CancelFollowRequest ¶ added in v0.9.0
func (mc *MemberController) CancelFollowRequest(c *fiber.Ctx) error
@Summary Cancel a follow request @Description Cancel a sent follow request if it's pending @Param Authorization header string true "The requester's JWT" @Param X-CSRF-Token header string true "The CSRF token" @Param id path int64 true "The ID of the follow request" @Accept json @Success 200 {object} h.ResponseHTTP{} @Failure 400 {object} h.ResponseHTTP{} @Failure 401 {object} h.ResponseHTTP{} @Failure 404 {object} h.ResponseHTTP{} @Failure 500 {object} h.ResponseHTTP{} @Router /members/follow/requests/out/{id} [delete]
func (*MemberController) Check ¶ added in v0.7.0
func (mc *MemberController) Check(c *fiber.Ctx) error
check checks for the existence of a member it requires both nickname and email to be provided
func (*MemberController) Export ¶ added in v0.9.9
func (mc *MemberController) Export(c *fiber.Ctx) error
@Summary Export all of the member's data @Description Exports the data of a member, including profile information as well as other related data such as reviews @Tags accounts,members,metadata @Accept json @Produce json text/csv @Param Authorization header string true "JWT access token" @Param format path string true "Export format" Enums(json, csv) @Router /members/export/{format} [get]
func (*MemberController) Follow ¶ added in v0.9.0
func (mc *MemberController) Follow(c *fiber.Ctx) error
@Summary Send a follow request to a member (user) @Description Send a follow request to another user. If the user has automatic follow request acceptance @Description enabled, the follow request will be accepted immediately. @Param Authorization header string true "The requester's JWT. Contains encrypted claims to the webfinger" @Param followee body string true "The webfinger of the member to follow" @Param notify body bool false "Receive notifications for all content created by the followee" @Param reblogs body bool true "Show this account's reblogs in home timeline" @Accept json @Success 200 {object} h.ResponseHTTP{data=member.FollowResponse} @Success 204 {object} h.ResponseHTTP{} "When the followee is already followed" @Failure 400 {object} h.ResponseHTTP{} @Failure 401 {object} h.ResponseHTTP{} @Failure 404 {object} h.ResponseHTTP{} @Failure 403 {object} h.ResponseHTTP{} "When at least one party blocks the other" @Failure 500 {object} h.ResponseHTTP{} @Router /members/follow [post]
func (*MemberController) FollowStatus ¶ added in v0.9.0
func (mc *MemberController) FollowStatus(c *fiber.Ctx) error
@Summary Check if a member is followed @Description Check if a member is followed by the request initiator @Param Authorization header string true "The follower's JWT" @Param followee_webfinger path string true "The webfinger of the member to check" @Accept json @Produce json @Success 200 {object} h.ResponseHTTP{data=member.FollowResponse} @Failure 400 {object} h.ResponseHTTP{} @Failure 401 {object} h.ResponseHTTP{} @Failure 404 {object} h.ResponseHTTP{} @Failure 500 {object} h.ResponseHTTP{} @Router /members/follow/status/{followee_webfinger} [get]
func (*MemberController) GetFollowRequests ¶ added in v0.9.0
func (mc *MemberController) GetFollowRequests(c *fiber.Ctx) error
@Summary Get follow requests @Description Get own received follow requests or sent follow requests @Param Authorization header string true "The JWT of the member. Contains encrypted claims to webfinger" @Param type path string true "Which follow requests should be looked up" Enums(sent, received, all) @Accept json @Success 200 {object} h.ResponseHTTP{data=[]int64} @Failure 400 {object} h.ResponseHTTP{} @Failure 401 {object} h.ResponseHTTP{} @Failure 404 {object} h.ResponseHTTP{} @Failure 500 {object} h.ResponseHTTP{} @Router /members/follow/requests [get]
func (*MemberController) GetFollowers ¶
func (mc *MemberController) GetFollowers(c *fiber.Ctx) error
func (*MemberController) GetID ¶ added in v0.6.5
func (mc *MemberController) GetID(c *fiber.Ctx) error
func (*MemberController) GetMemberByNickOrEmail ¶ added in v0.7.0
func (mc *MemberController) GetMemberByNickOrEmail(c *fiber.Ctx) error
@Summary Get a member (user) by nickname or email @Description Retrieve the information the requester is allowed to see about a member @Tags accounts,interactions,metadata @Param email_or_username path string true "The nickname or email of the member to get" @Accept json application/activity+json @Success 200 {object} h.ResponseHTTP{data=member.Member} @Failure 401 {object} h.ResponseHTTP{} "When certain access prerequisites are not met, e.g. a follower's only-visible metadata is requested" @Failure 404 {object} h.ResponseHTTP{} @Failure 500 {object} h.ResponseHTTP{} @Router /members/{email_or_username}/info [get]
func (*MemberController) GetMemberByWebfinger ¶ added in v0.6.5
func (mc *MemberController) GetMemberByWebfinger(c *fiber.Ctx) error
func (*MemberController) RejectFollow ¶ added in v0.9.0
func (mc *MemberController) RejectFollow(c *fiber.Ctx) error
@Summary Reject a follow request @Description Reject a follow request @Param Authorization header string true "The rejecter's JWT" @Param follower body string true "The webfinger of the member who requested to follow" @Param id path int64 true "The ID of the follow request" @Accept json @Success 200 {object} h.ResponseHTTP{} @Failure 400 {object} h.ResponseHTTP{} @Failure 401 {object} h.ResponseHTTP{} @Failure 404 {object} h.ResponseHTTP{} @Failure 500 {object} h.ResponseHTTP{} @Router /members/follow/requests/in/{id} [delete]
func (*MemberController) Unban ¶ added in v0.9.0
func (mc *MemberController) Unban(c *fiber.Ctx) error
@Summary Unban user @Description removes a ban from a user with the given UUID @Tags members,accounts,administration @Accept json @Produce json @Param uuid path string true "UUID of the member to unban" @Param X-CSRF-Token header string true "X-CSRF-Token header" @Success 200 {object} h.ResponseHTTP{} @Success 202 {object} h.ResponseHTTP{} "When " @Failure 400 {object} h.ResponseHTTP{} @Failure 401 {object} h.ResponseHTTP{} @Failure 500 {object} h.ResponseHTTP{} @Router /members/{uuid}/ban [delete]
func (*MemberController) Unfollow ¶ added in v0.9.0
func (mc *MemberController) Unfollow(c *fiber.Ctx) error
@Summary Unfollow a member @Description Unfollow a member or remove follower @Param Authorization header string true "The follower's JWT" @Param target body string true "The webfinger of the member to unfollow" @Accept json @Success 200 {object} h.ResponseHTTP{} @Failure 400 {object} h.ResponseHTTP{} @Failure 401 {object} h.ResponseHTTP{} @Failure 404 {object} h.ResponseHTTP{} @Failure 500 {object} h.ResponseHTTP{} @Router /members/follow [delete]
func (*MemberController) Update ¶ added in v0.7.3
func (mc *MemberController) Update(c *fiber.Ctx) (err error)
UpdateMember handles the updating of user information @Summary Update member information @Tags accounts,metadata,updating @Description Handle updating those member properties that can be exposed publicly, i.e. not settings @Accept multipart/form-data json @Param member_name path string true "The nickname of the member being updated" @Param Authorization header string true "The JWT token" @Param X-CSRF-Token header string true "CSRF token" @Param profile_pic_id query int64 false "ID of the picture that is returned after making a request to /api/upload/image" @Success 200 {object} h.ResponseHTTP{} @Failure 400 {object} h.ResponseHTTP{} @Failure 500 {object} h.ResponseHTTP{} @Router /update/{member_name} [patch]
func (*MemberController) UpdatePrefs ¶ added in v0.9.0
func (mc *MemberController) UpdatePrefs(c *fiber.Ctx) error
UpdatePrefs handles the updating of user preferences @Summary Update member preferences @Description Handle updating private member preferences @Tags accounts,updating,settings @Accept json multipart/form-data @Param member_name path string true "The nickname of the member being updated" @Param Authorization header string true "The JWT token" @Param X-CSRF-Token header string true "CSRF token" @Param locale formData string false "The ISO 639-1 locale to use" @Param rating_scale_lower formData int16 false "The lower bound of the rating scale" minimum(0) maximum(100) @Param rating_scale_upper formData int16 false "The upper bound of the rating scale" minimum(2) maximum(100) @Param message_autohide_words formData []string false "A comma-separated list of words to autohide in messages" @Param muted_instances formData []string false "A comma-separated list of instance domains to mute" @Param auto_accept_follow formData bool false "Whether to automatically accept follow requests" @Param locally_searchable formData bool false "Whether to allow local searches" @Param federated_searchable formData bool false "Whether to allow federated searches" @Param robots_searchable formData bool false "Whether to allow robots to index the profile" @Success 200 {object} h.ResponseHTTP{} @Failure 400 {object} h.ResponseHTTP{} @Failure 500 {object} h.ResponseHTTP{} @Router /update/{member_name}/preferences [patch]