Documentation ¶
Index ¶
- Variables
- func AddParameterToURL(URL string, parameter map[string]string) (string, error)
- func Client(timeout time.Duration) *http.Client
- func ClientSetCookie(request *http.Request, data map[string]string)
- func CloseRsp(r *http.Response)
- func CreateToken(payload map[string]interface{}, key string) (string, error)
- func Get(client *http.Client, URL string) (*http.Response, error)
- func GetParameterFromURL(URL *url.URL) (url.Values, error)
- func NewRequest(method string, url string, body []byte) (*http.Request, error)
- func ParseToken(tokenStr string, key string) (jwt.MapClaims, error)
- func Post(client *http.Client, url string, contentType string, body []byte) (*http.Response, error)
- func ServerDelCookie(rw http.ResponseWriter, name string)
- func ServerGetCookie(request *http.Request, key string) (string, error)
- func ServerSetCookie(rw http.ResponseWriter, data map[string]string)
- func SetHeader(req *http.Request, data map[string]string)
- func TLSClient(timeout time.Duration, tls *tls.Config) (*http.Client, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorOfEmptyClient = errors.New("client is nil")
Functions ¶
func AddParameterToURL ¶
AddParameterToURL 向URL中添加参数
func ClientSetCookie ¶
ClientSetCookie 设置cookie.
func CreateToken ¶
CreateToken 创建token
iss: 签发者 sub: 面向的用户 aud: 接收方 exp: 过期时间 nbf: 生效时间 iat: 签发时间 jti: 唯一身份标识
func GetParameterFromURL ¶
GetParameterFromURL 获取URL中的参数
func NewRequest ¶
NewRequest 生成新的请求
func ParseToken ¶
ParseToken 解析token
func ServerDelCookie ¶
func ServerDelCookie(rw http.ResponseWriter, name string)
ServerDelCookie 删除cookie.
func ServerGetCookie ¶
ServerGetCookie 获取cookie值
func ServerSetCookie ¶
func ServerSetCookie(rw http.ResponseWriter, data map[string]string)
ServerSetCookie 设置cookie.
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.