webhook

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

internal/webhook/handler.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnqueueHandler

func EnqueueHandler(c *gin.Context)

EnqueueHandler accepts either form-values (URL-based flow) or JSON (document content flow), enqueues a job, and returns JSON{"jobId": "..."}.

func StatusHandler

func StatusHandler(c *gin.Context)

StatusHandler returns current status & message for a given jobId.

func StatusWSHandler added in v1.1.2

func StatusWSHandler(c *gin.Context)

StatusWSHandler streams job updates over a WebSocket connection.

func UploadHandler added in v0.2.0

func UploadHandler(c *gin.Context)

UploadHandler handles a single "file" field plus optional form values. It saves the uploaded file under ./uploads/<original-filename>, then enqueues it for processing (skipping download) and returns a JSON { jobId: "..." }.

Types

type DocumentRequest added in v1.3.0

type DocumentRequest struct {
	Body          string `form:"Body" json:"body"`               // URL or base64 content
	ContentType   string `form:"ContentType" json:"contentType"` // MIME type for content
	Filename      string `form:"Filename" json:"filename"`       // Original filename
	IsContent     bool   `form:"IsContent" json:"isContent"`     // Flag: true=content, false=URL
	Prefix        string `form:"prefix" json:"prefix"`
	Compress      string `form:"compress" json:"compress"`
	Manage        string `form:"manage" json:"manage"`
	Archive       string `form:"archive" json:"archive"`
	RmDir         string `form:"rm_dir" json:"rm_dir"`
	RetentionDays string `form:"retention_days" json:"retention_days"`
}

DocumentRequest represents a webhook request that can contain either a URL or document content

Jump to

Keyboard shortcuts

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