Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the Nimbus Captcha Solver API Backend Service.
func NewServer ¶
func NewServer(cfg *ServerConfig) *Server
NewServer initializes a new Captcha Server instance.
type ServerConfig ¶
type ServerConfig struct {
Addr string
APIKeys map[string]float64 // Map of valid clientKey -> balance credit
MaxWorkers int
}
ServerConfig holds configuration parameters for the Captcha Backend Server.
type TaskItem ¶
type TaskItem struct {
ID string
Payload captcha.TaskPayload
Status string // "processing", "ready", "failed"
Solution captcha.Solution
ErrorMsg string
CreatedAt time.Time
UpdatedAt time.Time
}
TaskItem represents an active or completed captcha solving job in memory.
type TaskQueue ¶
type TaskQueue struct {
// contains filtered or unexported fields
}
TaskQueue is a thread-safe, in-memory queue for task management and retrieval.
func NewTaskQueue ¶
NewTaskQueue initializes a task queue.
func (*TaskQueue) Add ¶
func (q *TaskQueue) Add(id string, payload captcha.TaskPayload) *TaskItem
Add enqueues a new task.
Click to show internal directories.
Click to hide internal directories.