geetest

package
v1.0.63 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GEETEST_ID                = "123456"
	GEETEST_KEY               = "123456"
	REDIS_SERVER              = "127.0.0.1:6379"                                 // 对bypass状态进行缓存的redis服务地址
	BYPASS_URL                = "http://bypass.geetest.com/v1/bypass_status.php" // 向geetest发送获取bypass状态请求的url
	CYCLE_TIME                = 10                                               // 轮询发送获取bypass状态请求的时间间隔(单位为秒)
	GEETEST_BYPASS_STATUS_KEY = "gt_server_bypass_status"                        // bypass状态存入redis时使用的key值
)

Variables

This section is empty.

Functions

func CheckServerStatus

func CheckServerStatus(geetestID, geetestKey string, debug bool)

从geetest获取bypass状态

func CleanStatus

func CleanStatus(filterObject string) error

清除验证状态

func CreateFilterObject added in v1.0.24

func CreateFilterObject(filterMethod, filterObject string) string

func FirstRegister

func FirstRegister(ctx *node.Context) (sdk.GeetestLibResultData, error)

验证初始化接口,GET请求

func GetBypassCache

func GetBypassCache() (status string)

获取redis缓存的bypass状态

func GetFilterObject added in v1.0.22

func GetFilterObject(ctx *node.Context) (string, error)

func SecondValidate

func SecondValidate(ctx *node.Context) (map[string]string, error)

二次验证接口,POST请求

func ValidStatusCode

func ValidStatusCode(filterObject string, statusCode int64) (bool, int64)

验证状态码

func ValidSuccess

func ValidSuccess(filterObject string) bool

验证完成状态

Types

type Config added in v1.0.25

type Config struct {
	GeetestID  string
	GeetestKey string
	Debug      bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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