當前位置: 首頁>>代碼示例>>Golang>>正文


Golang fuse.WriteResponse類代碼示例

本文整理匯總了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
}
開發者ID:camarox53,項目名稱:coreos-baremetal,代碼行數:9,代碼來源:record.go

示例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
}
開發者ID:kristofer,項目名稱:camlistore,代碼行數:17,代碼來源:mut.go

示例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
}
開發者ID:camarox53,項目名稱:coreos-baremetal,代碼行數:4,代碼來源:serve_test.go

示例4: Write

func (benchFile) Write(req *fuse.WriteRequest, resp *fuse.WriteResponse, intr fs.Intr) fuse.Error {
	resp.Size = len(req.Data)
	return nil
}
開發者ID:rfistman,項目名稱:camlistore,代碼行數:4,代碼來源:bench_test.go

示例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
}
開發者ID:kdevroede,項目名稱:camlistore,代碼行數:5,代碼來源:fuse_test.go


注:本文中的camlistore/org/third_party/bazil/org/fuse.WriteResponse類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。