groups

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: 3 Imported by: 0

Documentation

Index

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.

func (CreateRequest) Validate

func (r CreateRequest) Validate() error

Validate the request.

type DeleteRequest

type DeleteRequest struct {
	GroupID string `json:"groupId"`
}

DeleteRequest represents an Delete request.

func (DeleteRequest) Validate

func (r DeleteRequest) Validate() error

Validate the request.

type InviteRequest

type InviteRequest struct {
	GroupID string `json:"groupId"`
	UserID  string `json:"userId"`
}

InviteRequest represents an Invite request.

func (InviteRequest) Validate

func (r InviteRequest) Validate() error

Validate the request.

type JoinedRequest

type JoinedRequest struct{}

JoinedRequest represents an List request.

func (JoinedRequest) Validate

func (r JoinedRequest) Validate() error

Validate the request.

type KickRequest

type KickRequest struct {
	GroupID string `json:"groupId"`
	UserID  string `json:"userId"`
}

KickRequest represents an Kick request.

func (KickRequest) Validate

func (r KickRequest) Validate() error

Validate the request.

type LeaveRequest

type LeaveRequest struct {
	GroupID string `json:"groupId"`
}

LeaveRequest represents an Leave request.

func (LeaveRequest) Validate

func (r LeaveRequest) Validate() error

Validate the request.

type OwnedRequest

type OwnedRequest struct{}

OwnedRequest represents an List request.

func (OwnedRequest) Validate

func (r OwnedRequest) 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) Create

func (s *Service) Create(name string) (models.Group, error)

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

func (s *Service) Delete(groupID string) error

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

func (s *Service) Invite(groupID, userID string) error

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

func (s *Service) Joined() ([]models.Group, error)

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

func (s *Service) Kick(groupID, userID string) error

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

func (s *Service) Leave(groupID string) error

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

func (s *Service) Owned() ([]models.Group, error)

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

func (s *Service) Show(groupID string) (models.Group, error)

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

func (s *Service) Transfer(groupID, userID string) (models.Group, error)

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

func (s *Service) Update(groupID, name string) (models.Group, error)

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.

func (ShowRequest) Validate

func (r ShowRequest) Validate() error

Validate the request.

type TransferRequest

type TransferRequest struct {
	GroupID string `json:"groupId"`
	UserID  string `json:"userId"`
}

TransferRequest represents an Transfer request.

func (TransferRequest) Validate

func (r TransferRequest) Validate() error

Validate the request.

type UpdateRequest

type UpdateRequest struct {
	GroupID string `json:"groupId"`
	Name    string `json:"name"`
}

UpdateRequest represents an Update request.

func (UpdateRequest) Validate

func (r UpdateRequest) Validate() error

Validate the request.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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