database

package
v0.0.2-alpha-test Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INITIAL_SIZE = int64(128)
	MAX_SIZE     = 1 << 63
	HASH_siphash = 0x01
	HASH_FNV32A  = 0x02
	HASH_FNV64A  = 0x03
)

Variables

View Source
var HASHER = HASH_siphash
View Source
var SALT [16]byte

Functions

This section is empty.

Types

type DickEntry

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

func NewDickEntry

func NewDickEntry(key string, value interface{}) *DickEntry

NewDickEntry creates a new DickEntry with the given key and value.

Parameters: - key: a string representing the key of the entry. - value: an interface{} representing the value of the entry.

Returns: - *DickEntry: a pointer to the newly created DickEntry.

type DickTable

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

func NewDickTable

func NewDickTable(size int64) *DickTable

NewDickTable creates a new DickTable with the specified size.

Parameters: - size: the size of the DickTable.

Returns: - *DickTable: a pointer to the newly created DickTable.

type SubDICK

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

type XDICK

type XDICK struct {
	SubDICKs []*SubDICK
	SubCount uint32
	// contains filtered or unexported fields
}

func NewXDICK

func NewXDICK(logs ilog.ILOG, sub_dicks uint32) *XDICK

NewXDICK returns a new instance of XDICK.

The function does not take any parameters. It returns a pointer to XDICK.

func (*XDICK) Del

func (d *XDICK) Del(key string) error

Delete deletes an entry from the dictionary.

Parameters: - key: the key of the entry to be deleted.

Returns: - error: if the entry is not found.

func (*XDICK) GenerateSALT

func (d *XDICK) GenerateSALT()

GenerateSALT generates a fixed slice of 16 maybe NOT really random bytes

func (*XDICK) Get

func (d *XDICK) Get(key string) interface{}

Get returns the value associated with the given key in the dictionary.

Parameters: - key: the key to look up in the dictionary.

Return: - interface{}: the value associated with the key, or nil if the key is not found.

func (*XDICK) Set

func (d *XDICK) Set(key string, value interface{}) error

Set sets the value of a key in the dictionary.

Parameters:

  • key: the key to set the value for.
  • value: the value to set.

Returns:

  • error: an error if the key already exists in the dictionary.

type XDatabase

type XDatabase struct {
	XDICK *XDICK
	BootT int64
}

func NewDICK

func NewDICK(logs ilog.ILOG, sub_dicks uint32) *XDatabase

func (*XDatabase) Del

func (db *XDatabase) Del(key string) error

func (*XDatabase) Get

func (db *XDatabase) Get(key string, val *interface{})

func (*XDatabase) Set

func (db *XDatabase) Set(key string, value interface{}) error

Jump to

Keyboard shortcuts

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