timeline

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

Documentation

Index

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.

func (GetRequest) Validate

func (r GetRequest) Validate() error

Validate the 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.

func (GlobalRequest) Validate

func (r GlobalRequest) Validate() error

Validate the 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.

func (HybridRequest) Validate

func (r HybridRequest) Validate() error

Validate the 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.

func (LocalRequest) Validate

func (r LocalRequest) 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) 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.

func (UserListRequest) Validate

func (r UserListRequest) Validate() error

Validate the request.

Jump to

Keyboard shortcuts

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