core

package
v0.0.0-...-ab5ebe4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StartCommand = "start"

	AddCategoryCommand    = "addcategory"
	RemoveCategoryCommand = "removecategory"
	RenameCategoryCommand = "renamecategory"
	ListCategoriesCommand = "listcategories"

	AddNoteCommand     = "addnote"
	RemoveNotesCommand = "removenotes"
	ListNotes          = "listnotes"
	ListAllNotes       = "all"

	// CallbackQuery.
	RemoveNotesChooseCategoryCallbackQuery = "removenoteschoosecategory"
	ListNotesChooseCategoryCallbackQuery   = "listnoteschoosecategory"
	SelectCategoriesToBeRenamed            = "selectcategoriestoberenamed"
	SpecialDelimeterInQueryCallback        = "_#_"
)
View Source
const (
	AddCategoryInteraction = iota + 1
	RenameCategoryInteraction
)

Do not change the current numbers of these constants.

Variables

View Source
var (
	ErrNotFound    = errors.New("404 Not Found")
	ErrServerError = errors.New("500 Server Error")

	ErrInvalidCategoryName = errors.New("category name can't contain these symbols _`[*~ and be more than 30 symbols")
	ErrInvalidNoteContent  = errors.New("note can't contain these symbols _`[*~ and be more than 200 symbols")
	ErrCategoryExists      = errors.New("category already exists")

	ErrWrongCallbackQueryData = errors.New("wrong callback query data")
)

Functions

This section is empty.

Types

type Category

type Category struct {
	Name        string `bson:"name"`
	Notes       []Note `bson:"notes"`
	ToBeRenamed bool   `bson:"to_be_renamed"`
}

type Note

type Note struct {
	Content string `bson:"content"`
}

type User

type User struct {
	ID              primitive.ObjectID `bson:"_id"`
	TelegramChatID  int64              `bson:"telegram_chat_id"`
	Categories      []Category         `bson:"categories"`
	LastInteraction int                `bson:"last_interaction"`
}

Jump to

Keyboard shortcuts

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