Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/tidwall/tinybtree

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/tidwall/tinybtree

  • v1.1.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

tinybtree

GoDoc

Just an itsy bitsy b-tree.

Usage

Keys are strings, values are interfaces.

Functions

Get(key string) (value interface{}, gotten bool)
Set(key string, value interface{}) (prev interface{}, replaced bool)
Delete(key string) (prev interface{}, deleted bool)
Scan(iter func(key string, value interface{}) bool)
Ascend(pivot string, iter func(key string, value interface{}) bool)
Descend(pivot string, iter func(key string, value interface{}) bool)

Example

// Create a btree
var tr tinybtree.BTree

// Set a key. Returns the previous value and ok a previous value exists.
prev, ok := tr.Set("hello", "world")

// Get a key. Returns the value and ok if the value exists.
value, ok := tr.Get("hello")

// Delete a key. Returns the deleted value and ok if the previous value exists.
prev, ok := tr.Delete("hello")

Contact

Josh Baker @tidwall

License

tinybtree source code is available under the MIT License.

FAQs

Package last updated on 29 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc