Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobsRequest ¶
type JobsRequest struct {
Domain Domain `json:"domain"`
State State `json:"state"`
Limit uint `json:"limit,omitempty"`
}
JobsRequest represents an Jobs 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) Clear ¶
Clear all queues.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))
err := client.Admin().Queue().Clear()
if err != nil {
log.Printf("[Admin/Queue] %s", err)
}
func (*Service) DeliverDelayed ¶
DeliverDelayed lists delayed deliver hosts with count.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))
response, err := client.Admin().Queue().DeliverDelayed()
if err != nil {
log.Printf("[Admin/Queue] %s", err)
return
}
for _, item := range response {
log.Printf("%s => %d", item.Host, item.Count)
}
func (*Service) InboxDelayed ¶
InboxDelayed lists delayed inbox hosts with count.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))
response, err := client.Admin().Queue().InboxDelayed()
if err != nil {
log.Printf("[Admin/Queue] %s", err)
return
}
for _, item := range response {
log.Printf("%s => %d", item.Host, item.Count)
}
func (*Service) Jobs ¶
func (s *Service) Jobs(request JobsRequest) ([]models.Job, error)
Jobs lists all jobs in a queue with state.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))
response, err := client.Admin().Queue().Jobs(queue.JobsRequest{})
if err != nil {
log.Printf("[Admin/Queue] %s", err)
return
}
for _, item := range response {
log.Printf("[Admin/Queue] Attempts: %d/%d", item.Attempts, item.MaxAttempts)
}
func (*Service) Stats ¶
func (s *Service) Stats() (models.QueueStats, error)
Stats shows all queues with stats.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))
response, err := client.Admin().Queue().Stats()
if err != nil {
log.Printf("[Admin/Queue] %s", err)
return
}
log.Printf("Deliver :: Waiting = %d", response.Deliver.Waiting)
Click to show internal directories.
Click to hide internal directories.