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(roomName string, u *cht.Client) error
- func (str *Storage) LoginUser(lu auth.LoginUser) (string, error)
- func (str *Storage) ReadAuthUsers() []auth.AuthUser
- func (str *Storage) ReadRoom(rid string) (rdn.Room, error)
- func (str *Storage) ReadRooms() ([]rdn.Room, error)
- func (str *Storage) ReadUser(uid 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(su auth.SigninUser) (string, error)
- func (str *Storage) WriteMessage(u *cht.Client, r *cht.Room, msg string) error
- type User
- type UserId
Constants ¶
View Source
const ( EmptyNickSigninError = "Can't signin User with empty nick" EmptyPassSigninError = "Can't signin User with empty password" EmptyNickLoginError = "Can't login User with empty nick" EmptyPassLoginError = "Can't login User with empty password" )
View Source
const EmptyRoomNameError = "Room name could not be empty"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
func (*Message) ConvertMessageToReading ¶
type Storage ¶
type Storage struct { Users map[UserId]User Rooms map[string]Room Messages map[int]Message *sync.RWMutex }
func NewStorage ¶
func NewStorage() Storage
func (*Storage) ExcludeFromRoom ¶
func (*Storage) ReadAuthUsers ¶
func (*Storage) RoomHasUser ¶
func (*Storage) SigninUser ¶
func (str *Storage) SigninUser(su auth.SigninUser) (string, error)
type User ¶
type User struct { Created time.Time Name *string SecondName *string Email *string Role Role Nick UserId Token string }
func ConvertUserFromSigning ¶
func ConvertUserFromSigning(su auth.SigninUser) User
func (User) ConvertUserToReading ¶
func (*User) GetSecondName ¶
Click to show internal directories.
Click to hide internal directories.