favorites

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 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 {
	NoteID string `json:"noteId"`
}

CreateRequest represents an Create request.

func (CreateRequest) Validate

func (r CreateRequest) Validate() error

Validate the request.

type DeleteRequest

type DeleteRequest struct {
	NoteID string `json:"noteId"`
}

DeleteRequest represents an Delete request.

func (DeleteRequest) Validate

func (r DeleteRequest) 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(noteID string) error

Create endpoint.

Example
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))
client.LogLevel(logrus.DebugLevel)

err := client.Notes().Favorites().Create("noteid")
if err != nil {
	log.Printf("[Notes] Error happened: %s", err)

	return
}
Output:

func (*Service) Delete

func (s *Service) Delete(noteID string) error

Delete endpoint.

Example
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))
client.LogLevel(logrus.DebugLevel)

err := client.Notes().Favorites().Delete("noteid")
if err != nil {
	log.Printf("[Notes] Error happened: %s", err)

	return
}
Output:

Jump to

Keyboard shortcuts

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