drive

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 CleanRemoteRequest

type CleanRemoteRequest struct{}

CleanRemoteRequest represents a CleanRemote request.

func (CleanRemoteRequest) Validate

func (r CleanRemoteRequest) Validate() error

Validate the request.

type CleanRequest

type CleanRequest struct{}

CleanRequest represents a Clean request.

func (CleanRequest) Validate

func (r CleanRequest) Validate() error

Validate the request.

type FilesRequest

type FilesRequest struct {
	Limit    uint              `json:"limit,omitempty"`
	SinceID  string            `json:"sinceId,omitempty"`
	UntilID  string            `json:"untilId,omitempty"`
	Type     core.String       `json:"type,omitempty"`
	Origin   models.UserOrigin `json:"origin,omitempty"`
	Hostname core.String       `json:"hostname,omitempty"`
}

FilesRequest represents a Files request.

func (FilesRequest) Validate

func (r FilesRequest) 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) Clean

func (s *Service) Clean() error

Clean local drive.

Example
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))

err := client.Admin().Drive().Clean()
if err != nil {
	log.Printf("[Admin/Drive/Clean] %s", err)

	return
}
Output:

func (*Service) CleanRemote

func (s *Service) CleanRemote() error

CleanRemote drive.

Example
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))

err := client.Admin().Drive().CleanRemote()
if err != nil {
	log.Printf("[Admin/Drive/CleanRemote] %s", err)

	return
}
Output:

func (*Service) Files

func (s *Service) Files(request FilesRequest) ([]models.File, error)

Files lists all emojies.

Example
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))

response, err := client.Admin().Drive().Files(drive.FilesRequest{})
if err != nil {
	log.Printf("[Admin/Drive/Files] %s", err)

	return
}

for _, item := range response {
	log.Printf("[Admin/Drive/Files] %s", item.URL)
}
Output:

func (*Service) Show

func (s *Service) Show(request ShowRequest) (models.File, error)

Show a file.

Example
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))

response, err := client.Admin().Drive().Show(drive.ShowRequest{})
if err != nil {
	log.Printf("[Admin/Drive/Show] %s", err)

	return
}

log.Printf("[Admin/Drive/Show] %s", response.URL)
Output:

type ShowRequest

type ShowRequest struct {
	FileID string `json:"fileId,omitempty"`
	URL    string `json:"url,omitempty"`
}

ShowRequest represents a Show request.

func (ShowRequest) Validate

func (r ShowRequest) Validate() error

Validate the request.

Jump to

Keyboard shortcuts

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