api

package
v0.0.0-...-1dc401f Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package api provides types used by the Teldrive API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CopyFile

type CopyFile struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Destination string `json:"destination"`
}

type CopyMoveFileRequest

type CopyMoveFileRequest struct {
	Token               string `json:"token"`
	FileCodes           string `json:"file_codes"`
	DestinationFolderID string `json:"destination_fld_id"`
	Action              string `json:"action"`
}

CopyMoveFileRequest is used for moving/copying a file

type CreateDirRequest

type CreateDirRequest struct {
	Path string `json:"path"`
}

type CreateFileRequest

type CreateFileRequest struct {
	Name      string     `json:"name"`
	Type      string     `json:"type"`
	Path      string     `json:"path"`
	MimeType  string     `json:"mimeType"`
	Size      int64      `json:"size"`
	ChannelID int64      `json:"channelId"`
	Encrypted bool       `json:"encrypted"`
	Parts     []FilePart `json:"parts"`
	CreatedAt string     `json:"createdAt,omitempty"`
	UpdatedAt string     `json:"updatedAt,omitempty"`
}

type CreateFolderRequest

type CreateFolderRequest struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Path string `json:"path"`
}

CreateFolderRequest is used for creating a folder

type DeleteFolderRequest

type DeleteFolderRequest struct {
	Token    string `json:"token"`
	FolderID string `json:"fld_id"`
}

DeleteFolderRequest is used for deleting a folder

type DirMove

type DirMove struct {
	Source      string `json:"source"`
	Destination string `json:"destination"`
}

type Download

type Download struct {
	StatusCode int    `json:"statusCode"`
	Message    string `json:"message"`
	Data       struct {
		DownloadLink string `json:"dlLink"`
	} `json:"data"`
}

Download is the response when requesting a download link

type Error

type Error struct {
	Code    bool   `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

func (Error) Error

func (e Error) Error() string

type FileInfo

type FileInfo struct {
	Id       string `json:"id"`
	Name     string `json:"name"`
	MimeType string `json:"mimeType"`
	Size     int64  `json:"size"`
	ParentId string `json:"parentId"`
	Type     string `json:"type"`
	ModTime  string `json:"updatedAt"`
}

FileInfo represents a file when listing folder contents

type FilePart

type FilePart struct {
	ID   int    `json:"id"`
	Salt string `json:"salt"`
}

type MetadataRequestOptions

type MetadataRequestOptions struct {
	PerPage       int64
	SearchField   string
	Search        string
	NextPageToken string
}

MetadataRequestOptions represents all the options when listing folder contents

type MoveFileRequest

type MoveFileRequest struct {
	Files       []string `json:"files"`
	Destination string   `json:"destination"`
}

MoveFolderRequest is used for moving a folder

type Part

type Part struct {
	Id    int64
	Size  int64
	Name  string
	Start int64
	End   int64
}

type PartFile

type PartFile struct {
	Name       string `json:"name"`
	PartId     int    `json:"partId"`
	PartNo     int    `json:"partNo"`
	TotalParts int    `json:"totalParts"`
	Size       int64  `json:"size"`
	ChannelID  int64  `json:"channelId"`
	Encrypted  bool   `json:"encrypted"`
	Salt       string `json:"salt"`
}

type ReadMetadataResponse

type ReadMetadataResponse struct {
	Files         []FileInfo `json:"results"`
	NextPageToken string     `json:"nextPageToken,omitempty"`
}

ReadMetadataResponse is the response when listing folder contents

type RemoveFileRequest

type RemoveFileRequest struct {
	Files []string `json:"files"`
}

RemoveFileRequest is used for deleting a file

type Session

type Session struct {
	UserName string `json:"userName"`
	Hash     string `json:"hash"`
}

type Token

type Token struct {
	Token string `json:"token"`
}

Token represents the authentication token

type UpdateFileInformation

type UpdateFileInformation struct {
	Name      string     `json:"name,omitempty"`
	Type      string     `json:"type,omitempty"`
	UpdatedAt string     `json:"updatedAt,omitempty"`
	Parts     []FilePart `json:"parts,omitempty"`
	Size      int64      `json:"size,omitempty"`
}

UpdateFileInformation is used for renaming a file

type UpdateResponse

type UpdateResponse struct {
	Message string `json:"message,omitempty"`
	Status  bool   `json:"status"`
}

UpdateResponse is a generic response to various action on files (rename/copy/move)

type UploadFile

type UploadFile struct {
	Parts []PartFile `json:"parts,omitempty"`
}

type UploadInfo

type UploadInfo struct {
	ID    int64  `json:"id"`
	Name  string `json:"name"`
	Size  int64  `json:"size"`
	State string `json:"state"`
}

UploadInfo is the response when initiating an upload

type UploadResponse

type UploadResponse struct {
	Files []struct {
		Name      string `json:"name"`
		Size      int64  `json:"size"`
		URL       string `json:"url"`
		DeleteURL string `json:"deleteUrl"`
	} `json:"files"`
}

UploadResponse is the response to a successful upload

Jump to

Keyboard shortcuts

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