util

package
v0.0.0-...-acee36d Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

*

  • Copyright 2015 @ z3q.net.
  • name : device
  • author : jarryliu
  • date : -- :
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : member.go
  • author : jarryliu
  • date : -- :
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : static
  • author : jarryliu
  • date : -- :
  • description :
  • history :

Index

Constants

View Source
const (

	// PC设备
	DevicePC string = "1"
	// 手持设备
	DeviceMobile string = "2"
	// 触摸设备
	DeviceTouchPad string = "3"
	// APP内嵌网页
	DeviceAppEmbed string = "4"
)

Variables

View Source
var HttpImageFileHandler = func(ctx *web.Context) {
	path := strings.Replace(ctx.Request.URL.Path, "/img/", "", 1)
	http.ServeFile(ctx.Response, ctx.Request, "./static/uploads/"+path)
}
View Source
var HttpStaticFileHandler = func(ctx *web.Context) {
	http.ServeFile(ctx.Response, ctx.Request, "."+ctx.Request.URL.Path)
}

处理静态文件

Functions

func CompareMemberApiToken

func CompareMemberApiToken(sto gof.Storage, memberId int, token string) bool

校验令牌

func GetBrownerDevice

func GetBrownerDevice(ctx *web.Context) string

获取浏览设备

func GetMemberApiToken

func GetMemberApiToken(sto gof.Storage, memberId int) (string, string)

获取会员的API令牌

func GetMemberApiTokenKey

func GetMemberApiTokenKey(memberId int) string

获取会员API调用密钥Key

func MemberHttpSessionConnect

func MemberHttpSessionConnect(ctx *web.Context, call func(memberId int)) (ok bool, memberId int)

会员Http请求会话链接

func MemberHttpSessionDisconnect

func MemberHttpSessionDisconnect(ctx *web.Context) bool

会员Http请求会话链接

func RemoveMemberApiToken

func RemoveMemberApiToken(sto gof.Storage, memberId int, token string) bool

移除会员令牌

func SetBrownerDevice

func SetBrownerDevice(ctx *web.Context, deviceType string)

设置浏览设备

func SetDeviceByUrlQuery

func SetDeviceByUrlQuery(ctx *web.Context, form *url.Values) bool

func SetMemberApiToken

func SetMemberApiToken(sto gof.Storage, memberId int, pwd string) string

设置令牌,并返回

Types

This section is empty.

Jump to

Keyboard shortcuts

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