model

package
v0.0.0-...-9f8ea49 Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUUID

func CreateUUID() (string, error)

func FlushDB

func FlushDB() error

func Md5PasswordWithSalt

func Md5PasswordWithSalt(salt, password string) (md5Password string)

func RandStringRunes

func RandStringRunes(n int) string

RandStringRunes create rand string

Types

type ExpectWord

type ExpectWord struct {
	Name  string `json:"name"`
	Am    string `json:"am"`
	MP3   string `json:"mp3"`
	Means []mean `json:"means"`
}

func GetWords

func GetWords(wordNames []string) ([]ExpectWord, error)

type Post

type Post struct {
	PostID    int64  `json:"postid"`
	UserID    int64  `json:"userid"`
	CreatedAt int64  `json:"created_at"`
	Content   string `json:"content"`
}

Post represent post model

func (*Post) CreatePost

func (p *Post) CreatePost() error

CreatePost used to create post

func (*Post) GetPost

func (p *Post) GetPost(postID string) error

GetPost used to get post

func (*Post) GetTimelinePosts

func (p *Post) GetTimelinePosts() ([]string, error)

GetTimelinePosts used to get timeline posts

type User

type User struct {
	UserID    int64    `json:"userid"`
	Username  string   `json:"username"`
	Salt      string   `json:"salt"`
	Password  string   `json:"password"`
	Auth      string   `json:"auth"`
	Followers []string `json:"followers"`
	Following []string `json:"following"`
	Channels  []string `json:"channels"`
	PostIDs   []string `json:"postids"`
}

User represent user model

func (*User) AddOrRemFollowingUser

func (u *User) AddOrRemFollowingUser(followingUser User, following string) error

AddFollowingUser used to add following user

func (*User) CreateUser

func (u *User) CreateUser() error

CreateUser used to create user

func (*User) GetLastUsers

func (u *User) GetLastUsers() ([]string, error)

func (*User) GetUserByAuth

func (u *User) GetUserByAuth() error

GetUserByAuth used to get userinfo

func (*User) GetUserByName

func (u *User) GetUserByName() error

GetUserByName used to get user info

func (*User) GetUserByUserID

func (u *User) GetUserByUserID() error

func (*User) GetUserPostCount

func (u *User) GetUserPostCount() (int64, error)

func (*User) GetUserPosts

func (u *User) GetUserPosts(start int, count int) error

GetUserPosts used to get user postids

func (*User) IsFollowing

func (u *User) IsFollowing(follwing *User) (bool, error)

func (*User) UpdateUserAuth

func (u *User) UpdateUserAuth() error

UpdateUserAuth update user auth secret

type Word

type Word struct {
	Name     string   `json:"word_name"`
	Exchange exchange `json:"exchange"`
	Symbols  []symbol `json:"symbols"`
	Items    []string `json:"items"`
}

func (*Word) CreateWord

func (w *Word) CreateWord() error

Jump to

Keyboard shortcuts

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