api

package
v1.66.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package api provides types used by the Uptobox API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CopyMoveFileRequest

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

CopyMoveFileRequest is used for moving/copying a file

type CreateFolderRequest

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

CreateFolderRequest is used for creating a folder

type DeleteFolderRequest

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

DeleteFolderRequest is used for deleting a folder

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 {
	Success    bool   `json:"success,omitempty"`
	StatusCode int    `json:"statusCode,omitempty"`
	Message    string `json:"message,omitempty"`
	Data       string `json:"data,omitempty"`
}

Error contains the error code and message returned by the API

func (Error) Error

func (e Error) Error() string

Error returns a string for the error and satisfies the error interface

type FileInfo

type FileInfo struct {
	Name         string `json:"file_name"`
	Description  string `json:"file_descr"`
	Created      string `json:"file_created"`
	Size         int64  `json:"file_size"`
	Downloads    uint64 `json:"file_downloads"`
	Code         string `json:"file_code"`
	Password     string `json:"file_password"`
	Public       int    `json:"file_public"`
	LastDownload string `json:"file_last_download"`
	ID           uint64 `json:"id"`
}

FileInfo represents a file when listing folder contents

type FolderEntry

type FolderEntry struct {
	FolderID    uint64 `json:"fld_id"`
	Description string `json:"fld_descr"`
	Password    string `json:"fld_password"`
	FullPath    string `json:"fullPath"`
	Path        string `json:"fld_name"`
	Name        string `json:"name"`
	Hash        string `json:"hash"`
}

FolderEntry represents a Uptobox subfolder when listing folder contents

type FolderInfo

type FolderInfo struct {
	FolderID      uint64 `json:"fld_id"`
	Hash          string `json:"hash"`
	FileCount     uint64 `json:"fileCount"`
	TotalFileSize int64  `json:"totalFileSize"`
}

FolderInfo represents the current folder when listing folder contents

type MetadataRequestOptions

type MetadataRequestOptions struct {
	Limit       uint64
	Offset      uint64
	SearchField string
	Search      string
}

MetadataRequestOptions represents all the options when listing folder contents

type MoveFolderRequest

type MoveFolderRequest struct {
	Token               string `json:"token"`
	FolderID            uint64 `json:"fld_id"`
	DestinationFolderID uint64 `json:"destination_fld_id"`
	Action              string `json:"action"`
}

MoveFolderRequest is used for moving a folder

type ReadMetadataResponse

type ReadMetadataResponse struct {
	StatusCode int    `json:"statusCode"`
	Message    string `json:"message"`
	Data       struct {
		CurrentFolder  FolderInfo    `json:"currentFolder"`
		Folders        []FolderEntry `json:"folders"`
		Files          []FileInfo    `json:"files"`
		PageCount      int           `json:"pageCount"`
		TotalFileCount int           `json:"totalFileCount"`
		TotalFileSize  int64         `json:"totalFileSize"`
	} `json:"data"`
}

ReadMetadataResponse is the response when listing folder contents

type RemoveFileRequest

type RemoveFileRequest struct {
	Token     string `json:"token"`
	FileCodes string `json:"file_codes"`
}

RemoveFileRequest is used for deleting a file

type RenameFolderRequest

type RenameFolderRequest struct {
	Token    string `json:"token"`
	FolderID uint64 `json:"fld_id"`
	NewName  string `json:"new_name"`
}

RenameFolderRequest is used for renaming a folder

type Token

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

Token represents the authentication token

type UpdateFileInformation

type UpdateFileInformation struct {
	Token       string `json:"token"`
	FileCode    string `json:"file_code"`
	NewName     string `json:"new_name,omitempty"`
	Description string `json:"description,omitempty"`
	Password    string `json:"password,omitempty"`
	Public      string `json:"public,omitempty"`
}

UpdateFileInformation is used for renaming a file

type UpdateResponse

type UpdateResponse struct {
	Message    string `json:"message"`
	StatusCode int    `json:"statusCode"`
}

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

type UploadInfo

type UploadInfo struct {
	StatusCode int    `json:"statusCode"`
	Message    string `json:"message"`
	Data       struct {
		UploadLink string `json:"uploadLink"`
		MaxUpload  string `json:"maxUpload"`
	} `json:"data"`
}

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