Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                

views

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: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

Gorilla session initiate

Functions

func AddBoards

func AddBoards(w http.ResponseWriter, r *http.Request)

func AddPost

func AddPost(w http.ResponseWriter, r *http.Request)

func AddResponse

func AddResponse(w http.ResponseWriter, r *http.Request)

func CheckEmail

func CheckEmail(w http.ResponseWriter, r *http.Request)

func CheckUsername

func CheckUsername(w http.ResponseWriter, r *http.Request)

func GetBoards

func GetBoards(w http.ResponseWriter, r *http.Request)
getBoards is a function that handles get boards

return {"board":[{"name":"科技","path":"tech"},{"name":"体育","path":"pe"},{"name":"教育","path":"edu"}]}

func GetMesList

func GetMesList(w http.ResponseWriter, r *http.Request)

func GetMessage

func GetMessage(w http.ResponseWriter, r *http.Request)

func GetMyUid

func GetMyUid(w http.ResponseWriter, r *http.Request)

return your uid

func GetPosts

func GetPosts(w http.ResponseWriter, r *http.Request)

func GetResponse

func GetResponse(w http.ResponseWriter, r *http.Request)

func GetUserDetailInfo

func GetUserDetailInfo(w http.ResponseWriter, r *http.Request)
{
	"uid" : 1
}

func GetUserInfo

func GetUserInfo(w http.ResponseWriter, r *http.Request)

func IsLoggedIn

func IsLoggedIn(w http.ResponseWriter, r *http.Request)

true : has logged in false : not logged in

func Login

func Login(w http.ResponseWriter, r *http.Request)

func Logout

func Logout(w http.ResponseWriter, r *http.Request)

func SendMessage

func SendMessage(w http.ResponseWriter, r *http.Request)

func Sinup

func Sinup(w http.ResponseWriter, r *http.Request)

Types

type JsonAddBoards

type JsonAddBoards struct {
	Name string `json:"name"`
	Path string `json:"path"`
}
{
	"name" : "体育",
	"path" : "pe"
}

! ---- Admin required ---- ! ########## must be modified when deploy

type JsonAddMessage

type JsonAddMessage struct {
	Sendee  int    `json:"sendee"`
	Content string `json:"content"`
}
SnedMessage is a function that provides private message service
{
	"sendee" : 2,
	"content" : "Hi Bob, I am fascinated by your face!"
}

Haobo : Auto generated from https://mholt.github.io/json-to-go/

type JsonAddPost

type JsonAddPost struct {
	Path    string `json:"path"`
	Content string `json:"content"`
}
{
	"path" : "pe",
	"content" : "我今天刷题了,求夸"
}

type JsonAddResponse

type JsonAddResponse struct {
	Pid     int    `json:"pid"`
	Content string `json:"content"`
}

type JsonCheckEmail

type JsonCheckEmail struct {
	Email string `json:"email"`
}
CheckEmail is a function that handles
{
	"email" : "example@example.com"
}

Haobo : Auto generated from https://mholt.github.io/json-to-go/

type JsonCheckUsername

type JsonCheckUsername struct {
	Username string `json:"username"`
}
CheckUsername is a function that handles
{
	"username" : "Bob"
}

Haobo : Auto generated from https://mholt.github.io/json-to-go/

type JsonGetMessage

type JsonGetMessage struct {
	Sendee int `json:"sendee"`
}

type JsonGetPosts

type JsonGetPosts struct {
	Path string `json:"path"`
}

getPosts is a function that handles get posts requests

{
	"path": "index"
}

return : {"posts":[{"uid":1,"createtime":"2019-03-02 20:29:57","content":"是不是太差劲了"},{"uid":2,"createtime":"2019-04-30 20:29:57","content":"差评"}]}

type JsonGetResponse

type JsonGetResponse struct {
	Pid int `json:"pid"`
}
getResponse is a function that handles get responses
{
	"pid": 1
}

return :

{
  "uid": 1,
  "username": "alice",
  "createtime": "2006-01-02 15:04:05",
  "content": "我在马路边捡到一分钱",
  "response": [
    {
      "uid": 2,
      "username": "bob",
      "createtime": "2006-01-02 15:04:05",
      "content": "我并不认为你捡过钱"
    },
    {
      "uid": 1,
      "username": "alice",
      "createtime": "2006-01-02 15:04:05",
      "content": "我确确实实捡了钱"
    },
    {
      "uid": 1,
      "username": "alice",
      "createtime": "2006-01-02 15:04:05",
      "content": "我就是捡了钱"
    }
  ]
}

or

return :

{
  "uid": 1,
  "username": "alice",
  "createtime": "2006-01-02 15:04:05",
  "content": "马上交到警察叔叔手里面",
  "response": null
}

type JsonGetUserInfo

type JsonGetUserInfo struct {
	UID int `json:"uid"`
}

type JsonLogin

type JsonLogin struct {
	Username string `json:"username"`
	Password string `json:"password"`
}
Login is a function that handles users' login requests.
{
	"username" : "Bob",
	"password" : "password"
}

Haobo : Auto generated from https://mholt.github.io/json-to-go/

type JsonSignup

type JsonSignup struct {
	Email    string `json:"email"`
	Username string `json:"username"`
	Password string `json:"password"`
	Gender   int    `json:"gender"`
	Birthday string `json:"birthday"`
}
Signup is a function that handles users' register requests.
{
	"email" : "example@example.com",
	"username" : "Bob",
	"password" : "password",
	"gender" : 0,
	"birthday" : "2001-01-01"
}

Haobo : Auto generated from https://mholt.github.io/json-to-go/

Jump to

Keyboard shortcuts

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