api

package
v0.0.0-...-e7acbab Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ALLOWED_MAX_LEN = 50
	URL_PATTERN     = `((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$`
)
View Source
const (
	ContentType     = "Content-Type"
	ApplicationJSON = "application/json"
)
View Source
const (
	XAuthHeader = "X-Auth-Token"
)

Variables

This section is empty.

Functions

func Callback

func Callback(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func CreatePhrase

func CreatePhrase(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func Default

func Default(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func DeletePhrase

func DeletePhrase(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func GetLogin

func GetLogin(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func GetMe

func GetPhrases

func GetPhrases(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func GetUserFromToken

func GetUserFromToken(r *http.Request) (u model.User, err error)

redis.Nil means token invalid

func InitRouter

func InitRouter() (router *httprouter.Router)

func Locker

func Locker(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func RPCMessageWithTimeout

func RPCMessageWithTimeout(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

Types

type RPCMessageWithTimeoutRequest

type RPCMessageWithTimeoutRequest struct {
	Token   string `json:"token"`
	Auth    string `json:"auth"`
	Message string `json:"message"`
	Timeout int    `json:"timeout"`
}

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

func (*Response) Send

func (r *Response) Send(w http.ResponseWriter) (err error)

type WunderListAccessTokenResponse

type WunderListAccessTokenResponse struct {
	AccessToken string `json:"access_token"`
}

type WunderListCallbackRequest

type WunderListCallbackRequest struct {
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	Code         string `json:"code"`
}

Jump to

Keyboard shortcuts

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