database

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INVALID           = "INVALID"
	DONE              = "DONE"
	PONG              = "PONG"
	SET_NOT_FOUND     = "SNF"
	SUB_SET_NOT_FOUND = "SSNF"
	ELEMENT_NOT_FOUND = "ENF"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	Sets   Sets
	Config *config.Config

	sync.RWMutex
}

func Init

func Init(cfg *config.Config) *Database

func (*Database) AddSet

func (db *Database) AddSet(args []string) string

func (*Database) AddSubSet

func (db *Database) AddSubSet(args []string) string

func (*Database) CleanSet

func (db *Database) CleanSet(args []string) string

func (*Database) CleanSets

func (db *Database) CleanSets(_ []string) string

func (*Database) CleanSubSet

func (db *Database) CleanSubSet(args []string) string

func (*Database) Connect

func (db *Database) Connect(args []string) string

! TQL Commands.

func (*Database) CountElements

func (db *Database) CountElements(args []string) string

func (*Database) CountSets

func (db *Database) CountSets(_ []string) string

func (*Database) CountSubSets

func (db *Database) CountSubSets(args []string) string

func (*Database) DropSet

func (db *Database) DropSet(args []string) string

func (*Database) DropSubSet

func (db *Database) DropSubSet(args []string) string

func (*Database) GetElements

func (db *Database) GetElements(args []string) string

func (*Database) Ping

func (db *Database) Ping(_ []string) string

func (*Database) PushElement

func (db *Database) PushElement(args []string) string

func (*Database) SetsMap

func (db *Database) SetsMap() Sets

type Element

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

func NewElement

func NewElement(v string, t time.Time) Element

type IDataBase

type IDataBase interface {
	SetsMap() Sets

	Connect([]string) string
	Ping([]string) string
	AddSet([]string) string
	AddSubSet([]string) string
	PushElement([]string) string
	DropSet([]string) string
	DropSubSet([]string) string
	CleanSet([]string) string
	CleanSets([]string) string
	CleanSubSet([]string) string
	CountSets([]string) string
	CountSubSets([]string) string
	CountElements([]string) string
	GetElements([]string) string
}

type Query

type Query struct {
	Command string
	Args    []string
}

type Set

type Set map[string]SubSet

type Sets

type Sets map[string]Set

type SubSet

type SubSet []Element

func (SubSet) String

func (ss SubSet) String() string

Jump to

Keyboard shortcuts

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