model

package
v0.0.0-...-b2f1c3f Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const BcryptCost = 10

BcryptCost : cost value of encrypting by bcrypt

Variables

This section is empty.

Functions

func CreateRoom

func CreateRoom(name string) bool

CreateRoom : create room with name

func CreateUser

func CreateUser(name string) bool

CreateUser : create user with the name

func GetLanguage

func GetLanguage() (model string)

GetLanguage : get account info

func GetWatsonToken

func GetWatsonToken() string

GetWatsonToken : issue token for watson speech to text

func UpdateDomain

func UpdateDomain(name string) bool

UpdateDomain : update domain name

func UpdateLanguage

func UpdateLanguage(model string) bool

UpdateLanguage : update account info

func UpdateSkyWayKey

func UpdateSkyWayKey(key string) bool

UpdateSkyWayKey : update skyway API key

func UpdateWatsonAccount

func UpdateWatsonAccount(username string, password string) bool

UpdateWatsonAccount : update account info

Types

type Domain

type Domain struct {
	Name string
}

Domain model

func GetDomain

func GetDomain() (d Domain)

GetDomain : get domain name

type Room

type Room struct {
	ID        int
	Name      string
	CreatedAt string
	CalledAt  string
}

Room model

func GetRoom

func GetRoom(id int) (r Room)

GetRoom : get room by id

func (*Room) WithUsers

func (r *Room) WithUsers() (ru RoomUsers)

WithUsers : return room with users info who belongs.

type RoomUsers

type RoomUsers struct {
	ID       int
	Name     string
	CalledAt string
	Users    []User
}

RoomUsers model

type SkyWay

type SkyWay struct {
	Key string
}

SkyWay model

func GetSkyWayKey

func GetSkyWayKey() (s SkyWay)

GetSkyWayKey : get skyway API key

type User

type User struct {
	ID        int
	Name      string
	Password  string
	IconPath  string
	Admin     bool
	CreatedAt string
	LoginedAt string
}

User model

func AllUser

func AllUser() (users []User)

AllUser : get all users

func Authenticate

func Authenticate(name string, password string) (user User, result bool)

Authenticate : user authentication

func CurrentUser

func CurrentUser(uID int) (u User)

CurrentUser : get current user

func (*User) IsJoin

func (u *User) IsJoin(roomID int) bool

IsJoin : return user joined the room or not

func (*User) JoinRoom

func (u *User) JoinRoom(roomID int) bool

JoinRoom : user join the room

func (*User) JoinedRooms

func (u *User) JoinedRooms() (rooms []Room)

JoinedRooms : return rooms which user joined

func (*User) NotJoinedRooms

func (u *User) NotJoinedRooms() (rooms []Room)

NotJoinedRooms : return rooms which user not joined

func (*User) UpdateAdmin

func (u *User) UpdateAdmin(admin bool) bool

UpdateAdmin : return success to update admin or not

func (*User) UpdatePassword

func (u *User) UpdatePassword(oldPassword string, newPassword string) bool

UpdatePassword : return success to update password or not

type WatsonAccount

type WatsonAccount struct {
	UserName string
	Password string
	Model    string
}

WatsonAccount model

func GetWatsonAccount

func GetWatsonAccount() (w WatsonAccount)

GetWatsonAccount : get account info

Jump to

Keyboard shortcuts

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