Documentation ¶
Index ¶
- func DbDir() string
- func DbPath() string
- func IsNotExist() bool
- type Group
- type RoleType
- type Session
- type User
- func (u *User) Create() (err error)
- func (u *User) CreateGroup(name string, token string) (g Group, err error)
- func (u *User) CreateSession() (s Session, err error)
- func (u *User) CreatedGroups() (gs []Group, err error)
- func (u *User) Delete() (err error)
- func (u *User) JoinGroup(g Group) (err error)
- func (u *User) JoinedGroups() (gs []Group, err error)
- func (u *User) LeaveGroup(g Group) (err error)
- func (u *User) Session() (s Session, err error)
- func (u *User) Update() (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotExist ¶
func IsNotExist() bool
IsNotExist returns true if the file '$HOME/.GoChat/data/gochat.sqlite' doesn't exists, otherwise false.
Types ¶
type Group ¶
type Group struct { Id int `db:"ID" json:"id" form:"id" uri:"id"` UUId string `db:"UUID" json:"uuid" form:"uuid"` Name string `db:"NAME" json:"name" form:"name"` AdminId int `db:"ADMIN_ID" json:"admin_id"` Token string `db:"TOKEN" json:"token"` CreatedAt time.Time `db:"CREATED_AT" json:"created_at"` }
func GroupByUniqueKey ¶
func (*Group) Administrator ¶
type Session ¶
type Session struct { Id int `db:"ID" json:"id" form:"id" uri:"id"` UUId string `db:"UUID" json:"uuid" form:"uuid"` UserId int `db:"USER_ID" json:"user_id" form:"user_id"` CreatedAt time.Time `db:"CREATED_AT" json:"created_at"` }
func SessionByUniqueKey ¶
type User ¶
type User struct { Id int `db:"ID" json:"id" form:"id" uri:"id"` UUId string `db:"UUID" json:"uuid" form:"uuid"` Name string `db:"NAME" json:"name" form:"name"` Password string `db:"PASSWORD" json:"password"` MaxRole RoleType `db:"MAX_ROLE" json:"max_role"` CreatedAt time.Time `db:"CREATED_AT" json:"created_at"` }
func UserByUniqueKey ¶
func (*User) CreateGroup ¶
func (*User) CreateSession ¶
func (*User) CreatedGroups ¶
func (*User) JoinedGroups ¶
func (*User) LeaveGroup ¶
Click to show internal directories.
Click to hide internal directories.