Categorygithub.com/vcaesar/cedar
modulepackage
0.20.1
Repository: https://github.com/vcaesar/cedar.git
Documentation: pkg.go.dev

# README

cedar

Build Status Build Status CircleCI Status codecov Go Report Card GoDoc Release

Package cedar implementes double-array trie and aho corasick

It is implements the cedar and paper by golang.

Install

go get -u github.com/vcaesar/cedar

Usage

package main

import (
	"fmt"

	"github.com/vcaesar/cedar"
)

func main() {
	// Create a new cedar trie.
	d := cedar.New()
	d.Insert([]byte("ab"), 1)
	d.Insert([]byte("abc"), 2)
	d.Insert([]byte("abcd"), 3)

	fmt.Println(d.Jump([]byte("ab"), 0))
	fmt.Println(d.Find([]byte("bc"), 0))
	// fmt.Println(d.PrefixMatch([]byte("bc"), 0))
}

License

This is released under the BSD-2 license, following the original license of C++ cedar.

Reference

# Packages

No description provided by the author

# Functions

New initialize the Cedar for further use.

# Constants

NoVal not have value.
ValLimit cedar value limit.

# Variables

ErrInvalidKey invalid key error.
ErrInvalidVal invalid value error.
ErrNoKey not have key error.
ErrNoVal not have value error.

# Structs

Block stores the linked-list pointers and the stats info for blocks.
Cedar holds all of the information about double array trie.
NInfo stores the information about the trie.
Node contains the array of `base` and `check` as specified in the paper: "An efficient implementation of trie structures" https://dl.acm.org/citation.cfm?id=146691.