mirror of
https://github.com/Rayzggz/server_torii.git
synced 2025-06-22 23:11:30 +08:00
feat: CAPTCHA
This commit is contained in:
@ -10,25 +10,32 @@ const (
|
||||
|
||||
// Decision saves the result of the decision
|
||||
type Decision struct {
|
||||
HTTPCode string
|
||||
State checkState
|
||||
JumpIndex int
|
||||
HTTPCode []byte
|
||||
State checkState
|
||||
ResponseData []byte
|
||||
JumpIndex int
|
||||
}
|
||||
|
||||
func NewDecision() *Decision {
|
||||
return &Decision{HTTPCode: "200", State: Continue, JumpIndex: -1}
|
||||
return &Decision{HTTPCode: []byte("200"), State: Continue, ResponseData: nil, JumpIndex: -1}
|
||||
}
|
||||
|
||||
func (d *Decision) Set(state checkState) {
|
||||
d.State = state
|
||||
}
|
||||
|
||||
func (d *Decision) SetCode(state checkState, httpCode string) {
|
||||
func (d *Decision) SetCode(state checkState, httpCode []byte) {
|
||||
d.State = state
|
||||
d.HTTPCode = httpCode
|
||||
}
|
||||
|
||||
func (d *Decision) SetJump(state checkState, httpCode string, jumpIndex int) {
|
||||
func (d *Decision) SetResponse(state checkState, httpCode []byte, responseData []byte) {
|
||||
d.State = state
|
||||
d.HTTPCode = httpCode
|
||||
d.ResponseData = responseData
|
||||
}
|
||||
|
||||
func (d *Decision) SetJump(state checkState, httpCode []byte, jumpIndex int) {
|
||||
d.State = state
|
||||
d.HTTPCode = httpCode
|
||||
d.JumpIndex = jumpIndex
|
||||
|
Reference in New Issue
Block a user