mailer

module
v0.0.0-...-1649e63 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT

README

Mailer microservice

This service is responsible for sending email using 3rd party provider.

Available tasks

You can see all available tasks running following command in the root of the repo:

task

You should get a following output:

task: [default] task --list-all
task: Available tasks for this project:
* default:               Show available tasks
* generate:              Generate (used for mock generation)
* install:               Install all tools
* lint:                  Run golangci-lint
* run:                   Populate env from .env file and run service
* run-with-env:
* test:                  Run tests
* install:gofumpt:       Install gofumpt
* install:lint:          Install golangci-lint
* install:mock:          Install mockgen
* test:cover:            Run tests & show coverage
* test:race:             Run tests with a race flag

How to run?

If you want to run it as a standalone service you need:

  1. Populate env vars needed for it in root .env file (../.env)
  2. Run task run from ./mailer dir or task mailer:run from the root of the repo

App diagram

image

Folder structure

  1. pkg contains possibly reusable package, not binded to this project. Currently it contains only logger utils
  2. internalcontains packages binded to this project.
    • cfg contains config which is read from environment vars.
    • app is an abstraction with all services initialization.
    • transport contains all transport layer logic: nats subscriber.
    • service contains all domain logic.
    • storage contains everything related to the persistance layer: connection to db logic & repositories with domain models.
    • archtest contains architecture dependency checks.
    • test contains end-to-end component tests.
  3. cmd contains entrypoints to the program.
  4. platform contains specific implementations for sending mails which could possibly change/be changed.

Directories

Path Synopsis
cmd
internal
app
cfg
service/cron/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
service/mail/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
service/rate/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
service/subscriber/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
transport/grpc/server/mailer/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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