Documentation
¶
Overview ¶
Package artifact stores generated exports outside MCP tool responses.
Index ¶
Constants ¶
View Source
const ( // DefaultTTL is how long a generated export remains downloadable. DefaultTTL = 15 * time.Minute // DefaultMaxBytes bounds one artifact when the operator does not set a limit. DefaultMaxBytes = 100 * 1024 * 1024 // DefaultMaxTotalBytes bounds all live artifacts together. DefaultMaxTotalBytes = 500 * 1024 * 1024 // DefaultMaxFiles bounds the number of live artifacts. DefaultMaxFiles = 100 // DefaultMaxConcurrent bounds simultaneous database exports. DefaultMaxConcurrent = 2 )
Variables ¶
View Source
var ErrCapacity = errors.New("export store capacity exhausted")
ErrCapacity is returned when aggregate export capacity is exhausted.
View Source
var ErrTooLarge = errors.New("export exceeds the byte limit")
ErrTooLarge is returned when an export exceeds the configured byte limit.
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct {
ID string `json:"export_id"`
Filename string `json:"filename"`
Size int64 `json:"size_bytes"`
SHA256 string `json:"sha256"`
ExpiresAt time.Time `json:"expires_at"`
}
Metadata is the small, data-free description returned to MCP clients.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store owns short-lived export files and serves them by unguessable ID.
func NewStore ¶
func NewStore(root string, ttl time.Duration, maxBytes, maxTotalBytes int64, maxFiles, maxConcurrent int) (*Store, error)
NewStore creates an export store. An empty root gets a private temporary directory.
Click to show internal directories.
Click to hide internal directories.