mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Dependency updates
This commit is contained in:
26
vendor/github.com/99designs/gqlgen/graphql/upload.go
generated
vendored
Normal file
26
vendor/github.com/99designs/gqlgen/graphql/upload.go
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
package graphql
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
)
|
||||
|
||||
type Upload struct {
|
||||
File io.Reader
|
||||
Filename string
|
||||
Size int64
|
||||
}
|
||||
|
||||
func MarshalUpload(f Upload) Marshaler {
|
||||
return WriterFunc(func(w io.Writer) {
|
||||
io.Copy(w, f.File)
|
||||
})
|
||||
}
|
||||
|
||||
func UnmarshalUpload(v interface{}) (Upload, error) {
|
||||
upload, ok := v.(Upload)
|
||||
if !ok {
|
||||
return Upload{}, fmt.Errorf("%T is not an Upload", v)
|
||||
}
|
||||
return upload, nil
|
||||
}
|
||||
Reference in New Issue
Block a user