pdfImage

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 4 Imported by: 0

README

pdfImage

Запуск сервиса
# Swagger
swag init -g cmd/app/main.go

# Windows
go run cmd/app/main.go

# Linux
sudo apt install poppler-utils
go run cmd/app/main.go

# MacOS
brew install poppler
go run cmd/app/main.go

# Бинарный файл
go build -o extractor.exe cmd/app/main.go
./extractor.exe

# Docker
docker-compose up --build
Запуск тестов
go test ./tests -v
Запрос без API-KEY (не задан в .env)
curl -X POST http://localhost:8080/api/extract \
  -F "file=@tests/test.pdf" \
  -F "keyword=пациент" \
  --output result.jpeg
Запрос с API-KEY (задан в .env)
curl -X POST http://localhost:8080/api/extract \
  -H "X-API-KEY: 1234" \
  -F "file=@tests/test.pdf" \
  -F "keyword=пациент" \
  --output result.jpeg

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient() *Client

func (*Client) Extract

func (c *Client) Extract(params ExtractParams) (*ExtractResult, error)

type ExtractParams

type ExtractParams struct {
	PDFData io.Reader
	Keyword string
}

type ExtractResult

type ExtractResult struct {
	ImageBytes []byte
	FileName   string
}

func ExtractOnce

func ExtractOnce(params ExtractParams) (*ExtractResult, error)

Directories

Path Synopsis
cmd
app command
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
internal
app

Jump to

Keyboard shortcuts

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