Documentation
¶
Index ¶
- type FollowersRequest
- type FollowingRequest
- type InstancesRequest
- type Service
- func (s *Service) Followers(request FollowersRequest) ([]models.FollowStatus, error)
- func (s *Service) Following(request FollowingRequest) ([]models.FollowStatus, error)
- func (s *Service) Instances(request InstancesRequest) ([]models.Instance, error)
- func (s *Service) ShowInstance(request ShowInstanceRequest) (models.Instance, error)
- func (s *Service) Users(request UsersRequest) ([]models.User, error)
- type ShowInstanceRequest
- type UsersRequest
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FollowersRequest ¶
type FollowersRequest struct { Host string `json:"host"` SinceID string `json:"sinceId"` UntilID string `json:"untilId"` Limit uint `json:"limit"` }
FollowersRequest contains request information to obtain followers.
type FollowingRequest ¶
type FollowingRequest struct { Host string `json:"host"` SinceID string `json:"sinceId"` UntilID string `json:"untilId"` Limit uint `json:"limit"` }
FollowingRequest contains request information to obtain followees.
type InstancesRequest ¶
type InstancesRequest struct { Host string `json:"host"` Blocked bool `json:"blocked"` NotResponding bool `json:"notResponding"` Suspended bool `json:"suspended"` Federating bool `json:"federating"` Subscribing bool `json:"subscribing"` Publishing bool `json:"publishing"` Limit uint `json:"limit"` Offset uint64 `json:"offset"` Sort string `json:"sort"` }
InstancesRequest contains request information to obtain instances.
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) Followers ¶
func (s *Service) Followers(request FollowersRequest) ([]models.FollowStatus, error)
Followers lists all followers.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) resp, err := client.Federation().Followers(federation.FollowersRequest{ Limit: 40, Host: "slippy.xyz", }) if err != nil { log.Printf("[Federation/Followers] %s", err) return } log.Printf("[Federation/Followers] %v listed", resp)
Output:
func (*Service) Following ¶
func (s *Service) Following(request FollowingRequest) ([]models.FollowStatus, error)
Following lists all followings.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) resp, err := client.Federation().Following(federation.FollowingRequest{ Limit: 100, Host: "slippy.xyz", }) if err != nil { log.Printf("[Federation/Following] %s", err) return } log.Printf("[Federation/Following] %v listed", resp)
Output:
func (*Service) Instances ¶
func (s *Service) Instances(request InstancesRequest) ([]models.Instance, error)
Instances will list all instances and information about the instances for a given host.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) resp, err := client.Federation().Instances(federation.InstancesRequest{ Limit: 90, Host: "slippy.xyz", }) if err != nil { log.Printf("[Federation/Instances] %s", err) return } log.Printf("[Federation/Instances] %v listed", resp)
Output:
func (*Service) ShowInstance ¶
func (s *Service) ShowInstance(request ShowInstanceRequest) (models.Instance, error)
ShowInstance returns a single instance given a host.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) resp, err := client.Federation().ShowInstance(federation.ShowInstanceRequest{ Host: "slippy.xyz", }) if err != nil { log.Printf("[Federation/ShowInstance] %s", err) return } log.Printf("[Federation/ShowInstance] %v listed", resp)
Output:
func (*Service) Users ¶
func (s *Service) Users(request UsersRequest) ([]models.User, error)
Users will list all users for a federation with a given host.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) resp, err := client.Federation().Users(federation.UsersRequest{ Limit: 90, Host: "misskey.io", }) if err != nil { log.Printf("[Federation/Users] %s", err) return } log.Printf("[Federation/Users] %v listed", resp)
Output:
type ShowInstanceRequest ¶
type ShowInstanceRequest struct {
Host string `json:"host"`
}
ShowInstanceRequest contains request information to obtain a single instance.
func (ShowInstanceRequest) Validate ¶
func (r ShowInstanceRequest) Validate() error
Validate the request.