Documentation ¶
Overview ¶
Package temp contains some temporary file -related functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MaxInMemorySlurp = 4 << 20 // 4MB. *shrug*.
MaxInMemorySlurp is the threshold for in-memory or on-disk storage for slurped data.
Functions ¶
func LinkAlreadyExists ¶
LinkAlreadyExists checks the error and returns whether this is about a link already exists or not
func LinkOrCopy ¶
LinkOrCopy links src to dst if possible; fails back to copying
Types ¶
type ReadSeekCloser ¶
type ReadSeekCloser interface { io.Reader io.Seeker ReaderAt io.Closer Stat() (os.FileInfo, error) }
ReadSeekCloser is an io.Reader + ReaderAt + io.Seeker + io.Closer + Stater
func MakeReadSeekCloser ¶
func MakeReadSeekCloser(blobRef string, r io.Reader) (ReadSeekCloser, error)
MakeReadSeekCloser makes an io.ReadSeeker + io.Closer by reading the whole reader If the given Reader is a Closer, too, than that Close will be called
func NewReadSeeker ¶
func NewReadSeeker(r io.Reader) (ReadSeekCloser, error)
NewReadSeeker is a convenience function of MakeReadSeekCloser.
type ReadWriteSeekCloser ¶
type ReadWriteSeekCloser interface { ReadSeekCloser io.Writer }
ReadWriteSeekCloser is an io.Writer + io.Reader + io.Seeker + io.Closer.
func NewMemorySlurper ¶
func NewMemorySlurper(blobRef string) ReadWriteSeekCloser
NewMemorySlurper returns an ReadWriteSeekCloser, with some important constraints: you can Write into it, but whenever you call Read or Seek on it, Write is forbidden, will return an error.