server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIKeyAuth

func APIKeyAuth(validKey string) func(next http.Handler) http.Handler

APIKeyAuth provides simple API Key authentication

func RequestLogger

func RequestLogger(logger *log.Logger) func(next http.Handler) http.Handler

RequestLogger adapts stdlib logger for basic request logging

Types

type APIHandler

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

func NewAPIHandler

func NewAPIHandler(tm *tasks.Manager, logger *log.Logger) *APIHandler

func (*APIHandler) HandleGetTaskStatus

func (h *APIHandler) HandleGetTaskStatus(w http.ResponseWriter, r *http.Request)

func (*APIHandler) HandleProvide2FACode

func (h *APIHandler) HandleProvide2FACode(w http.ResponseWriter, r *http.Request)

func (*APIHandler) HandleSubmitTask

func (h *APIHandler) HandleSubmitTask(w http.ResponseWriter, r *http.Request)

type Provide2FACodeRequest

type Provide2FACodeRequest struct {
	Code string `json:"code"`
}

type Server

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

func NewServer

func NewServer(cfg *config.Config, tm *tasks.Manager, logger *log.Logger) *Server

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) Start

func (s *Server) Start() error

type SubmitTaskRequest

type SubmitTaskRequest struct {
	Actions       []taskstypes.Action          `json:"actions"`
	Credentials   *taskstypes.Credentials      `json:"credentials,omitempty"` // Sent in request, handled securely
	TwoFactorAuth taskstypes.TwoFactorAuthInfo `json:"two_factor_auth"`
	CallbackURL   string                       `json:"callback_url,omitempty"`
}

type SubmitTaskResponse

type SubmitTaskResponse struct {
	TaskID string `json:"task_id"`
}

Jump to

Keyboard shortcuts

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