polls

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 RecommendationRequest

type RecommendationRequest struct {
	Limit  uint   `json:"limit"`
	Offset uint64 `json:"offset"`
}

RecommendationRequest represents an Recommendation request.

func (RecommendationRequest) Validate

func (r RecommendationRequest) 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) Recommendation

func (s *Service) Recommendation(request RecommendationRequest) error

Recommendation endpoint.

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

err := client.Notes().Polls().Recommendation(polls.RecommendationRequest{
	Limit: 10,
})
if err != nil {
	log.Printf("[Notes] Error happened: %s", err)

	return
}
Output:

func (*Service) Vote

func (s *Service) Vote(noteID string, choice int) error

Vote endpoint.

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

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

	return
}
Output:

type VoteRequest

type VoteRequest struct {
	NoteID string `json:"noteId"`
	Choice int    `json:"choice"`
}

VoteRequest represents an Vote request.

func (VoteRequest) Validate

func (r VoteRequest) Validate() error

Validate the request.

Jump to

Keyboard shortcuts

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