mcore

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 4 Imported by: 0

README

MCore

MCore is a minimal storage core written in Go.

It provides simple data storage and retrieval using a local database.


Features

  • Store data units
  • Retrieve data by ID
  • Uses local storage (bbolt)

Data Model

Each stored object contains:

  • ID — unique identifier
  • Type — type of data (note, link, secret, etc.)
  • Content — main data
  • Tags — optional labels
  • CreatedAt — timestamp

Installation

go get github.com/maruf-mlon/mcore

engine, _ := mcore.NewEngine("test.db")

engine.Save(mcore.DataUnit{
    ID: "1",
    Type: "note",
    Content: "Hello MCore!",
})

data, _ := engine.Get("1")
fmt.Println(data.Content)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataUnit

type DataUnit struct {
	ID        string    `json:"id"`
	Type      string    `json:"type"` // secret, link, note, image_path
	Content   string    `json:"content"`
	Tags      []string  `json:"tags"`
	CreatedAt time.Time `json:"created_at"`
}

DataUnit represents a stored object (обьем хранения)

type Mcore

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

Mcore - is the main core structure (оснавная структура ядра)

func NewEngine

func NewEngine(dbPath string) (*Mcore, error)

NewEngine initializes the storage engine (инициализирует движок хранения)

func (*Mcore) Get

func (e *Mcore) Get(id string) (DataUnit, error)

Get retrieves a data unit by ID (Функция поиска, ядра)

func (*Mcore) Save

func (e *Mcore) Save(unit DataUnit) error

Save stores a data unit in the database (сохранение обьекта в базе)

Jump to

Keyboard shortcuts

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