Documentation
¶
Index ¶
Examples ¶
Constants ¶
View Source
const (
// MaximumNameLength is the maximum length of the name of the clip.
MaximumNameLength = 100
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateRequest ¶
type CreateRequest struct {
Name string `json:"name"`
}
CreateRequest represents a Create 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(request CreateRequest) (models.Clip, error)
Create clip.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) clip, err := client.Clips().Create(clips.CreateRequest{ Name: "test clip", }) if err != nil { log.Printf("[Clips/Create] %s", err) return } log.Printf("[Clips/Create] %s created", clip.Name)
Output:
func (*Service) List ¶
List clips.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) clips, err := client.Clips().List() if err != nil { log.Printf("[Clips/List] %s", err) return } for _, clip := range clips { log.Printf("[Clips/List] %s", clip.Name) }
Output:
func (*Service) Show ¶
func (s *Service) Show(request ShowRequest) (models.Clip, error)
Show clips.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) clip, err := client.Clips().Show(clips.ShowRequest{ ClipID: "8drxu3ckca", }) if err != nil { log.Printf("[Clips/Show] %s", err) return } log.Printf("[Clips/Show] %s", clip.Name)
Output:
func (*Service) Update ¶
func (s *Service) Update(request UpdateRequest) (models.Clip, error)
Update clip.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) clip, err := client.Clips().Update(clips.UpdateRequest{ ClipID: "8drxu3ckca", Name: "new test", }) if err != nil { log.Printf("[Clips/Update] %s", err) return } log.Printf("[Clips/Update] %s updated", clip.Name)
Output:
type ShowRequest ¶
type ShowRequest struct {
ClipID string `json:"clipId"`
}
ShowRequest represents an Show request.
type UpdateRequest ¶
UpdateRequest represents a Update request.
Click to show internal directories.
Click to hide internal directories.