Пример #1
0
func (t *txn) run() {
	verb := proto.GetInt32((*int32)(t.req.Verb))
	if f, ok := ops[verb]; ok {
		f(t)
	} else {
		t.respondErrCode(response_UNKNOWN_VERB)
	}
}
Пример #2
0
// Stat returns metadata about the file or directory at path,
// in revision *storeRev. If storeRev is nil, uses the current
// revision.
func (c *Conn) Stat(path string, storeRev *int64) (len int, fileRev int64, err error) {
	var t txn
	t.req.Verb = newRequest_Verb(request_STAT)
	t.req.Path = &path
	t.req.Rev = storeRev

	err = c.call(&t)
	if err != nil {
		return 0, 0, err
	}

	return int(proto.GetInt32(t.resp.Len)), proto.GetInt64(t.resp.Rev), nil
}