Documentation ¶
Index ¶
- func AddMentorRequest(m *MentorRequest) (id int64, err error)
- func AddMentorTopic(m *MentorTopic) (id int64, err error)
- func AddTopic(m *Topic) (id int64, err error)
- func AddUser(m *User) (id int64, err error)
- func DeleteMentorRequest(mentorId int, menteeId int) (err error)
- func DeleteMentorTopic(userId int, topicId int) (err error)
- func DeleteTopic(id int) (err error)
- func DeleteUser(id int) (err error)
- func GetAllMentorRequest(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func GetAllMentorTopic(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func GetAllTopic(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func GetAllUser(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func GetMentorRequestsByMenteeId(id int) (ml []interface{}, err error)
- func GetMentorRequestsByMentorId(id int) (ml []interface{}, err error)
- func UpdateMentorRequest(m *MentorRequest) (err error)
- func UpdateMentorTopicById(m *MentorTopic) (err error)
- func UpdateTopicById(m *Topic) (err error)
- func UpdateUserById(m *User) (err error)
- type MentorRequest
- type MentorTopic
- type Topic
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMentorRequest ¶
func AddMentorRequest(m *MentorRequest) (id int64, err error)
AddMentorRequest insert a new MentorRequest into database and returns last inserted Id on success.
func AddMentorTopic ¶
func AddMentorTopic(m *MentorTopic) (id int64, err error)
AddTopic insert a new MentorTopic into database and returns last inserted Id on MentorTopic.
func DeleteMentorRequest ¶
DeleteMentorRequest deletes MentorRequest by Id and returns error if the record to be deleted doesn't exist
func DeleteMentorTopic ¶
DeleteTopic deletes MentorTopic by UserId and TopicId and returns error if the record to be deleted doesn't exist
func DeleteTopic ¶
DeleteTopic deletes Topic by Id and returns error if the record to be deleted doesn't exist
func DeleteUser ¶
DeleteUser deletes User by Id and returns error if the record to be deleted doesn't exist
func GetAllMentorRequest ¶
func GetAllMentorRequest(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllMentorRequest retrieves all MentorRequest matches certain condition. Returns empty list if no records exist
func GetAllMentorTopic ¶
func GetAllMentorTopic(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllTopic retrieves all MentorTopic matches certain condition. Returns empty list if no records exist
func GetAllTopic ¶
func GetAllTopic(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllTopic retrieves all Topic matches certain condition. Returns empty list if no records exist
func GetAllUser ¶
func GetAllUser(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllUser retrieves all User matches certain condition. Returns empty list if no records exist
func GetMentorRequestsByMenteeId ¶
GetMentorRequestByMenteeId retrieves MentorRequest by MenteeId. Returns error if MenteeId doesn't exist
func GetMentorRequestsByMentorId ¶
GetMentorRequestByMentorId retrieves MentorRequest by MentorId. Returns error if MentorId doesn't exist
func UpdateMentorRequest ¶
func UpdateMentorRequest(m *MentorRequest) (err error)
UpdateMentorRequest updates MentorRequest by Id and returns error if the record to be updated doesn't exist
func UpdateMentorTopicById ¶
func UpdateMentorTopicById(m *MentorTopic) (err error)
UpdateTopic updates MentorTopic by Id and returns error if the record to be updated doesn't exist
func UpdateTopicById ¶
UpdateTopic updates Topic by Id and returns error if the record to be updated doesn't exist
func UpdateUserById ¶
UpdateUser updates User by Id and returns error if the record to be updated doesn't exist
Types ¶
type MentorRequest ¶
type MentorRequest struct { Id int `orm:"column(mentor_request_id);pk;auto"` Mentor *User `orm:"column(mentor_id);rel(fk)"` Mentee *User `orm:"column(mentee_id);rel(fk)"` Requested time.Time `orm:"column(requested);type(timestamp without time zone)"` Accepted time.Time `orm:"column(accepted);type(timestamp without time zone);null"` Rejected time.Time `orm:"column(rejected);type(timestamp without time zone);null"` }
func GetMentorRequestByBothIds ¶
func GetMentorRequestByBothIds(mentorId int, menteeId int) (v *MentorRequest, err error)
GetMentorRequestByBothIds retrieves MentorRequest by MenteeId. Returns error if MenteeId doesn't exist
func (*MentorRequest) TableName ¶
func (t *MentorRequest) TableName() string
type MentorTopic ¶
type MentorTopic struct { Id int `orm:"column(mentor_topic_id);pk;auto"` User *User `orm:"column(user_id);rel(fk)"` Topic *Topic `orm:"column(topic_id);rel(fk)"` Level int `orm:"column(level);null"` Description string `orm:"column(description);null"` }
func GetMentorTopicByIds ¶
func GetMentorTopicByIds(userId int, topicId int) (v *MentorTopic, err error)
GetTopicById retrieves MentorTopic by UserId and TopicId. Returns error if Id doesn't exist
func (*MentorTopic) TableName ¶
func (t *MentorTopic) TableName() string
type Topic ¶
func GetTopicById ¶
GetTopicById retrieves Topic by Id. Returns error if Id doesn't exist
type User ¶
type User struct { Id int `orm:"column(id);pk;auto"` Username string `orm:"column(username);unique"` DisplayName string `orm:"column(display_name)"` Email string `orm:"column(email);unique"` Created time.Time `orm:"column(created);type(timestamp without time zone);auto_now_add"` LastActivity time.Time `orm:"column(last_activity);type(timestamp without time zone);auto_now"` Password string `orm:"column(password);null" json:"omitempty"` Description string `orm:"column(description);null"` IconUrl string `orm:"column(icon_url);null"` }
func GetUserByEmail ¶
GetUserByEmail retrieves User by Email. Returns error if Id doesn't exist
func GetUserById ¶
GetUserById retrieves User by Id. Returns error if Id doesn't exist