Documentation ¶
Index ¶
- Variables
- func CloseDB()
- func CreateChannelTable()
- func CreateFirstUsers()
- func CreateGalleryChat() error
- func CreateUserAuthTable()
- func CreateUserChannelTable()
- func CreateUserPrefTable()
- func CreateUserTable()
- func DropChannelTable()
- func DropDBTables()
- func DropUserAuthTable()
- func DropUserChannelTable()
- func DropUserPrefTable()
- func DropUserTable()
- func Init()
- func InitializeTable()
- func VerifyUserChannel(userId int, channelId int) bool
- type AuthenticateUserModel
- type Channel
- func ChannelListUser(userId uint) []*Channel
- func CreateAChatBot(userId uint) (Channel, error)
- func CreateChannel(user User, name string, description string, isPrivate bool) (Channel, error)
- func GetChannel(id int) (Channel, error)
- func GetChannelGallery() (Channel, error)
- func GetChannels() ([]*Channel, int, error)
- func UpdateChannel(id int, maps interface{}) (Channel, error)
- type CreateUserModel
- type CreateUserPrefModel
- type User
- type UserAuth
- type UserChannel
- type UserPref
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func CreateChannelTable ¶
func CreateChannelTable()
func CreateFirstUsers ¶
func CreateFirstUsers()
func CreateGalleryChat ¶
func CreateGalleryChat() error
func CreateUserAuthTable ¶
func CreateUserAuthTable()
func CreateUserChannelTable ¶
func CreateUserChannelTable()
func CreateUserPrefTable ¶
func CreateUserPrefTable()
func CreateUserTable ¶
func CreateUserTable()
func DropChannelTable ¶
func DropChannelTable()
func DropDBTables ¶
func DropDBTables()
func DropUserAuthTable ¶
func DropUserAuthTable()
func DropUserChannelTable ¶
func DropUserChannelTable()
func DropUserPrefTable ¶
func DropUserPrefTable()
func DropUserTable ¶
func DropUserTable()
func InitializeTable ¶
func InitializeTable()
func VerifyUserChannel ¶
Types ¶
type AuthenticateUserModel ¶
type Channel ¶
type Channel struct { gorm.Model OwnerId uint `json:"ownerId" gorm:"default:0"` Name string `json:"name" gorm:"type:varchar(100)"` Description string `json:"description" gorm:"type:varchar(512)"` IsPrivate bool `json:"isPrivate" gorm:"default:true"` IsAChatBot bool `json:"chatBot" gorm:"default:false"` Users []*User `json:"users" gorm:"PRELOAD:true;many2many:user_channels;"` }
func ChannelListUser ¶
func CreateAChatBot ¶
func CreateChannel ¶
func GetChannel ¶
func GetChannelGallery ¶
func GetChannels ¶
func UpdateChannel ¶
type CreateUserModel ¶
type CreateUserModel struct { Firstname string `form:"firstname" json:"firstname" binding:"required"` Lastname string `form:"lastname" json:"lastname" binding:"required"` Nickname string `form:"nickname" json:"nickname" binding:"required"` Password string `form:"password" json:"password" binding:"required"` Email string `form:"email" json:"email" binding:"required"` }
type CreateUserPrefModel ¶
type CreateUserPrefModel struct { UserId uint `form:"userId" json:"userId" binding:"required"` Nickname string `form:"nickname" json:"nickname" binding:"required"` Firsname string `form:"firstname" json:"firstname" binding:"required"` Lastname string `form:"lastname" json:"lastname" binding:"required"` Gravatar string `form:"gravatar" json:"gravatar" binding:"required"` Status string `form:"status" json:"status" binding:"required"` IsLocal string `form:"isLocal" json:"isLocal" binding:"required"` }
type User ¶
type User struct { gorm.Model Email string `json:"email" valid:"email;required" gorm:"type:varchar(100);unique_index" email:"required"` UserPref UserPref `json:"profile" gorm:"PRELOAD:true;ForeignKey:UserId;AssociationForeignKey:ID"` Channels []*Channel `json:"channels" gorm:"PRELOAD:true;many2many:user_channels;"` }
func CreateUser ¶
func CreateUser(data CreateUserModel) (User, error)
func GetUserByEmail ¶
func GetUserWithPref ¶
func UserListChannel ¶
type UserAuth ¶
type UserAuth struct { gorm.Model UserId uint `gorm:"primary_key:UserId;unique_index"` LastLogin time.Time `sql:"DEFAULT:current_timestamp"` AuthProfile string `gorm:"default:'local'"` PassHash string `gorm:"type:varchar(512);unique_index"` PassSalt string `gorm:"type:varchar(512);unique_index"` }
func GetUserAuthByUserId ¶
type UserChannel ¶
type UserPref ¶
type UserPref struct { gorm.Model UserId uint `json:"userId" gorm:"primary_key";valid:"required"` Firstname string `json:"firstname" gorm:"type:varchar(100)"` Lastname string `json:"lastname" gorm:"type:varchar(100)"` Nickname string `json:"nickname" valid:"required" gorm:"type:varchar(100);unique_index; not null"` Gravatar string `json:"gravatar"` Color string `json:"color" valid:"required"` Status string `json:"status" gorm:"type:varchar(500)"` IsLocal bool `json:"isLocal" gorm:"default:true"` }
func CreateBasicUserPref ¶
func CreateUserPref ¶
func GetUserPref ¶
func UpdateUserPref ¶
Click to show internal directories.
Click to hide internal directories.