Documentation
¶
Overview ¶
Package uploadcache 管理 HTTP 上传接收资格、暂存内容及任务持有期。
Index ¶
- Constants
- Variables
- type Lease
- type Options
- type Receiver
- type Store
- func (s *Store) BeginReceive(id, signature string) (*Receiver, error)
- func (s *Store) Cancel(id string) (View, error)
- func (s *Store) Claim(id, task string) (*Lease, error)
- func (s *Store) Close() error
- func (s *Store) Counts() (sources, receiving int)
- func (s *Store) Done() <-chan struct{}
- func (s *Store) Get(id string) (View, error)
- func (s *Store) Reserve(size int64, metadata []byte) (View, error)
- func (s *Store) SetMetadata(id string, metadata []byte) error
- func (s *Store) Signature(id string) (string, error)
- func (s *Store) Sweep() error
- type View
Constants ¶
View Source
const ( RoutePrefix = "/mcp/uploads/" MaxFileSize int64 = 1 << 30 MaxMetadata = 1 << 20 )
Variables ¶
View Source
var ( ErrTooLarge = errors.New("上传内容超过限制") ErrCapacity = errors.New("上传暂存额度不足") ErrBusy = errors.New("HTTP 接收并发已满") ErrExpired = errors.New("上传接收对象已过期或不存在") ErrInvalidToken = errors.New("上传接收凭据无效") ErrClosed = errors.New("上传接收服务已停止") ErrSizeMismatch = errors.New("上传内容长度不符") ErrNotReady = errors.New("上传内容尚未完整接收") ErrUsed = errors.New("上传内容已固定或已提交任务") ErrChanged = errors.New("上传暂存文件身份已变化") )
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) SetMetadata ¶
SetMetadata 只在准备阶段写入一次目标和清单,不能改写已经提供接收地址的对象。
Click to show internal directories.
Click to hide internal directories.