From 03a405a25122801124f72fad1379a82759f86ddc Mon Sep 17 00:00:00 2001 From: "sati.ac" Date: Fri, 30 Jun 2023 21:43:29 +0300 Subject: [PATCH] feat: add method for retrieving result types of tasks --- tasks.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tasks.go b/tasks.go index d6b8a73..1df13c2 100644 --- a/tasks.go +++ b/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 *ReCaptcha2Task) Result() any { + return &ReCaptcha2Result{} +} + type ReCaptcha2Result struct { Token string `json:"token"` }