feat: add method for retrieving result types of tasks
parent
4eb11030b8
commit
de6961c4f6
9
tasks.go
9
tasks.go
|
@ -2,6 +2,7 @@ package sati
|
|||
|
||||
type AnyTask interface {
|
||||
serialize() task
|
||||
Result() any
|
||||
}
|
||||
|
||||
type task struct {
|
||||
|
@ -23,6 +24,10 @@ func (t *TurnstileTask) serialize() task {
|
|||
}
|
||||
}
|
||||
|
||||
func (t *TurnstileTask) Result() any {
|
||||
return &TurnstileResult{}
|
||||
}
|
||||
|
||||
type TurnstileResult struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
@ -39,6 +44,10 @@ func (t *ReCaptcha2Task) serialize() task {
|
|||
}
|
||||
}
|
||||
|
||||
func (t *ReCaptcha2Result) Result() any {
|
||||
return &ReCaptcha2Result{}
|
||||
}
|
||||
|
||||
type ReCaptcha2Result struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue