Documentation ¶
Index ¶
- Constants
- type Message
- type Role
- type Room
- type Storage
- func (str *Storage) AddRoom(rn string) (string, error)
- func (str *Storage) AddUserToRoom(name string, c *cht.Client) error
- func (str *Storage) ExcludeFromRoom(name string, u *cht.Client) error
- func (str *Storage) GetUser(ru rdn.UserId) (User, error)
- func (str *Storage) LoginUser(lu auth.LoginUser) (string, error)
- func (str *Storage) ReadAuthUsers() []auth.AuthUser
- func (str *Storage) ReadRoom(id string) (rdn.Room, error)
- func (str *Storage) ReadRooms() ([]rdn.Room, error)
- func (str *Storage) ReadUser(ru rdn.UserId) (rdn.User, error)
- func (str *Storage) ReadUsers() ([]rdn.User, error)
- func (str *Storage) RoomHasUser(name string, c *cht.Client) (bool, int)
- func (str *Storage) SigninUser(u auth.SigninUser) (string, error)
- func (str *Storage) WriteMessage(u *cht.Client, r *cht.Room, msg string) error
- type User
- type UserRoom
Constants ¶
View Source
const MESSAGES = "messages"
View Source
const ROOMS = "rooms"
View Source
const USERS = "users"
View Source
const USER_ROOMS = "user_rooms"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func (*Storage) ExcludeFromRoom ¶
func (*Storage) ReadAuthUsers ¶
func (*Storage) RoomHasUser ¶
func (*Storage) SigninUser ¶
func (str *Storage) SigninUser(u auth.SigninUser) (string, error)
type User ¶
type User struct { Created time.Time `db:"created"` Nick string `db:"nick,key"` Token string `db:"token"` Role Role `db:"role"` Name sql.NullString `db:"name"` SecondName sql.NullString `db:"second_name"` Email sql.NullString `db:"email"` }
func (*User) ConvertToReading ¶
func (*User) ConvertUserToAuth ¶
func (*User) GetSecondName ¶
Click to show internal directories.
Click to hide internal directories.