sati

package module
v0.0.0-...-c1233ea Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 8 Imported by: 0

README

sati-go - golang api wrapper for sati.ac

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyTask

type AnyTask interface {
	Result() any
	// contains filtered or unexported methods
}

type Api

type Api struct {
	// contains filtered or unexported fields
}

func NewApi

func NewApi(config Config) *Api

func (*Api) CreateTask

func (a *Api) CreateTask(task AnyTask) (*CreateTaskResult, error)

func (*Api) Dispose

func (a *Api) Dispose()

func (*Api) GetBalance

func (a *Api) GetBalance() (*decimal.Decimal, error)

func (*Api) Solve

func (a *Api) Solve(task AnyTask, result any) (*TaskEntity, error)

type CallError

type CallError struct {
	Description string `json:"description"`
	Code        uint32 `json:"code"`
}

func (*CallError) Error

func (c *CallError) Error() string

type CallMessageIncoming

type CallMessageIncoming struct {
	Success bool `json:"success"`
	Data    any  `json:"data"`
}

type CallMessageOutgoing

type CallMessageOutgoing struct {
	Method string `json:"method"`
	Data   any    `json:"data"`
}

type Config

type Config struct {
	ReconnectionInterval time.Duration
	Endpoint             string
	Debug                bool
	Token                string
}

func NewConfig

func NewConfig(token string) Config

type CreateTaskResult

type CreateTaskResult TaskEntity

type EventBus

type EventBus struct {
	// contains filtered or unexported fields
}

func (*EventBus) On

func (e *EventBus) On(event string, handler func(data any)) (*EventHandler, error)

type EventHandler

type EventHandler struct {
	// contains filtered or unexported fields
}

func (*EventHandler) Off

func (e *EventHandler) Off()

type FunCaptchaResult

type FunCaptchaResult struct {
	Token string `json:"token"`
}

type FunCaptchaTask

type FunCaptchaTask struct {
	SiteKey    string            `json:"siteKey"`
	PageUrl    string            `json:"pageUrl"`
	Data       map[string]string `json:"data,omitempty"`
	ServiceUrl *string           `json:"serviceUrl,omitempty"`
	Proxy      *string           `json:"proxy,omitempty"`
}

func (*FunCaptchaTask) Result

func (t *FunCaptchaTask) Result() any

type GeeTest3Result

type GeeTest3Result struct {
	Challenge string `json:"challenge"`
	Validate  string `json:"validate"`
	Seccode   string `json:"seccode"`
}

type GeeTest3Task

type GeeTest3Task struct {
	SiteKey   string  `json:"siteKey"`
	PageUrl   string  `json:"pageUrl"`
	Challenge string  `json:"challenge"`
	ApiServer *string `json:"apiServer,omitempty"`
	Proxy     *string `json:"proxy,omitempty"`
}

func (*GeeTest3Task) Result

func (t *GeeTest3Task) Result() any

type GetBalanceRequest

type GetBalanceRequest struct{}

type GetBalanceResult

type GetBalanceResult struct {
	Balance string `json:"balance"`
}

type ImageToTextResult

type ImageToTextResult struct {
	Result string `json:"result"`
}

type ImageToTextTask

type ImageToTextTask struct {
	Image []byte  `json:"-"`
	Type  *string `json:"type"`
}

func (*ImageToTextTask) Result

func (t *ImageToTextTask) Result() any

type ReCaptcha2Result

type ReCaptcha2Result struct {
	Token string `json:"token"`
}

type ReCaptcha2Task

type ReCaptcha2Task struct {
	SiteKey string  `json:"siteKey"`
	PageUrl string  `json:"pageUrl"`
	Proxy   *string `json:"proxy,omitempty"`
}

func (*ReCaptcha2Task) Result

func (t *ReCaptcha2Task) Result() any

type TaskEntity

type TaskEntity struct {
	Id     uint32 `json:"id"`
	Type   string `json:"type"`
	State  string `json:"state"`
	Cost   string `json:"cost"`
	Result any    `json:"result"`
}

type TaskUpdateEvent

type TaskUpdateEvent TaskEntity

type TokenReissueEvent

type TokenReissueEvent struct{}

type TurnstileResult

type TurnstileResult struct {
	Token string `json:"token"`
}

type TurnstileTask

type TurnstileTask struct {
	SiteKey string  `json:"siteKey"`
	PageUrl string  `json:"pageUrl"`
	CData   *string `json:"cData,omitempty"`
	Action  *string `json:"action,omitempty"`
	Proxy   *string `json:"proxy,omitempty"`
}

func (*TurnstileTask) Result

func (t *TurnstileTask) Result() any

Jump to

Keyboard shortcuts

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