notification

package
v0.5.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IDKey is for notification UUIDs
	IDKey = "id"
	// BasePath is the base path for serving the notification API
	BasePath = "/api/v1/notifications"
	// BasePathWithID is just the base path with the ID key in it.
	// Use this anywhere you need to know the ID of the notification being queried.
	BasePathWithID    = BasePath + "/:" + IDKey
	BasePathWithClear = BasePath + "/clear"

	// ExcludeTypes is an array specifying notification types to exclude
	ExcludeTypesKey = "exclude_types[]"
	// MaxIDKey is the url query for setting a max notification ID to return
	MaxIDKey = "max_id"
	// LimitKey is for specifying maximum number of notifications to return.
	LimitKey = "limit"
	// SinceIDKey is for specifying the minimum notification ID to return.
	SinceIDKey = "since_id"
)

Variables

This section is empty.

Functions

func New

func New(processor processing.Processor) api.ClientModule

New returns a new notification 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 notifications

func (*Module) NotificationsClearPOSTHandler added in v0.4.0

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

NotificationsClearPOSTHandler clears all the notifications

func (*Module) NotificationsGETHandler

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

NotificationsGETHandler swagger:operation GET /api/v1/notifications notifications

Get notifications for currently authorized user.

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

--- tags: - notifications

produces: - application/json

parameters:

  • name: limit type: integer description: Number of notifications to return. default: 20 in: query required: false
  • name: exclude_types type: array items: type: string description: Array of types of notifications to exclude (follow, favourite, reblog, mention, poll, follow_request) in: query required: false
  • name: max_id type: string description: |- Return only notifications *OLDER* than the given max status ID. The status with the specified ID will not be included in the response. in: query required: false
  • name: since_id type: string description: |- Return only notifications *NEWER* than the given since status ID. The status with the specified ID will not be included in the response. in: query required: false

security: - OAuth2 Bearer:

  • read:notifications

responses:

'200':
  name: notifications
  description: Array of notifications.
  schema:
    type: array
    items:
      "$ref": "#/definitions/notification"
'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(r router.Router) error

Route attaches all routes from this module to the given router

Jump to

Keyboard shortcuts

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