Documentation
¶
Index ¶
- type Collector
- func (c *Collector) Collect(ctx context.Context, tenantID, executionID, filesDir string) (filesURL string, filesList []string, err error)
- func (c *Collector) DeleteObject(ctx context.Context, key string) error
- func (c *Collector) DownloadObject(ctx context.Context, key string) (io.ReadCloser, int64, string, error)
- func (c *Collector) UploadObject(ctx context.Context, key string, reader io.Reader, size int64, ...) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector handles the packaging and uploading of file artifacts produced by skill executions. Output files are tar-gzipped and stored in MinIO with a presigned download URL.
func New ¶
New creates a Collector connected to the given S3/MinIO endpoint. It ensures the target bucket exists, creating it if necessary.
func (*Collector) Collect ¶
func (c *Collector) Collect(ctx context.Context, tenantID, executionID, filesDir string) (filesURL string, filesList []string, err error)
Collect packages all files found in filesDir into a tar.gz archive, uploads it to MinIO at {tenantID}/{executionID}/files.tar.gz, and returns a presigned GET URL (1 hour TTL) along with the list of relative file paths. If filesDir is empty or contains no files, it returns empty values with no error.
func (*Collector) DeleteObject ¶ added in v0.2.0
DeleteObject removes the object at the given S3 key.
func (*Collector) DownloadObject ¶ added in v0.2.0
func (c *Collector) DownloadObject(ctx context.Context, key string) (io.ReadCloser, int64, string, error)
DownloadObject returns a ReadCloser for the object stored at the given S3 key. The caller is responsible for closing the returned reader.
func (*Collector) UploadObject ¶ added in v0.2.0
func (c *Collector) UploadObject(ctx context.Context, key string, reader io.Reader, size int64, contentType string) (int64, error)
UploadObject uploads data from reader to the given S3 key with the specified content type and returns the number of bytes written.