Documentation ¶
Index ¶
- type GetRequest
- type GlobalRequest
- type HybridRequest
- type LocalRequest
- type Service
- func (s *Service) Get(request GetRequest) ([]models.Note, error)
- func (s *Service) Global(request GlobalRequest) ([]models.Note, error)
- func (s *Service) Hybrid(request HybridRequest) ([]models.Note, error)
- func (s *Service) Local(request LocalRequest) ([]models.Note, error)
- func (s *Service) UserList(request UserListRequest) ([]models.Note, error)
- type UserListRequest
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetRequest ¶
type GetRequest struct { Limit uint `json:"limit"` SinceID string `json:"sinceId"` UntilID string `json:"untilId"` SinceDate uint64 `json:"sinceDate"` UntilDate uint64 `json:"untilDate"` IncludeMyRenotes bool `json:"includeMyRenotes"` IncludeRenotedMyNotes bool `json:"includeRenotedMyNotes"` IncludeLocalRenotes bool `json:"includeLocalRenotes"` OnlyWithFiles bool `json:"withFiles"` }
GetRequest represents an Get request.
type GlobalRequest ¶
type GlobalRequest struct { OnlyWithFiles bool `json:"withFiles"` Limit uint `json:"limit"` SinceID string `json:"sinceId,omitempty"` UntilID string `json:"untilId,omitempty"` SinceDate uint64 `json:"sinceDate,omitempty"` UntilDate uint64 `json:"untilDate,omitempty"` }
GlobalRequest represents an Global request.
type HybridRequest ¶
type HybridRequest struct { Limit uint `json:"limit"` SinceID string `json:"sinceId,omitempty"` UntilID string `json:"untilId,omitempty"` SinceDate uint64 `json:"sinceDate,omitempty"` UntilDate uint64 `json:"untilDate,omitempty"` IncludeMyRenotes bool `json:"includeMyRenotes"` IncludeRenotedMyNotes bool `json:"includeRenotedMyNotes"` IncludeLocalRenotes bool `json:"includeLocalRenotes"` OnlyWithFiles bool `json:"withFiles"` }
HybridRequest represents an Hybrid request.
type LocalRequest ¶
type LocalRequest struct { OnlyWithFileType []string `json:"fileType,omitempty"` OnlyWithFiles bool `json:"withFiles"` ExcludeNSFW bool `json:"excludeNsfw"` Limit uint `json:"limit"` SinceID string `json:"sinceId,omitempty"` UntilID string `json:"untilId,omitempty"` SinceDate uint64 `json:"sinceDate,omitempty"` UntilDate uint64 `json:"untilDate,omitempty"` }
LocalRequest represents an Local 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) Get ¶
func (s *Service) Get(request GetRequest) ([]models.Note, error)
Get is the endpoint for /notes/timeline.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) client.LogLevel(logrus.DebugLevel) noteList, err := client.Notes().Timeline().Get(timeline.GetRequest{ Limit: 10, }) if err != nil { log.Printf("[Notes] Error happened: %s", err) return } for _, note := range noteList { log.Printf(" - %s", note.Text) }
Output:
func (*Service) Global ¶
func (s *Service) Global(request GlobalRequest) ([]models.Note, error)
Global is the endpoint for /notes/global-timeline.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) client.LogLevel(logrus.DebugLevel) noteList, err := client.Notes().Timeline().Global(timeline.GlobalRequest{ Limit: 10, }) if err != nil { log.Printf("[Notes] Error happened: %s", err) return } for _, note := range noteList { log.Printf(" - %s", note.Text) }
Output:
func (*Service) Hybrid ¶
func (s *Service) Hybrid(request HybridRequest) ([]models.Note, error)
Hybrid is the endpoint for /notes/hybrid-timeline.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) client.LogLevel(logrus.DebugLevel) noteList, err := client.Notes().Timeline().Hybrid(timeline.HybridRequest{ Limit: 10, }) if err != nil { log.Printf("[Notes] Error happened: %s", err) return } for _, note := range noteList { log.Printf(" - %s", note.Text) }
Output:
func (*Service) Local ¶
func (s *Service) Local(request LocalRequest) ([]models.Note, error)
Local is the endpoint for /notes/local-timeline.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) client.LogLevel(logrus.DebugLevel) noteList, err := client.Notes().Timeline().Local(timeline.LocalRequest{ Limit: 10, }) if err != nil { log.Printf("[Notes] Error happened: %s", err) return } for _, note := range noteList { log.Printf(" - %s", note.Text) }
Output:
func (*Service) UserList ¶
func (s *Service) UserList(request UserListRequest) ([]models.Note, error)
UserList is the endpoint for /notes/user-list-timeline.
Example ¶
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN"))) client.LogLevel(logrus.DebugLevel) noteList, err := client.Notes().Timeline().UserList(timeline.UserListRequest{ Limit: 10, ListID: "listid", }) if err != nil { log.Printf("[Notes] Error happened: %s", err) return } for _, note := range noteList { log.Printf(" - %s", note.Text) }
Output:
type UserListRequest ¶
type UserListRequest struct { ListID string `json:"listId"` Limit uint `json:"limit"` SinceID string `json:"sinceId,omitempty"` UntilID string `json:"untilId,omitempty"` SinceDate uint64 `json:"sinceDate,omitempty"` UntilDate uint64 `json:"untilDate,omitempty"` IncludeMyRenotes bool `json:"includeMyRenotes"` IncludeRenotedMyNotes bool `json:"includeRenotedMyNotes"` IncludeLocalRenotes bool `json:"includeLocalRenotes"` OnlyWithFiles bool `json:"withFiles"` }
UserListRequest represents an UserList request.
Click to show internal directories.
Click to hide internal directories.