MCPcopy
hub / github.com/minio/minio-go / isReadAt

Function isReadAt

api-put-object-common.go:38–60  ·  view source on GitHub ↗

Verify if reader is a generic ReaderAt

(reader io.Reader)

Source from the content-addressed store, hash-verified

36
37// Verify if reader is a generic ReaderAt
38func isReadAt(reader io.Reader) (ok bool) {
39 var v *os.File
40 v, ok = reader.(*os.File)
41 if ok {
42 // Stdin, Stdout and Stderr all have *os.File type
43 // which happen to also be io.ReaderAt compatible
44 // we need to add special conditions for them to
45 // be ignored by this function.
46 for _, f := range []string{
47 "/dev/stdin",
48 "/dev/stdout",
49 "/dev/stderr",
50 } {
51 if f == v.Name() {
52 ok = false
53 break
54 }
55 }
56 } else {
57 _, ok = reader.(io.ReaderAt)
58 }
59 return ok
60}
61
62// OptimalPartInfo - calculate the optimal part info for a given
63// object size.

Callers 2

putObjectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected