model

package
v0.0.0-...-bb55e57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2015 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompletePublish

func CompletePublish(publishId string) (err error)

@param publishId

func CreateNewPublish

func CreateNewPublish(userId int, streamId, streamTitle string, streamQuality, streamOrientation int) (publishId string, err error)

@param streamId @param streamTitle @return publishId if err==nil and pubilshId==nil, not allow taken streamId can only be taken once a time

func CreateNewUser

func CreateNewUser(mobile, pwd, name, email string) (err error)

create new user, if mobile exists, err it

func GetLiveStreamList

func GetLiveStreamList(videoList *[]LiveVideo) (err error)

@return videoList

func GetLiveVideoByPublishId

func GetLiveVideoByPublishId(publishId string, liveVideo *LiveVideo) (err error)

func GetLiveVideoList

func GetLiveVideoList(videoList *[]LiveVideo) (err error)

@return videoList

func GetMyLiveVideoList

func GetMyLiveVideoList(userId int, videoList *[]LiveVideo) (err error)

@return videoList

func GetSession

func GetSession(sessionId string) (userId int, err error)

func GetStreamIdOfUser

func GetStreamIdOfUser(userId int) (streamId string, err error)

@param user id @return err if exec error @return streamId not empty or empty(stands for none)

func InitOrm

func InitOrm(cfg *config.OrmConfig) (err error)

func IsEmailExists

func IsEmailExists(email string) (exists bool, err error)

@param email check whether email exists

func IsMobileExists

func IsMobileExists(mobile string) (exists bool, err error)

@param mobile check whether mobile exists

func IsNameExists

func IsNameExists(name string) (exists bool, err error)

@param name check whether name exists

func IsStreamPublishing

func IsStreamPublishing(streamId string) (publishing bool, err error)

@param streamId

func SetSession

func SetSession(userId int, sessionId string) (err error)

func SetStreamIdOfUser

func SetStreamIdOfUser(userId int, streamId string) (err error)

@param user id @param stream id @return exec error

Types

type LiveStream

type LiveStream struct {
	Id       int
	UserId   int    `orm:"column(user_id)"`
	StreamId string `orm:"column(stream_id);size(32)"`
}

type LiveVideo

type LiveVideo struct {
	Id          int
	User        *User     `orm:"column(user_id);rel(fk)"`
	PublishId   string    `orm:"column(publish_id);size(32)"`
	Title       string    `orm:"column(title);size(100)"`
	StreamId    string    `orm:"column(stream_id);size(32)"`
	StartTime   int64     `orm:"column(start_time)"`
	EndTime     int64     `orm:"column(end_time)"`
	Quality     int       `orm:"column(quality)"`
	Orientation int       `orm:"column(orientation)"`
	CreateTime  time.Time `orm:"column(create_time);auto_now_add"`
}

type Session

type Session struct {
	Id        int
	UserId    int    `orm:"column(user_id)"`
	SessionId string `orm:"column(session_id)"`
}

type User

type User struct {
	Id     int
	Mobile string `orm:"column(mobile);size(100);unique"`
	Name   string `orm:"column(name);size(100);unique"`
	Pwd    string `orm:"column(pwd);size(32)"`
	Email  string `orm:"column(email);size(200);unique"`
}

func GetUserByMobile

func GetUserByMobile(mobile string) (user *User, err error)

@param mobile get user by mobile

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL