百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

go-tus

> 编程语言
开源

一个用于 tus 可中断上传协议的纯 Go 客户端

188 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个用于 tus 可中断上传协议的纯 Go 客户端

go-tus

A pure Go client for the tus resumable upload protocol

Example

go
package main

import (
    "os"
    "github.com/eventials/go-tus"
)

func main() {
    f, err := os.Open("my-file.txt")

    if err != nil {
        panic(err)
    }

    defer f.Close()

    // create the tus client.
    client, _ := tus.NewClient("https://tus.example.org/files", nil)

    // create an upload from a file.
    upload, _ := tus.NewUploadFromFile(f)

    // create the uploader.
    uploader, _ := client.CreateUpload(upload)

    // start the uploading process.
    uploader.Upload()
}

Example with resume

go
package main

import (
	"fmt"
	"os"
	"time"

	"github.com/eventials/go-tus"
	"github.com/eventials/go-tus/memorystore"
)

func main() {
	// Open the file
	file, err := os.Open(`/path/to/your/file.txt`)
	if err != nil {
		panic(err)
	}
	defer file.Close()
	// Create a MemoryStore also can be LeveldbStore or you can implement your own store
	store, err := memorystore.NewMemoryStore()
	if err != nil {
		panic(err)
	}
	// Create a Client
	client, err := tus.NewClient("http://tus.example.org/files/", &tus.Config{
		Resume:    true,    // Important to resume uploads
		Store:     store,   // Important to resume uploads
		ChunkSize: 4  This is not a full protocol client implementation.

Checksum, Termination and Concatenation extensions are not implemented yet.

This client allows to resume an upload if a Store is used.

## Built in Store

Store is used to map an upload's fingerprint with the corresponding upload URL.

| Name | Backend | Dependencies |
|:----:|:-------:|:------------:|
| MemoryStore  | In-Memory | None |
| LeveldbStore | LevelDB   | [goleveldb](https://github.com/syndtr/goleveldb) |

## Future Work

- [ ] SQLite store
- [ ] Redis store
- [ ] Memcached store
- [ ] Checksum extension
- [ ] Termination extension
- [ ] Concatenation extension

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gogogolanghttpresumable-upload

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言