Versions in this module Expand all Collapse all v2 v2.3.0 Aug 28, 2026 Changes in this version + const MaxInMemorySize + var ErrFailedToReadData = errors.New("failed to read data from reader") + var ErrFileSizeExceedsLimit = errors.New("file size exceeds limit") + var ErrInsufficientProviderInfo = errors.New(...) + var ErrNoStorageProvider = errors.New("no storage provider available") + var ErrProviderHintsRequired = errors.New("provider hints required for file upload") + var ErrReaderCannotBeNil = errors.New("reader cannot be nil") + var ErrUnsupportedMimeType = errors.New("unsupported mime type uploaded") + func AddUpload() + func DoneUpload() + func GetFileIDsFromContext(ctx context.Context) []string + func InferReaderSize(r io.Reader) (int64, bool) + func ParseFilesFromSource[T FileSource](source T, keys ...string) (map[string][]File, error) + func ProcessFilesForMutation[T Mutation](ctx context.Context, mutation T, key string, parentType ...string) (context.Context, error) + func ReaderToSeeker(r io.Reader) (io.ReadSeeker, error) + func RemoveFileFromContext(ctx context.Context, f File) context.Context + func UpdateFileInContextByKey(ctx context.Context, key string, f File) context.Context + func WaitForUploads() + func WriteFilesToContext(ctx context.Context, f Files) context.Context + type BufferedReader struct + func NewBufferedReader(data []byte) *BufferedReader + func NewBufferedReaderFromReader(r io.Reader) (*BufferedReader, error) + func NewBufferedReaderFromReaderWithLimit(r io.Reader, maxSize int64) (*BufferedReader, error) + func (br *BufferedReader) Close() error + func (br *BufferedReader) Data() []byte + func (br *BufferedReader) NewReadSeeker() io.ReadSeeker + func (br *BufferedReader) NewReader() io.Reader + func (br *BufferedReader) Read(p []byte) (n int, err error) + func (br *BufferedReader) Reset() + func (br *BufferedReader) Seek(offset int64, whence int) (int64, error) + func (br *BufferedReader) Size() int64 + type DownloadOptions = storage.DownloadOptions + type File = storage.File + func FilesFromContextWithKey(ctx context.Context, key string) ([]File, error) + type FileContextKey struct + Files Files + type FileMetadata = storage.FileMetadata + type FileSource interface + type Files = storage.Files + func FilesFromContext(ctx context.Context) (Files, error) + type GenericMutationAdapter struct + func (a *GenericMutationAdapter[T]) ID() (string, bool) + func (a *GenericMutationAdapter[T]) Type() string + type LenReader interface + Len func() int + type Mutation interface + ID func() (string, bool) + Type func() string + func NewGenericMutationAdapter[T any](mutation T, idFunc func(T) (string, bool), typeFunc func(T) string) Mutation + type ParentObject = storage.ParentObject + type ProviderHints = storage.ProviderHints + type SizedReader interface + Size func() int64 + type StatReader interface + Stat func() (fs.FileInfo, error) + type UploadOptions = storage.UploadOptions + type ValidationFunc func(f File) error + func ChainValidators(validators ...ValidationFunc) ValidationFunc + func MimeTypeValidator(validMimeTypes ...string) ValidationFunc Other modules containing this package github.com/theopenlane/core