Files
buildkit/vendor/github.com/go-openapi/swag/fileutils/file.go
T
Tonis Tiigi 7281e97ffb vendor: update deps to match moby
- github.com/Microsoft/hcsshim v0.15.0-rc.4 -> v0.15.0
- google.golang.org/grpc v1.84.0 -> v1.85.0
- golang.org/x/net v0.61.0 -> v0.62.0
- go.opentelemetry.io/otel v1.46.0 -> v1.47.0
- go.opentelemetry.io/contrib v0.71.0 -> v0.72.0
- github.com/prometheus/client_golang v1.24.1 -> v1.25.0
- github.com/prometheus/procfs v0.21.1 -> v0.22.0
- github.com/go-openapi/* to moby versions

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-11-04 00:44:46 -08:00

28 lines
695 B
Go

// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0
package fileutils
import "mime/multipart"
// File represents an uploaded file.
//
// Data holds the payload, and Header the multipart metadata.
// File implements [io.ReadCloser] by delegating both methods to Data.
//
// The zero File is not usable: [File.Read] and [File.Close] both panic when Data is nil.
type File struct {
Data multipart.File
Header *multipart.FileHeader
}
// Read reads bytes from the payload.
func (f *File) Read(p []byte) (n int, err error) {
return f.Data.Read(p)
}
// Close closes the payload.
func (f *File) Close() error {
return f.Data.Close()
}