Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptRequest ¶
type AcceptRequest struct {
UserID string `json:"userId"`
}
AcceptRequest is the request structure to accept a following request.
type CancelRequest ¶
type CancelRequest struct {
UserID string `json:"userId"`
}
CancelRequest is the request structure to cancel a following request.
type ListRequest ¶
type ListRequest struct{}
ListRequest is the request structure to list following requests.
type ListResponse ¶
type ListResponse struct {
ID string `json:"id"`
Follower models.User `json:"follower"`
Followee models.User `json:"followee"`
}
ListResponse is the response from the list following requests endpoint.
type RejectRequest ¶
type RejectRequest struct {
UserID string `json:"userId"`
}
RejectRequest is the request structure to reject a following 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) Accept ¶
Accept following endpoint.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))
err := client.Following().Requests().Accept("88v9vu5nbu")
if err != nil {
log.Printf("[Following/Requests/Accept] %s", err)
return
}
log.Println("[Following/Requests/Accept] Accepted")
func (*Service) Cancel ¶
Cancel following endpoint.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))
user, err := client.Following().Requests().Cancel("88v9vu5nbu")
if err != nil {
log.Printf("[Following/Requests/Cancel] %s", err)
return
}
log.Printf("[Following/Requests/Cancel] Canceled: %s", user.ID)
func (*Service) List ¶
func (s *Service) List() ([]ListResponse, error)
List following requests endpoint.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))
list, err := client.Following().Requests().List()
if err != nil {
log.Printf("[Following/Requests/List] %s", err)
return
}
for _, item := range list {
log.Printf(
"[Following/Requests/List] %s -> %s",
item.Follower.Username,
item.Followee.Username,
)
}
func (*Service) Reject ¶
Reject following request endpoint.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))
err := client.Following().Requests().Reject("88v9vu5nbu")
if err != nil {
log.Printf("[Following/Requests/Reject] %s", err)
return
}
log.Println("[Following/Requests/Reject] Rejected")
Click to show internal directories.
Click to hide internal directories.