storage

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotStore

type BotStore interface {
	AddBot(bot *bot.Bot) error
	EditBot(bot *bot.Bot) error
	GetBot(id string) (*bot.Bot, error)
	GetAllBots() ([]*bot.Bot, error)
	DeleteBot(id string) error

	SaveCommand(cmd *bot.Command) error
	GetCommands(botId string) ([]*bot.Command, error)
	GetCommand(id string) (*bot.Command, error)
	DeleteCommand(id string) error
	DeleteCommandsByBot(botId string) error

	GetKey(botId string) (*bot.Key, error)
	SaveKey(key *bot.Key) error
	DeleteKey(botId string) error

	GetWebhook(botId string) (*bot.Webhook, error)
	SaveWebhook(wh *bot.Webhook) error
	DeleteWebhook(botId string) error
}

type ChatStore

type ChatStore interface {
	AddChat(chat *chat.Chat) error
	GetChat(id string) (*chat.Chat, error)
	GetChats(userId, botId string) ([]*chat.Chat, error)
	DeleteChat(id string) error

	AddMessage(msg *chat.Message) error
	GetMessage(id string) (*chat.Message, error)
	GetMessagesByChat(chatId, senderId string, page, limit int, since int64) (int, []*chat.Message, error)
	DeleteMessagesByChat(chatId string) error
}

type FileStore

type FileStore interface {
	AddFile(file *file.File) error
	GetFiles(ids []string) ([]*file.File, error)
	DeleteFiles(ids []string) error
}

type Storage

type Storage interface {
	BotStore
	UserStore
	ChatStore
	FileStore
}

type UserStore

type UserStore interface {
	AddUser(user *user.User) error
	GetUser(id string) (*user.User, error)
	DeleteUser(id string) error
}

Directories

Path Synopsis
Package memory represents a build-in in-memory database for development and testing purposes.
Package memory represents a build-in in-memory database for development and testing purposes.

Jump to

Keyboard shortcuts

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