notifications

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	Body   string      `json:"body"`
	Header core.String `json:"header"`
	Icon   core.String `json:"icon"`
}

CreateRequest represents an Create request.

func (CreateRequest) Validate

func (r CreateRequest) Validate() error

Validate the request.

type MarkAllAsReadRequest

type MarkAllAsReadRequest struct{}

MarkAllAsReadRequest represents an MarkAllAsRead request.

func (MarkAllAsReadRequest) Validate

func (r MarkAllAsReadRequest) Validate() error

Validate the request.

type Service

type Service struct {
	Call core.RequestHandlerFunc
}

Service is the base for all the endpoints on this service.

func NewService

func NewService(requestHandler core.RequestHandlerFunc) *Service

NewService creates a new Service instance.

func (*Service) Create

func (s *Service) Create(request CreateRequest) error

Create endpoint.

Example
client := misskey.NewClient("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))

err := client.Notifications().Create(notifications.CreateRequest{
	Header: core.NewString("Thi is the header"),
	Body:   "Example notification",
})
if err != nil {
	log.Printf("[Notifications] Error happened: %s", err)

	return
}
Output:

func (*Service) MarkAllAsRead

func (s *Service) MarkAllAsRead() error

MarkAllAsRead endpoint.

Example
client := misskey.NewClient("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))

err := client.Notifications().MarkAllAsRead()
if err != nil {
	log.Printf("[Notifications] Error happened: %s", err)

	return
}
Output:

Jump to

Keyboard shortcuts

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