Documentation
¶
Overview ¶
Package downloadcache 管理 MCP 领取文件;文件名保存有效期,授权密钥仅存在于本次服务内存中。
Index ¶
- Constants
- Variables
- type Artifact
- type Lease
- type Options
- type Pending
- type Store
- func (s *Store) Begin(size int64, suffix string) (*Pending, error)
- func (s *Store) Close() error
- func (s *Store) Done() <-chan struct{}
- func (s *Store) Import(ctx context.Context, source string, size int64, suffix, downloadName string) (artifact Artifact, err error)
- func (s *Store) Link(artifact Artifact, baseURL string) (string, error)
- func (s *Store) Open(name, downloadName, signature string, head bool) (*Lease, error)
- func (s *Store) Sweep() error
Constants ¶
View Source
const ( MaxArtifactSize int64 = 1 << 30 RoutePrefix = "/mcp/downloads/" )
Variables ¶
View Source
var ( ErrTooLarge = errors.New("传输文件超过大小限制") ErrCapacity = errors.New("领取缓存额度不足") ErrBusy = errors.New("HTTP 领取并发已满") ErrExpired = errors.New("下载链接已过期") ErrNotFound = errors.New("领取文件不存在") ErrInvalidToken = errors.New("下载链接凭据无效") ErrInvalidName = errors.New("领取文件名无效") ErrClosed = errors.New("领取缓存已停止") ErrOwned = errors.New("领取缓存已由其他实例管理") ErrSizeMismatch = errors.New("传输文件大小与预期不符") )
Functions ¶
This section is empty.
Types ¶
type Lease ¶
Click to show internal directories.
Click to hide internal directories.