Documentation
¶
Index ¶
- Constants
- func CompressToTarGz(srcPath, dstPath string) error
- func ConfigKCP(sess *kcp.UDPSession)
- func DecompressFromTarGz(srcPath, dstPath string) error
- func GetBlockCrypt(key string) (kcp.BlockCrypt, error)
- func IsTarGzFile(filePath string) bool
- func ShouldCompressFile(filePath string, thresholdBytes int64) bool
- func SmuxConfig() *smux.Config
- func ValidateKey(key string) error
- type SmuxListener
Constants ¶
View Source
const ( // HTTP Query parameters QueryAction = "action" QueryPath = "path" QueryOld = "old" QueryNew = "new" QueryRecursive = "recursive" // Action values ActionList = "list" ActionChecksum = "checksum" ActionDownload = "download" ActionUpload = "upload" ActionDelete = "delete" ActionMkdir = "mkdir" ActionRename = "rename" ActionCompress = "compress" ActionExtract = "extract" ActionEdit = "edit" )
View Source
const ( MethodGet = "GET" MethodPost = "POST" MethodPut = "PUT" MethodDelete = "DELETE" )
HTTP methods
View Source
const (
Salt = "kcp-file-transfer"
)
定义加密盐值
Variables ¶
This section is empty.
Functions ¶
func CompressToTarGz ¶
CompressToTarGz compresses a file or folder to tar.gz format srcPath: source file or folder path dstPath: destination .tar.gz file path (should end with .tar.gz)
func DecompressFromTarGz ¶
DecompressFromTarGz decompresses a tar.gz file to destination folder srcPath: source .tar.gz file path dstPath: destination folder path (will be created if not exists)
func IsTarGzFile ¶
IsTarGzFile checks if a file is a tar.gz archive
func ShouldCompressFile ¶
ShouldCompressFile returns true if file size exceeds threshold
Types ¶
type SmuxListener ¶
适配器:将 smux.Session 适配为 net.Listener 接口,以便 http.Serve 使用
func (*SmuxListener) Addr ¶
func (l *SmuxListener) Addr() net.Addr
func (*SmuxListener) Close ¶
func (l *SmuxListener) Close() error
Click to show internal directories.
Click to hide internal directories.