api

package
v1.66.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 0 Imported by: 2

Documentation

Overview

Package api provides types used by the Seafile API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInfo

type AccountInfo struct {
	Usage int64  `json:"usage"`
	Total int64  `json:"total"`
	Email string `json:"email"`
	Name  string `json:"name"`
}

AccountInfo contains simple user properties

type AuthenticationRequest

type AuthenticationRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

AuthenticationRequest contains user credentials

type AuthenticationResult

type AuthenticationResult struct {
	Token  string   `json:"token"`
	Errors []string `json:"non_field_errors"`
}

AuthenticationResult is returned by a call to the authentication api

type BatchSourceDestRequest

type BatchSourceDestRequest struct {
	SrcLibraryID string   `json:"src_repo_id"`
	SrcParentDir string   `json:"src_parent_dir"`
	SrcItems     []string `json:"src_dirents"`
	DstLibraryID string   `json:"dst_repo_id"`
	DstParentDir string   `json:"dst_parent_dir"`
}

BatchSourceDestRequest contains JSON parameters for sending a batch copy or move operation

type CreateDirRequest

type CreateDirRequest struct {
	Operation string `json:"operation"`
}

CreateDirRequest only contain an operation field

type CreateLibrary

type CreateLibrary struct {
	ID   string `json:"repo_id"`
	Name string `json:"repo_name"`
}

CreateLibrary properties. Seafile is not consistent and returns different types for different API calls

type CreateLibraryRequest

type CreateLibraryRequest struct {
	Name        string `json:"name"`
	Description string `json:"desc"`
	Password    string `json:"passwd"`
}

CreateLibraryRequest contains the information needed to create a library

type DefaultLibrary

type DefaultLibrary struct {
	ID     string `json:"repo_id"`
	Exists bool   `json:"exists"`
}

DefaultLibrary when none specified

type DirEntries

type DirEntries struct {
	Entries []DirEntry `json:"dirent_list"`
}

DirEntries contains a list of DirEntry

type DirEntry

type DirEntry struct {
	ID       string   `json:"id"`
	Type     FileType `json:"type"`
	Name     string   `json:"name"`
	Size     int64    `json:"size"`
	Path     string   `json:"parent_dir"`
	Modified int64    `json:"mtime"`
}

DirEntry contains a directory entry

type DirectoryDetail

type DirectoryDetail struct {
	ID   string `json:"repo_id"`
	Name string `json:"name"`
	Path string `json:"path"`
}

DirectoryDetail contains the directory details specific to the getDirectoryDetails call

type FileDetail

type FileDetail struct {
	ID       string   `json:"id"`
	Type     FileType `json:"type"`
	Name     string   `json:"name"`
	Size     int64    `json:"size"`
	Parent   string   `json:"parent_dir"`
	Modified string   `json:"last_modified"`
}

FileDetail contains file properties (for older api v2.0)

type FileInfo

type FileInfo struct {
	Type      string `json:"type"`
	LibraryID string `json:"repo_id"`
	Path      string `json:"parent_dir"`
	Name      string `json:"obj_name"`
	ID        string `json:"obj_id"`
	Size      int64  `json:"size"`
}

FileInfo is returned by a server file copy/move/rename (new api v2.1)

type FileOperationRequest

type FileOperationRequest struct {
	Operation            Operation `json:"operation"`
	DestinationLibraryID string    `json:"dst_repo"` // For copy/move operation
	DestinationPath      string    `json:"dst_dir"`  // For copy/move operation
	NewName              string    `json:"newname"`  // Only to be used by the rename operation
}

FileOperationRequest is sent to the api to copy, move or rename a file

type FileType

type FileType string

FileType is either "dir" or "file"

var (
	FileTypeDir  FileType = "dir"
	FileTypeFile FileType = "file"
)

File types

type Library

type Library struct {
	Encrypted bool   `json:"encrypted"`
	Owner     string `json:"owner"`
	ID        string `json:"id"`
	Size      int64  `json:"size"`
	Name      string `json:"name"`
	Modified  int64  `json:"mtime"`
}

Library properties. Please note not all properties are going to be useful for rclone

type Operation

type Operation string

Operation is move, copy or rename

var (
	CopyFileOperation   Operation = "copy"
	MoveFileOperation   Operation = "move"
	RenameFileOperation Operation = "rename"
)

Operations

type ServerInfo

type ServerInfo struct {
	Version string `json:"version"`
}

ServerInfo contains server information

type ShareLinkRequest

type ShareLinkRequest struct {
	LibraryID string `json:"repo_id"`
	Path      string `json:"path"`
}

ShareLinkRequest contains the information needed to create or list shared links

type SharedLink struct {
	Link      string `json:"link"`
	IsExpired bool   `json:"is_expired"`
}

SharedLink contains the information returned by a call to shared link creation

Jump to

Keyboard shortcuts

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