box

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadBoxFolder

func DownloadBoxFolder(client *http.Client, boxFolderPath string) error

func DownloadBoxItem added in v1.0.5

func DownloadBoxItem(client *http.Client, boxPath string, localPath string) (string, error)

func GenerateIndex added in v1.1.9

func GenerateIndex(client *http.Client, rootPath string) error

func GetBoxClient

func GetBoxClient(credentialsFile string) (*http.Client, error)

func HumanReadableBoxSize

func HumanReadableBoxSize(size int64) string

func ListBoxContents

func ListBoxContents(client *http.Client, path string) ([]BoxItemDisplay, []BoxItemDisplay, error)

func ResolvePath

func ResolvePath(path string) (string, error)

func SyncBoxDirectory added in v1.0.5

func SyncBoxDirectory(client *http.Client, localDir string, remotePath string, concurrency int, ignore []string) error

func UploadBoxFolder

func UploadBoxFolder(client *http.Client, localPath string, boxFolderPath string) error

func UploadBoxItem added in v1.0.5

func UploadBoxItem(client *http.Client, localPath string, boxFolderPath string) error

Types

type BoxCredentials

type BoxCredentials struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
}

type BoxError

type BoxError struct {
	Type    string `json:"type"`
	Status  int    `json:"status"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type BoxFolderItems

type BoxFolderItems struct {
	TotalCount int       `json:"total_count"`
	Entries    []BoxItem `json:"entries"`
}

type BoxItem

type BoxItem struct {
	Type   string `json:"type"`
	ID     string `json:"id"`
	Name   string `json:"name"`
	Size   *int64 `json:"size"`
	Parent *struct {
		ID string `json:"id"`
	} `json:"parent"`
	ModifiedAt *string `json:"modified_at"`
}

type BoxItemDisplay

type BoxItemDisplay struct {
	ID           string
	Name         string
	ModifiedTime string
	Size         int64
	Type         string
}

type FileInfo added in v1.0.5

type FileInfo struct {
	Path string
	Hash string
	ID   string
}

type FileTree added in v1.0.5

type FileTree struct {
	Files map[string]FileInfo
	Dirs  map[string]*FileTree
}

type IndexItem added in v1.1.9

type IndexItem struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Path         string `json:"path"`
	Type         string `json:"type"`
	Size         int64  `json:"size"`
	ModifiedTime string `json:"modified_time"`
}

func SearchIndex added in v1.1.9

func SearchIndex(pattern string, searchPath string, excludeDirs, excludeFiles bool) ([]IndexItem, error)

type IndexStore added in v1.1.9

type IndexStore struct {
	Provider  string      `json:"provider"`
	RootPath  string      `json:"root_path"`
	Timestamp time.Time   `json:"timestamp"`
	Items     []IndexItem `json:"items"`
}

Jump to

Keyboard shortcuts

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