memory

package
v0.0.0-...-a992749 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package memory represents a build-in in-memory database for development and testing purposes. Don't use it in production!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

func New

func New() *Storage

func (*Storage) AddBot

func (s *Storage) AddBot(newBot *bot.Bot) error

func (*Storage) AddChat

func (s *Storage) AddChat(chat *chat.Chat) error

func (*Storage) AddFile

func (s *Storage) AddFile(file *file.File) error

func (*Storage) AddMessage

func (s *Storage) AddMessage(msg *chat.Message) error

func (*Storage) AddUser

func (s *Storage) AddUser(user *user.User) error

func (*Storage) DeleteBot

func (s *Storage) DeleteBot(id string) error

func (*Storage) DeleteChat

func (s *Storage) DeleteChat(id string) error

func (*Storage) DeleteCommand

func (s *Storage) DeleteCommand(id string) error

func (*Storage) DeleteCommandsByBot

func (s *Storage) DeleteCommandsByBot(botId string) error

func (*Storage) DeleteFiles

func (s *Storage) DeleteFiles(ids []string) error

func (*Storage) DeleteKey

func (s *Storage) DeleteKey(botId string) error

func (*Storage) DeleteMessagesByChat

func (s *Storage) DeleteMessagesByChat(chatId string) error

func (*Storage) DeleteUser

func (s *Storage) DeleteUser(id string) error

func (*Storage) DeleteWebhook

func (s *Storage) DeleteWebhook(botId string) error

func (*Storage) EditBot

func (s *Storage) EditBot(bot *bot.Bot) error

func (*Storage) GetAllBots

func (s *Storage) GetAllBots() ([]*bot.Bot, error)

func (*Storage) GetBot

func (s *Storage) GetBot(id string) (*bot.Bot, error)

func (*Storage) GetChat

func (s *Storage) GetChat(id string) (*chat.Chat, error)

func (*Storage) GetChats

func (s *Storage) GetChats(userId, botId string) ([]*chat.Chat, error)

func (*Storage) GetCommand

func (s *Storage) GetCommand(id string) (*bot.Command, error)

func (*Storage) GetCommands

func (s *Storage) GetCommands(botId string) ([]*bot.Command, error)

func (*Storage) GetFiles

func (s *Storage) GetFiles(ids []string) ([]*file.File, error)

func (*Storage) GetKey

func (s *Storage) GetKey(botId string) (*bot.Key, error)

func (*Storage) GetMessage

func (s *Storage) GetMessage(id string) (*chat.Message, error)

func (*Storage) GetMessagesByChat

func (s *Storage) GetMessagesByChat(chatId, senderId string, page, limit int, since int64) (int, []*chat.Message, error)

func (*Storage) GetUser

func (s *Storage) GetUser(id string) (*user.User, error)

func (*Storage) GetWebhook

func (s *Storage) GetWebhook(botId string) (*bot.Webhook, error)

func (*Storage) SaveCommand

func (s *Storage) SaveCommand(newCmd *bot.Command) error

func (*Storage) SaveKey

func (s *Storage) SaveKey(botKey *bot.Key) error

func (*Storage) SaveWebhook

func (s *Storage) SaveWebhook(webhook *bot.Webhook) error

Jump to

Keyboard shortcuts

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