membtree

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 12 Imported by: 10 modules, 21 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Membtree implements a Datasource in-memory implemenation using the google btree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DriverItem

type DriverItem struct {
	*datasource.SqlDriverMessageMap
}

func (*DriverItem) Less

func (m *DriverItem) Less(than btree.Item) bool

type Key

type Key struct {
	Id uint64
}

Key implements Key and Sort interfaces.

func NewKey

func NewKey(key uint64) *Key

func (*Key) Key

func (m *Key) Key() driver.Value

func (*Key) Less

func (m *Key) Less(than btree.Item) bool

type StaticDataSource

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

StaticDataSource implements qlbridge DataSource to allow in memory native go data to have a Schema and implement and be operated on by Sql Operations

Features - only a single column may (and must) be identified as the "Indexed" column - NOT threadsafe - each StaticDataSource = a single Table

func NewStaticData

func NewStaticData(name string) *StaticDataSource

func NewStaticDataSource

func NewStaticDataSource(name string, indexedCol int, data [][]driver.Value, cols []string) *StaticDataSource

func NewStaticDataValue

func NewStaticDataValue(name string, data interface{}) *StaticDataSource

StaticDataValue is used to create a static name=value pair that matches DataSource interfaces

func (*StaticDataSource) Close

func (m *StaticDataSource) Close() error

func (*StaticDataSource) Columns

func (m *StaticDataSource) Columns() []string

func (*StaticDataSource) CreateIterator

func (m *StaticDataSource) CreateIterator() schema.Iterator

func (*StaticDataSource) Delete

func (m *StaticDataSource) Delete(key driver.Value) (int, error)

Interface for Deletion

func (*StaticDataSource) DeleteExpression

func (m *StaticDataSource) DeleteExpression(p interface{}, where expr.Node) (int, error)

DeleteExpression Delete using a Where Expression

func (*StaticDataSource) Get

func (*StaticDataSource) Init

func (m *StaticDataSource) Init()

func (*StaticDataSource) Length

func (m *StaticDataSource) Length() int

func (*StaticDataSource) MultiGet

func (m *StaticDataSource) MultiGet(keys []driver.Value) ([]schema.Message, error)

func (*StaticDataSource) Next

func (m *StaticDataSource) Next() schema.Message

func (*StaticDataSource) Open

func (m *StaticDataSource) Open(connInfo string) (schema.Conn, error)

func (*StaticDataSource) Put

func (m *StaticDataSource) Put(ctx context.Context, key schema.Key, row interface{}) (schema.Key, error)

interface for Upsert.Put()

func (*StaticDataSource) PutMulti

func (m *StaticDataSource) PutMulti(ctx context.Context, keys []schema.Key, src interface{}) ([]schema.Key, error)

func (*StaticDataSource) SetColumns

func (m *StaticDataSource) SetColumns(cols []string)

func (*StaticDataSource) Setup

func (m *StaticDataSource) Setup(*schema.Schema) error

func (*StaticDataSource) Table

func (m *StaticDataSource) Table(table string) (*schema.Table, error)

func (*StaticDataSource) Tables

func (m *StaticDataSource) Tables() []string

Jump to

Keyboard shortcuts

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