database

package
v0.0.0-...-27277b1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB // экспортируемая глобальная переменная

Functions

This section is empty.

Types

type Storage

type Storage struct {
	DB *sql.DB
}

func NewStorage

func NewStorage(path string) (*Storage, error)

NewStorage создаёт базу (или открывает существующую)

func (*Storage) AddMessage

func (s *Storage) AddMessage(sender, recipient, text string) error

Сохранить сообщение

func (*Storage) AddUser

func (s *Storage) AddUser(name string) error

Добавить пользователя

func (*Storage) Close

func (s *Storage) Close()

Close закрывает базу

func (*Storage) GetLastMessages

func (s *Storage) GetLastMessages(limit int) ([]string, error)

Получить последние N сообщений

Jump to

Keyboard shortcuts

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