本文整理汇总了Golang中github.com/attic-labs/noms/go/hash.Hash.String方法的典型用法代码示例。如果您正苦于以下问题:Golang Hash.String方法的具体用法?Golang Hash.String怎么用?Golang Hash.String使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/attic-labs/noms/go/hash.Hash
的用法示例。
在下文中一共展示了Hash.String方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: updateRootByKey
func (l *internalLevelDBStore) updateRootByKey(key []byte, current, last hash.Hash) bool {
l.mu.Lock()
defer l.mu.Unlock()
if last != l.rootByKey(key) {
return false
}
// Sync: true write option should fsync memtable data to disk
err := l.db.Put(key, []byte(current.String()), &opt.WriteOptions{Sync: true})
d.Chk.NoError(err)
return true
}
示例2: requestRoot
func (bhcs *httpBatchStore) requestRoot(method string, current, last hash.Hash) *http.Response {
u := *bhcs.host
u.Path = httprouter.CleanPath(bhcs.host.Path + constants.RootPath)
if method == "POST" {
d.Exp.False(current.IsEmpty())
params := u.Query()
params.Add("last", last.String())
params.Add("current", current.String())
u.RawQuery = params.Encode()
}
req := newRequest(method, bhcs.auth, u.String(), nil, nil)
res, err := bhcs.httpClient.Do(req)
d.Chk.NoError(err)
return res
}
示例3: writeHash
func (w *nomsTestWriter) writeHash(h hash.Hash) {
w.writeString(h.String())
}
示例4: assertInputNotInStore
func assertInputNotInStore(input string, h hash.Hash, s ChunkStore, assert *assert.Assertions) {
data := s.Get(h)
assert.Nil(data, "Shouldn't have gotten data for %s", h.String())
}
示例5: assertInputInStore
func assertInputInStore(input string, h hash.Hash, s ChunkStore, assert *assert.Assertions) {
chunk := s.Get(h)
assert.False(chunk.IsEmpty(), "Shouldn't get empty chunk for %s", h.String())
assert.Equal(input, string(chunk.Data()))
}
示例6: CreateHashSpecString
func CreateHashSpecString(protocol, path string, h hash.Hash) string {
return fmt.Sprintf("%s:%s::#%s", protocol, path, h.String())
}