database

package
v0.0.0-...-4f39408 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupInfo

type GroupInfo struct {
	GroupName string
	GroupID   int
}

type GroupStorage

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

func NewGroupStorage

func NewGroupStorage(url *sql.DB, logger *logging.Logger) *GroupStorage

func (*GroupStorage) AddGroups

func (s *GroupStorage) AddGroups(groupIds []chsuAPI.GroupIds) error

func (*GroupStorage) GetGroupIds

func (s *GroupStorage) GetGroupIds() ([]int, error)

func (*GroupStorage) GetGroupNames

func (s *GroupStorage) GetGroupNames() ([]string, error)

func (*GroupStorage) GetTodaySchedule

func (s *GroupStorage) GetTodaySchedule(groupID int) (string, error)

func (*GroupStorage) GetTomorrowSchedule

func (s *GroupStorage) GetTomorrowSchedule(groupID int) (string, error)

func (*GroupStorage) GroupNameIsCorrect

func (s *GroupStorage) GroupNameIsCorrect(groupName string) (bool, error)

func (*GroupStorage) GroupsStartsWith

func (s *GroupStorage) GroupsStartsWith(firstSymbol string) ([]GroupInfo, error)

func (*GroupStorage) Start

func (s *GroupStorage) Start() error

func (*GroupStorage) UnusedID

func (s *GroupStorage) UnusedID(ids []int) ([]int, error)

func (*GroupStorage) UpdateSchedule

func (s *GroupStorage) UpdateSchedule(schedule map[int][2]string) error

type UserStorage

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

func NewUserStorage

func NewUserStorage(url *sql.DB, logger *logging.Logger) *UserStorage

func (*UserStorage) AddUser

func (s *UserStorage) AddUser(userID int64) error

func (*UserStorage) ChangeUserGroup

func (s *UserStorage) ChangeUserGroup(userID int64, groupID int) error

func (*UserStorage) DeleteGroup

func (s *UserStorage) DeleteGroup(userID int64) error

func (*UserStorage) DeleteUser

func (s *UserStorage) DeleteUser(userID int64) error

func (*UserStorage) GetUserGroup

func (s *UserStorage) GetUserGroup(userID int64) (int, error)

func (*UserStorage) GetUsersId

func (s *UserStorage) GetUsersId() ([]int, error)

func (*UserStorage) IsUserHasGroup

func (s *UserStorage) IsUserHasGroup(userID int64) (bool, error)

func (*UserStorage) IsUserInDB

func (s *UserStorage) IsUserInDB(userID int64) (bool, error)

func (*UserStorage) Start

func (s *UserStorage) Start() error

Jump to

Keyboard shortcuts

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