meta

package
v0.0.0-...-27f2751 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2019 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SerializeBTree

func SerializeBTree(tree *BTree) ([]byte, error)

Types

type BTree

type BTree struct {
	Top    *node `json:"top"`
	Length int   `json:"length"`
}

func DeserializeBTree

func DeserializeBTree(bytes []byte) (*BTree, error)

func NewBTree

func NewBTree() *BTree

func (*BTree) Find

func (b *BTree) Find(item Item) (bool, int)

func (*BTree) Get

func (b *BTree) Get(key Item) Item

func (*BTree) Insert

func (b *BTree) Insert(item Item)

func (*BTree) Len

func (b *BTree) Len() int

type ColType

type ColType uint8
const (
	Int ColType = iota
	Varchar
)

func (ColType) String

func (c ColType) String() string

type Column

type Column struct {
	Name    string
	Type    string
	Primary bool
}

type ConcurrentMap

type ConcurrentMap struct {
	// contains filtered or unexported fields
}

func NewConcurrentMap

func NewConcurrentMap() *ConcurrentMap

func (*ConcurrentMap) Get

func (c *ConcurrentMap) Get(key interface{}) (interface{}, bool)

func (*ConcurrentMap) Put

func (c *ConcurrentMap) Put(key, value interface{})

type IntItem

type IntItem int32

func (IntItem) Less

func (i IntItem) Less(than Item) bool

type Item

type Item interface {
	Less(than Item) bool
}

Item must be comarable for b-tree implementation.

type Lru

type Lru struct {
	// contains filtered or unexported fields
}

Lru is the thread-safe LRU cache.

func NewLru

func NewLru(cap int) *Lru

func (*Lru) Get

func (l *Lru) Get(key interface{}) interface{}

func (*Lru) GetAll

func (l *Lru) GetAll() []interface{}

func (*Lru) Insert

func (l *Lru) Insert(key, value interface{}) interface{}

func (*Lru) Len

func (l *Lru) Len() int

type ResultSet

type ResultSet struct {
	Message  string
	ColNames []string
	Values   []string
}

func NewWithMessage

func NewWithMessage(message string) *ResultSet

type Scheme

type Scheme struct {
	TblName    string    `json:"tblName"`
	ColNames   []string  `json:"colNames"`
	ColTypes   []ColType `json:"colTypes"`
	PrimaryKey string    `json:"pk"`
}

Table is the definition of tables and Columns

func NewScheme

func NewScheme(tblName string, colNames []string, colTypes []ColType, pk string) *Scheme

func (*Scheme) ConvertTable

func (s *Scheme) ConvertTable() *Table

type Table

type Table struct {
	Name    string
	Columns []Column
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL