当前位置: 首页>>代码示例>>Golang>>正文


Golang bytes_subgraph.Identity函数代码示例

本文整理汇总了Golang中github.com/timtadh/sfp/stores/bytes_subgraph.Identity函数的典型用法代码示例。如果您正苦于以下问题:Golang Identity函数的具体用法?Golang Identity怎么用?Golang Identity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Identity函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: Remove

func (b *BpTree) Remove(key []byte, where func([]byte) bool) error {
	b.mutex.Lock()
	defer b.mutex.Unlock()
	return b.bpt.Remove(bytes_subgraph.Identity(key), func(bytes []byte) bool {
		return where(bytes_subgraph.Identity(bytes))
	})
}
开发者ID:timtadh,项目名称:sfp,代码行数:7,代码来源:wrapper.go

示例2: Range

func (b *BpTree) Range(from, to []byte) (it Iterator, err error) {
	b.mutex.Lock()
	defer b.mutex.Unlock()
	raw, err := b.bpt.Range(bytes_subgraph.Identity(from), bytes_subgraph.Identity(to))
	if err != nil {
		return nil, err
	}
	return b.kvIter(raw), nil
}
开发者ID:timtadh,项目名称:sfp,代码行数:9,代码来源:wrapper.go

示例3: Find

func (b *BpTree) Find(key []byte) (it Iterator, err error) {
	b.mutex.Lock()
	defer b.mutex.Unlock()
	raw, err := b.bpt.Find(bytes_subgraph.Identity(key))
	if err != nil {
		return nil, err
	}
	return b.kvIter(raw), nil
}
开发者ID:timtadh,项目名称:sfp,代码行数:9,代码来源:wrapper.go

示例4: kvIter

func (b *BpTree) kvIter(kvi fs2.Iterator) (it Iterator) {
	it = func() (key []byte, value []byte, err error, _ Iterator) {
		b.mutex.Lock()
		defer b.mutex.Unlock()
		var k, v []byte
		k, v, err, kvi = kvi()
		if err != nil {
			return nil, nil, err, nil
		}
		if kvi == nil {
			return nil, nil, nil, nil
		}
		key = bytes_subgraph.Identity(k)
		value = bytes_subgraph.Identity(v)
		return key, value, nil, it
	}
	return it
}
开发者ID:timtadh,项目名称:sfp,代码行数:18,代码来源:wrapper.go

示例5: valueIter

func (b *BpTree) valueIter(raw fs2.ItemIterator) (it ValueIterator) {
	it = func() (value []byte, err error, _ ValueIterator) {
		b.mutex.Lock()
		defer b.mutex.Unlock()
		var i []byte
		i, err, raw = raw()
		if err != nil {
			return nil, err, nil
		}
		if raw == nil {
			return nil, nil, nil
		}
		value = bytes_subgraph.Identity(i)
		return value, nil, it
	}
	return it
}
开发者ID:timtadh,项目名称:sfp,代码行数:17,代码来源:wrapper.go

示例6: keyIter

func (b *BpTree) keyIter(raw fs2.ItemIterator) (it KeyIterator) {
	it = func() (key []byte, err error, _ KeyIterator) {
		b.mutex.Lock()
		defer b.mutex.Unlock()
		var i []byte
		i, err, raw = raw()
		if err != nil {
			return nil, err, nil
		}
		if raw == nil {
			return nil, nil, nil
		}
		key = bytes_subgraph.Identity(i)
		return key, nil, it
	}
	return it
}
开发者ID:timtadh,项目名称:sfp,代码行数:17,代码来源:wrapper.go

示例7: Has

func (b *BpTree) Has(key []byte) (bool, error) {
	b.mutex.Lock()
	defer b.mutex.Unlock()
	return b.bpt.Has(bytes_subgraph.Identity(key))
}
开发者ID:timtadh,项目名称:sfp,代码行数:5,代码来源:wrapper.go

示例8: Count

func (b *BpTree) Count(key []byte) (int, error) {
	b.mutex.Lock()
	defer b.mutex.Unlock()
	return b.bpt.Count(bytes_subgraph.Identity(key))
}
开发者ID:timtadh,项目名称:sfp,代码行数:5,代码来源:wrapper.go

示例9: Add

func (b *BpTree) Add(key []byte, val []byte) error {
	b.mutex.Lock()
	defer b.mutex.Unlock()
	return b.bpt.Add(bytes_subgraph.Identity(key), bytes_subgraph.Identity(val))
}
开发者ID:timtadh,项目名称:sfp,代码行数:5,代码来源:wrapper.go


注:本文中的github.com/timtadh/sfp/stores/bytes_subgraph.Identity函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。