velox

package module
v0.0.0-...-00f6caa Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 8 Imported by: 0

README

VeloxDB

experimental implementation of a filesystem-based database engine based on json files, implemented in go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func NewDatabase

func NewDatabase() *Database

func (*Database) CreateTable

func (database *Database) CreateTable(name string) error

func (*Database) GetTable

func (database *Database) GetTable(name string) (interface{}, error)

func (*Database) Load

func (database *Database) Load(folder string) error

func (*Database) Save

func (database *Database) Save() error

type Record

type Record struct {
	ID   int         `json:"id"`
	Data interface{} `json:"data"`
}

func (*Record) GetData

func (record *Record) GetData() interface{}

func (*Record) GetID

func (record *Record) GetID() int

type RecordInterface

type RecordInterface interface {
	GetID() int
	GetData() interface{}
}

type Table

type Table struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewTable

func NewTable() *Table

func (*Table) CreateRecord

func (table *Table) CreateRecord(record interface{}) (RecordInterface, error)

func (*Table) DeleteRecord

func (t *Table) DeleteRecord(id int) error

func (*Table) ReadRecord

func (table *Table) ReadRecord(id int) (interface{}, error)

func (*Table) UpdateRecord

func (t *Table) UpdateRecord(id int, record interface{}) error

type TableInterface

type TableInterface interface {
	CreateRecord(record interface{}) (RecordInterface, error)
	ReadRecord(id int) (RecordInterface, error)
	UpdateRecord(id int, record interface{}) error
	DeleteRecord(id int) error
}

Jump to

Keyboard shortcuts

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