initial commit

This commit is contained in:
2023-06-28 13:56:39 +03:00
commit 1bbbda5385
8 changed files with 552 additions and 0 deletions

44
tasks.go Normal file
View File

@ -0,0 +1,44 @@
package sati
type AnyTask interface {
serialize() task
}
type task struct {
Type string `json:"type"`
Data any `json:"data"`
}
type TurnstileTask struct {
SiteKey string `json:"siteKey"`
PageUrl string `json:"pageUrl"`
CData *string `json:"cData,omitempty"`
Action *string `json:"action,omitempty"`
}
func (t *TurnstileTask) serialize() task {
return task{
Type: "Turnstile",
Data: t,
}
}
type TurnstileResult struct {
Token string `json:"token"`
}
type ReCaptcha2Task struct {
SiteKey string `json:"siteKey"`
PageUrl string `json:"pageUrl"`
}
func (t *ReCaptcha2Task) serialize() task {
return task{
Type: "ReCaptcha2",
Data: t,
}
}
type ReCaptcha2Result struct {
Token string `json:"token"`
}