本文整理匯總了Golang中camlistore/org/third_party/bazil/org/fuse.WriteResponse類的典型用法代碼示例。如果您正苦於以下問題:Golang WriteResponse類的具體用法?Golang WriteResponse怎麽用?Golang WriteResponse使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了WriteResponse類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Write
func (w *Writes) Write(req *fuse.WriteRequest, resp *fuse.WriteResponse, intr fs.Intr) fuse.Error {
n, err := w.buf.Write(req.Data)
resp.Size = n
if err != nil {
// TODO hiding error
return fuse.EIO
}
return nil
}
示例2: Write
func (h *mutFileHandle) Write(req *fuse.WriteRequest, res *fuse.WriteResponse, intr fs.Intr) fuse.Error {
if h.tmp == nil {
log.Printf("Write called on camli mutFileHandle without a tempfile set")
return fuse.EIO
}
n, err := h.tmp.WriteAt(req.Data, req.Offset)
log.Printf("mutFileHandle.Write(%q, %d bytes at %d, flags %v) = %d, %v",
h.f.fullPath(), len(req.Data), req.Offset, req.Flags, n, err)
if err != nil {
log.Println("mutFileHandle.Write:", err)
return fuse.EIO
}
res.Size = n
h.f.setSizeAtLeast(req.Offset + int64(n))
return nil
}
示例3: Write
func (f *inMemoryFile) Write(req *fuse.WriteRequest, resp *fuse.WriteResponse, intr fs.Intr) fuse.Error {
resp.Size = copy(f.data[req.Offset:], req.Data)
return nil
}
示例4: Write
func (benchFile) Write(req *fuse.WriteRequest, resp *fuse.WriteResponse, intr fs.Intr) fuse.Error {
resp.Size = len(req.Data)
return nil
}
示例5: Write
func (w *writeTruncateFlush) Write(req *fuse.WriteRequest, resp *fuse.WriteResponse, intr Intr) fuse.Error {
w.seen.data <- req.Data
resp.Size = len(req.Data)
return nil
}