dbop

package
v0.0.0-...-28c7979 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBoard

func AddBoard(name, path string) string

B100 : success B101 : Cannot connect to DB B102 : sql statement error B103 : Unable to get DB handle B104 : sql exe error

func AddMessage

func AddMessage(sender, sendee int, content string) string

M100 : success M101 : Cannot connect to DB M102 : sql statement error M103 : Unable to get DB handler M104 : sql exe error M105 : user invalid

func AddPost

func AddPost(content, path string, uid int) string

B100 : success B101 : Cannot connect to DB B102 : sql statement error B103 : Unable to get DB handler B104 : sql exe error B105 : user invalid

func AddResponse

func AddResponse(uid, pid int, content string) string

R100 : success R101 : Cannot connect to DB R102 : sql statement error R103 : Unable to get DB handler R104 : sql exe error R105 : user invalid R106 : No such pid

func AddUser

func AddUser(username, password, email, birthdate, gender string) string

AddUser add user Return codes: U100 : Success! U101 : Cannot connect to the database. U102 : SQL statement error U103 : Unable to get DB handle U104 : Execution error

func CheckEmail

func CheckEmail(email string) string

Check Functions have the following return codes : C100-1 : There is a same email C100-0 : There is no same email C101 : Cannot connect to the database. C102 : SQL statement error C103 : SQL execution error

func CheckPass

func CheckPass(username, password string) string

CheckPass have the following return codes : C100-1 : OK C100-0 : Wrong password C101 : Cannot connect to the database. C102 : SQL statement error C103 : SQL execution error C104 : No user

func CheckUsername

func CheckUsername(username string) string

Check Functions have the following return codes : C100-1 : There is a same username C100-0 : There is no same username C101 : Cannot connect to the database. C102 : SQL statement error C103 : SQL execution error

func GetBoards

func GetBoards() string

G101 : Cannot connect to DB G102 : SQL statement error G103 : SQL exe error G104 : empty G105 : JSON error

func GetMesList

func GetMesList(userid int) string

func GetMessage

func GetMessage(sender, sendee int) string

G101 : Cannot connect to DB G102 : SQL statement error G103 : SQL exe error G104 : empty G105 : JSON error G106 : User error

func GetPosts

func GetPosts(path string) string

G101 : Cannot connect to DB G102 : SQL statement error G103 : SQL exe error G104 : empty G105 : JSON error

func GetResponse

func GetResponse(pid int) string

func GetUid

func GetUid(name string) int

func GetUserDetailInfo

func GetUserDetailInfo(id int) string

G101 : Cannot connect to DB G102 : SQL statement error G103 : SQL exe error G104 : empty G105 : JSON error

func GetUserInfo

func GetUserInfo(id int) string

G101 : Cannot connect to DB G102 : SQL statement error G103 : SQL exe error G104 : empty G105 : JSON error

func GetUserName

func GetUserName(id int) string

func IsExistPid

func IsExistPid(pid int) int

Types

type AllMessages

type AllMessages struct {
	Messages []MessageInfo `json:"messages"`
}

type AllPeople

type AllPeople struct {
	MesList []OnePeople `json:"messages"`
}

type AllPosts

type AllPosts struct {
	Posts []Posts `json:"posts"`
}

type Board

type Board struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

type Boards

type Boards struct {
	Board []Board `json:"board"`
}

type MessageInfo

type MessageInfo struct {
	Sender     string `json:"sender"`
	Sendee     string `json:"sendee"`
	Createtime string `json:"createtime"`
	Content    string `json:"content"`
}

type OnePeople

type OnePeople struct {
	Uid      int    `json:"uid"`
	User     string `json:"user"`
	LastTime string `json:"last_time"`
}

type Posts

type Posts struct {
	Pid        int    `json:"pid"`
	Uid        int    `json:"uid"`
	Username   string `json:"username"`
	Createtime string `json:"createtime"`
	Content    string `json:"content"`
}

type Response

type Response struct {
	Uid        int    `json:"uid"`
	Username   string `json:"username"`
	Createtime string `json:"createtime"`
	Content    string `json:"content"`
}

type Responses

type Responses struct {
	Uid        int        `json:"uid"`
	Username   string     `json:"username"`
	Createtime string     `json:"createtime"`
	Content    string     `json:"content"`
	Response   []Response `json:"response"`
}

type UserDetailInfo

type UserDetailInfo struct {
	Uid        int    `json:"uid"`
	Username   string `json:"username"`
	Email      string `json:"email"`
	Birthdate  string `json:"birthdate"`
	Createtime string `json:"createtime"`
	Gender     string `json:"gender"`
}

type UserInfo

type UserInfo struct {
	Uid      int    `json:"uid"`
	Username string `json:"username"`
	Gender   string `json:"gender"`
}

Jump to

Keyboard shortcuts

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