Documentation
¶
Index ¶
- Variables
- func AddPassage(passage models.Passage) error
- func AddSubscription(sb *models.Subscription) error
- func AddUser(user *models.User) error
- func AddUserTelegram(tg_id int64) (*models.Id_telegram, error)
- func AuthenticateUser(tg_id int64, login string, password string) (*models.User, error)
- func BuySubscription(tg_id int64, subscriptionID primitive.ObjectID) error
- func CheckSubscription(tg_id int64) (bool, error)
- func GetAllPassages() ([]models.Passage, error)
- func GetUser(tg_id int64) (*models.User, error)
- func GetUserByFIO(fio string) (*models.User, error)
- func GetUsers() (*[]models.User, error)
- func HashPassword(password string) string
- func Init() *mongo.Client
- func PassageData(client *mongo.Client, collectionName string) *mongo.Collection
- func SearchForSenior(chatID int64, groupNumber models.Group) ([]models.Passage, error)
- func SearchItemInDB() (*models.User, *models.Passage, error)
- func UserData(client *mongo.Client, collectionName string) *mongo.Collection
Constants ¶
This section is empty.
Variables ¶
View Source
var Client *mongo.Client = Init()
View Source
var PassageCollection *mongo.Collection = PassageData(Client, "passages")
View Source
var UserCollection *mongo.Collection = UserData(Client, "users")
Functions ¶
func AddSubscription ¶
func AddSubscription(sb *models.Subscription) error
func AddUserTelegram ¶
func AddUserTelegram(tg_id int64) (*models.Id_telegram, error)
Регистрация при /start, отправление ID_telegram в массив
func AuthenticateUser ¶
авторизация через бд - лк САМГК (с добавлением ID_telegram)
func CheckSubscription ¶
func GetUserByFIO ¶
Доступ к пользователя по fio
func HashPassword ¶
func PassageData ¶
func PassageData(client *mongo.Client, collectionName string) *mongo.Collection
func SearchForSenior ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.