go-pdftojpeg

module
v0.0.0-...-3bebe31 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT

README

go-pdftojpeg

Pdf Separator and Jpeg Converter Tool with GoLang

Build Test Test

PkgGoDev GitHub Actions CI Status Stars Badge Forks Badge Pull Requests Badge Issues Badge GitHub contributors License Badge

Stack

GitHub GitHub Actions Go Docker Kubernetes

Dependencies

Go-Gin Go-Ioc Go-Json Go-Yaml Go-Uuid Testify

Getting Started

PdfToJpeg provides optimal configuration of package size and product count for shipping with RestAPI or Web UI. You can run it locally or as a container.

It has been developed with Domain Driven Design (Hex-Arc) architecture and allows you to be included in the domain and perform external operations in all microservice infrastructures without additional development processes.

Do you want to learn more information about Domain Driven Design and Hex-Arc?

Also, you can see these pictures about Domain Driven Design (Hex-Arc).

Installation

git clone https://github.com/husamettinarabaci/go-pdftojpeg.git
cd go-pdftojpeg
go mod download

Test

go test -v ./...

Usage

You can use with;\

  • RestAPI\
POST http://localhost:16080/api/converter HTTP/1.1
content-type: application/json

{
    "item": 250
}

Local Run

export LOCAL=true && go run cmd/main.go

Docker Build & Run

docker build -t {DOCKER_USERNAME}/{YOUR_REPO} -f script/Dockerfile .
docker tag {DOCKER_USERNAME}/{YOUR_REPO} {DOCKER_USERNAME}/{YOUR_REPO}:latest
docker push {DOCKER_USERNAME}/{YOUR_REPO}:latest
docker run -p 16080:16080 {DOCKER_USERNAME}/{YOUR_REPO}:latest

Kubernetes Deploy

kubectl apply -f script/k8s.yml

Github Actions

Fork the project and create the below secrets in your repo.

DOCKERHUB_USERNAME

DOCKERHUB_TOKEN

Create "release" branch and create a pull request to "release" branch and merge it. Github Actions will build and push docker image to your dockerhub repo.

If you want to trigger DevSecOps action for SAST, you can create a pull request to "devsecops" branch and merge it. Github Actions will run SAST action.

Project Structure - Domain Driven Design (Hex-Arc)

.
├── cmd
│   └── main.go
├── config
│   ├── log_local.yml
│   ├── log.yml
│   ├── rest_local.yml
│   └── rest.yml
├── core
│   ├── application
│   │   ├── infrastructure
│   │   │   └── port
│   │   │       ├── converter.go
│   │   │       └── log.go
│   │   ├── presentation
│   │   │   ├── adapter
│   │   │   │   ├── command.go
│   │   │   │   └── query.go
│   │   │   └── port
│   │   │       ├── command.go
│   │   │       └── query.go
│   │   └── service
│   │       └── service.go
│   └── domain
│       ├── model
│       │   ├── entity
│       │   │   ├── converterrequest.go
│       │   │   └── converterresponse.go
│       │   ├── interface
│       │   │   └── loggable.go
│       │   └── object
│       │       ├── converter.go
│       │       ├── error.go
│       │       └── response.go
│       └── service
│           ├── service.go
│           └── service_test.go
├── doc
│   ├── Hex-Arc-1.jpg
│   └── Hex-Arc-2.jpg
├── go.mod
├── go.sum
├── LICENSE
├── pkg
│   ├── infrastructure
│   │   ├── adapter
│   │   │   ├── converter.go
│   │   │   └── log.go
│   │   └── mapper
│   │       ├── converter.go
│   │       └── converter_test.go
│   └── presentation
│       ├── controller
│       │   └── rest
│       │       └── restapi.go
│       └── dto
│           ├── converterrequest.go
│           └── converterresponse.go
├── README.md
├── script
│   ├── Dockerfile
│   └── k8s.yml
└── tool
    ├── config
    │   ├── log.go
    │   └── rest.go
    ├── json
    │   └── json.go
    └── slice
        └── slice.go

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Tasks

  • Add Unit Test

Contact

Hüsamettin ARABACI - info@husamettinarabaci.com

Project Link: https://github.com/husamettinarabaci/go-pdftojpeg

Jump to

Keyboard shortcuts

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