bilinetdrive

package module
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 24 Imported by: 0

README

bilinetdrive

把b图床当网盘用!

api

看源码吧,那里每个函数后都有注释

实现例子

一个简陋的命令行包装: https://github.com/littlefish12345/bilinetdrive-cmd

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SESSDATA = ""

	UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0"
)

Functions

func CopyNode added in v1.4.0

func CopyNode(originPath string, targetPath string) error

func CostumeUserAgent

func CostumeUserAgent(useragent string)

func CreateNode

func CreateNode(nodeData map[string][]string, doCache bool) (string, error)

func DecodeImage

func DecodeImage(imageData *bytes.Buffer) (*bytes.Buffer, error)

func DecodeNode

func DecodeNode(hash string, doCache bool) (map[string][]string, error)

func DoesNodeExist added in v1.4.1

func DoesNodeExist(path string) (bool, string, error)

func DownloadData

func DownloadData(path string) (*bytes.Buffer, error)

func DownloadDataToSocket added in v1.4.0

func DownloadDataToSocket(path string, conn *net.Conn) error

func DownloadFile

func DownloadFile(path string, file *os.File) (int64, error)

func DownloadProcessDataThread

func DownloadProcessDataThread(targetData *bytes.Buffer, nowBlock *int, jobQueue *JobQueueStruct, threadsWaitGroup *sync.WaitGroup)

func DownloadProcessFileThread

func DownloadProcessFileThread(file *os.File, fileLock *sync.Mutex, blockSize int64, jobQueue *JobQueueStruct, threadsWaitGroup *sync.WaitGroup)

func DownloadProcessSocketThread added in v1.4.0

func DownloadProcessSocketThread(conn *net.Conn, nowBlock *int, jobQueue *JobQueueStruct, threadsWaitGroup *sync.WaitGroup)

func EncodeImage

func EncodeImage(data *bytes.Buffer, imageWidth int, imageMaxHeight int) (*bytes.Buffer, error)

func FileDoesNotExist

func FileDoesNotExist() error

func FileIsUsing added in v1.3.0

func FileIsUsing() error

func FolderDoesNotExist

func FolderDoesNotExist() error

func GetFileLength

func GetFileLength(path string) (int64, error)

func GetImage

func GetImage(hash string) (*bytes.Buffer, error)

func GetPathFileName added in v1.2.0

func GetPathFileName(path string) string

func GetPathFolder added in v1.2.0

func GetPathFolder(path string) string

func GetRootNodeHash

func GetRootNodeHash() (string, error)

func GetTempPath added in v1.2.0

func GetTempPath(path string) ([][]string, error)

func InitializeRootNode

func InitializeRootNode() (string, error)

func IsFileUsing added in v1.3.0

func IsFileUsing(path string) bool

func JoinPath added in v1.3.0

func JoinPath(first string, second string) string

func ListFile

func ListFile(path string) ([][]string, error)

func MakeFolder

func MakeFolder(path string) error

func MoveNode added in v1.4.0

func MoveNode(originPath string, targetPath string) error

func NameExisted

func NameExisted() error

func NodeDoesNotExist

func NodeDoesNotExist() error

func NotAFile

func NotAFile() error

func NotSetARootNodeYet

func NotSetARootNodeYet() error

func PathDoesNotExist

func PathDoesNotExist() error

func PathSwitchDir added in v1.2.0

func PathSwitchDir(orginalPath string, relPath string) (string, error)

func PushImage

func PushImage(imageData *bytes.Buffer) (string, error)

func RemoveNode

func RemoveNode(path string) error

func SetRootNode

func SetRootNode(hash string) error

func SetSESSDATA

func SetSESSDATA(sessdata string)

func TagFileUsing added in v1.3.0

func TagFileUsing(path string)

func UntagFileUsing added in v1.3.0

func UntagFileUsing(path string)

func UplaodNodeProcessThread added in v1.2.0

func UplaodNodeProcessThread(threadsWaitGroup *sync.WaitGroup)

func UploadData

func UploadData(path string, data *bytes.Buffer) error

func UploadDataFromSocket added in v1.4.0

func UploadDataFromSocket(path string, conn *net.Conn, fileLength int64) error

func UploadFile

func UploadFile(file *os.File, path string) error

func UploadNode added in v1.2.0

func UploadNode()

func UploadProcessDataThread

func UploadProcessDataThread(fileData *bytes.Buffer, blockCount *int64, blockCountLock *sync.Mutex, singleImageMaxSize int64, nodeData *SafeUploadNodeStruct, threadsWaitGroup *sync.WaitGroup)

func UploadProcessFileThread

func UploadProcessFileThread(nodeData *SafeUploadNodeStruct, file *os.File, fileLock *sync.Mutex, jobQueue *JobQueueStruct, threadsWaitGroup *sync.WaitGroup)

func UploadProcessSocketThread added in v1.4.0

func UploadProcessSocketThread(conn *net.Conn, fileLength int64, blockCount *int64, blockCountLock *sync.Mutex, singleImageMaxSize int64, nodeData *SafeUploadNodeStruct, threadsWaitGroup *sync.WaitGroup)

Types

type CacheNodeStruct added in v1.2.0

type CacheNodeStruct struct {
	// contains filtered or unexported fields
}

type JobQueueStruct

type JobQueueStruct struct {
	// contains filtered or unexported fields
}

type SafeUploadNodeStruct

type SafeUploadNodeStruct struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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