Documentation ¶
Index ¶
- type CreateRequest
- type DeleteRequest
- type InviteRequest
- type JoinedRequest
- type KickRequest
- type LeaveRequest
- type OwnedRequest
- type Service
- func (s *Service) Create(name string) (models.Group, error)
- func (s *Service) Delete(groupID string) error
- func (s *Service) Invitations() *invitations.Service
- func (s *Service) Invite(groupID, userID string) error
- func (s *Service) Joined() ([]models.Group, error)
- func (s *Service) Kick(groupID, userID string) error
- func (s *Service) Leave(groupID string) error
- func (s *Service) Owned() ([]models.Group, error)
- func (s *Service) Show(groupID string) (models.Group, error)
- func (s *Service) Transfer(groupID, userID string) (models.Group, error)
- func (s *Service) Update(groupID, name string) (models.Group, error)
- type ShowRequest
- type TransferRequest
- type UpdateRequest
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateRequest ¶
type CreateRequest struct {
Name string `json:"name"`
}
CreateRequest represents an Create request.
type DeleteRequest ¶
type DeleteRequest struct {
GroupID string `json:"groupId"`
}
DeleteRequest represents an Delete request.
type InviteRequest ¶
InviteRequest represents an Invite request.
type KickRequest ¶
KickRequest represents an Kick request.
type LeaveRequest ¶
type LeaveRequest struct {
GroupID string `json:"groupId"`
}
LeaveRequest represents an Leave 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 ¶
Create group.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) group, err := client.Users().Groups().Create("Test") if err != nil { log.Printf("[Users/Groups/Create] %s", err) return } log.Printf("[Users/Groups/Create] %s", group.Name)
Output:
func (*Service) Delete ¶
Delete group.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) err := client.Users().Groups().Delete("8y4nlhyx3v") if err != nil { log.Printf("[Users/Groups/Delete] %s", err) return }
Output:
func (*Service) Invitations ¶
func (s *Service) Invitations() *invitations.Service
Invitations contains all endpoints about group invitations.
func (*Service) Invite ¶
Invite group.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) err := client.Users().Groups().Invite("93tyd132e7", "83sv4lyx22") if err != nil { log.Printf("[Users/Groups/Invite] %s", err) return }
Output:
func (*Service) Joined ¶
Joined clips.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) resp, err := client.Users().Groups().Joined() if err != nil { log.Printf("[Users/Groups/Joined] %s", err) return } for _, group := range resp { log.Printf("[Users/Groups/Joined] %s", group.Name) }
Output:
func (*Service) Kick ¶
Kick group.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) err := client.Users().Groups().Kick("93tyd132e7", "83sv4lyx22") if err != nil { log.Printf("[Users/Groups/Kick] %s", err) return }
Output:
func (*Service) Leave ¶
Leave group.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) err := client.Users().Groups().Leave("93tyd132e7") if err != nil { log.Printf("[Users/Groups/Leave] %s", err) return }
Output:
func (*Service) Owned ¶
Owned clips.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) resp, err := client.Users().Groups().Owned() if err != nil { log.Printf("[Users/Groups/Owned] %s", err) return } for _, group := range resp { log.Printf("[Users/Groups/Owned] %s", group.Name) }
Output:
func (*Service) Show ¶
Show group.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) group, err := client.Users().Groups().Show("93tyd132e7") if err != nil { log.Printf("[Users/Groups/Show] %s", err) return } log.Printf("[Users/Groups/Show] %s", group.Name)
Output:
func (*Service) Transfer ¶
Transfer group.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) group, err := client.Users().Groups().Transfer("93tyd132e7", "83sv4lyx22") if err != nil { log.Printf("[Users/Groups/Transfer] %s", err) return } log.Printf("[Users/Groups/Transfer] %s", group.Name)
Output:
func (*Service) Update ¶
Update group.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) group, err := client.Users().Groups().Update("93tyd132e7", "New Name") if err != nil { log.Printf("[Users/Groups/Update] %s", err) return } log.Printf("[Users/Groups/Update] %s", group.Name)
Output:
type ShowRequest ¶
type ShowRequest struct {
GroupID string `json:"groupId"`
}
ShowRequest represents an Show request.
type TransferRequest ¶
TransferRequest represents an Transfer request.
type UpdateRequest ¶
UpdateRequest represents an Update request.