Skip to content

Commit

Permalink
Merge pull request #6 from infra-io/rebuild
Browse files Browse the repository at this point in the history
v0.4.0-alpha
  • Loading branch information
FishGoddess authored Mar 7, 2024
2 parents afa0494 + 50c2310 commit 0c4b299
Show file tree
Hide file tree
Showing 120 changed files with 13,213 additions and 1,391 deletions.
26 changes: 15 additions & 11 deletions FUTURE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
## 未来版本的新特性 (Features in future versions)
## 🏃🏻‍♀️ 未来版本的新特性 (Features in future versions)

### Future versions
### v0.4.x

* [ ] 持续完善代码
* [x] 持续完善代码
* [x] 增加业务隔离机制
* [x] 增加邮箱账号管理功能
* [x] 增加邮件模板管理功能
* [ ] 支持异步发送功能
* [ ] 增加异步队列满之后的阻塞选项
* [ ] 支持邮件中携带附件
* [ ] TLS 证书支持
* [ ] 增加监控上报
* [ ] ~~SMTP 连接池优化~~
> 由于库本身的性质并不太好支持连接复用,因此暂时取消这个特性的支持

### v0.3.x

* [ ] dialer 对象池或连接池优化 (P0)
* [ ] 支持邮件中携带附件 (P0)
* [ ] 增加监控上报 (P1)
* [ ] TLS 证书支持 (P1)
* [x] 增加 http 远程调用接口 (P0)
* [x] 增加 grpc 远程调用接口 (P0)
* [ ] 增加 vex 远程调用接口 (P1)
* [ ] 考虑增加异步任务回调机制 (P2)
* [x] 增加 http 远程调用接口
* [x] 增加 grpc 远程调用接口

### v0.1.x - v0.2.x

Expand Down
10 changes: 10 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## ✒ 历史版本的特性介绍 (Features in old versions)

### v0.4.0-alpha

> 此版本发布于 2024-03-07
* 祝我家宝贝女神节快乐
* 持续完善代码
* 增加业务隔离机制
* 增加邮箱账号管理功能
* 增加邮件模板管理功能

### v0.3.2-alpha

> 此版本发布于 2022-09-23
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 FishGoddess
Copyright (c) 2023 infra-io

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
Expand Down
30 changes: 19 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
.PHONY: test run linux windows darwin build clean all

VERSION=v0.3.2-alpha
CONFIG_FILE=./_examples/config/postar.ini
.PHONY: test fmt proto postar postaradmin linux windows darwin build clean all

VERSION=v0.4.0-alpha

test:
go mod tidy
go test -cover ./...

run:
fmt:
go fmt ./...

proto:
cd api && buf build && buf generate

postar:
go mod tidy
go run cmd/postar/main.go -conf ./configs/postar.toml

postaradmin:
go mod tidy
go run cmd/postar/main.go -config.file $(CONFIG_FILE)
go run cmd/postar-admin/main.go -conf ./configs/postar_admin.toml

linux:
./build.sh linux amd64 postar $(VERSION)
./build.sh $(VERSION) linux amd64

windows:
./build.sh windows amd64 postar.exe $(VERSION)
./build.sh $(VERSION) windows amd64

darwin:
./build.sh darwin amd64 postar $(VERSION)
mac:
./build.sh $(VERSION) darwin amd64

build:
go mod tidy
make linux && make windows && make darwin
make linux && make windows && make mac

clean:
rm -rf ./target
Expand Down
36 changes: 9 additions & 27 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# 📝 Postar

[![build](_icons/build.svg)](_icons/build.svg)
[![coverage](_icons/coverage.svg)](_icons/coverage.svg)
[![license](_icons/license.svg)](https://opensource.org/licenses/MIT)
[![coverage](_icons/coverage.svg)](_icons/coverage.svg)
![build](https://github.com/infra-io/postar/actions/workflows/check.yml/badge.svg)

**Postar** is an easy-to-use and low-coupling email service, which can provide email functions for your applications.

[阅读中文版的 Read me](./README.md)

### 🥇 Features

* Plain and Html form email supports
* Plain and HTML form email supports
* Synchronous/Asynchronous mode supports, and timeout is available in synchronous mode
* Support http/http2/grpc/vex/udp protocol
* Support http/grpc protocol
* Gracefully shutdown with signal mechanism

_Check [HISTORY.md](./HISTORY.md) and [FUTURE.md](./FUTURE.md) to know about more information._
Expand All @@ -21,36 +21,18 @@ _Check [HISTORY.md](./HISTORY.md) and [FUTURE.md](./FUTURE.md) to know about mor

1. Use Docker (recommend)

Installation manual: [Gitee](https://gitee.com/avino-plan/postar-docker)
/ [GitHub](https://github.com/avino-plan/postar-docker) .

Docker Hub: [https://hub.docker.com/r/fishgoddess/postar](https://hub.docker.com/r/fishgoddess/postar).
See more information in [docker hub](https://hub.docker.com/r/fishgoddess/postar).

2. Use source code

Postar has two ways to get binary:

1. Invoking `make build` in the root of source code will generate target directory, which contains all binary files.
Execute `make build` in the root of source code will generate target directory, which contains all binary files.

2. Building by `go build` (or running by `go run`) in `cmd/postar`, see `go`.
_Notice 1: Default config file are `postar.toml` and `postar-admin.toml`, default log file are `postar.log` and `postar-admin.log`._

_Notice: Default config file is `./postar.ini`, default log output directory is `./log/postar.log`._
_Notice 2: Postar needs mysql to store some configurations about email, so you should create tables in `postar.sql` which will record all changes._

> Want to know how to use? See [_examples](_examples).
> Client: [Gitee](https://gitee.com/avino-plan/postar-client) or [Github](https://github.com/avino-plan/postar-client).
_Notice 3: How to use client in [Gitee](https://gitee.com/infra-io/postar-client) or [GitHub](https://github.com/infra-io/postar-client)._

### 👥 Contributing

If you find that something is not working as expected please open an _**issue**_.

### 📦 Projects postar used

| Project | Author | Description | link |
|------------|---------------|-------------------------------------------------------|-------------------------------------------------------------------------------------------------|
| logit | FishGoddess | A high-performance and easy-to-use logging foundation | [Gitee](https://gitee.com/go-logit/logit) / [GitHub](https://github.com/go-logit/logit) |
| errors | FishGoddess | A lib for handling error gracefully in Go | [Gitee](https://gitee.com/FishGoddess/errors) / [GitHub](https://github.com/FishGoddess/errors) |
| ants | panjf2000 | A high-performance and low-cost goroutine pool | [GitHub](https://github.com/panjf2000/ants) |
| gomail | alexcesaro | The best way to send emails in Go | [GitHub](https://github.com/go-gomail/gomail/tree/v2) |
| ini | unknwon | Provides INI file read and write functionality in Go | [GitHub](https://github.com/go-ini/ini) |
| httprouter | julienschmidt | A high performance HTTP request router | [GitHub](https://github.com/julienschmidt/httprouter) |
35 changes: 9 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 📝 Postar
# 📧 Postar

[![build](_icons/build.svg)](_icons/build.svg)
[![coverage](_icons/coverage.svg)](_icons/coverage.svg)
[![license](_icons/license.svg)](https://opensource.org/licenses/MIT)
[![coverage](_icons/coverage.svg)](_icons/coverage.svg)
![Test And Build](https://github.com/infra-io/postar/actions/workflows/check.yml/badge.svg)

**Postar** 是一个简单易用且低耦合的邮件服务,可以为您的应用程序提供邮件功能。

Expand All @@ -12,7 +12,7 @@

* 支持发送文本邮件和 HTML 邮件
* 支持同步、异步邮件发送,同步模式可配置超时
* 支持 http/http2/grpc/vex/udp 等网络协议
* 支持 http/grpc 等网络协议
* 支持 signal 通知的平滑下线

_历史版本的特性请查看 [HISTORY.md](./HISTORY.md)。未来版本的新特性和计划请查看 [FUTURE.md](./FUTURE.md)_
Expand All @@ -21,35 +21,18 @@ _历史版本的特性请查看 [HISTORY.md](./HISTORY.md)。未来版本的新

* 使用 Docker 的方式(推荐)

Docker 版本安装请看:[码云](https://gitee.com/avino-plan/postar-docker) / [GitHub](https://github.com/avino-plan/postar-docker)

访问 Docker Hub 上的主页:[https://hub.docker.com/r/fishgoddess/postar](https://hub.docker.com/r/fishgoddess/postar)
具体信息参考请 [docker hub](https://hub.docker.com/r/fishgoddess/postar)

* 使用源码包的方式

Postar 的二进制执行包可以通过源码进行编译得到,一共有两种方式:

1. 在源码根目录执行 `make build` 会生成 target 目录,所有的二进制包都在里面。
在源码根目录执行 `make build` 会生成 target 目录,所有的二进制包都在里面。

2.`cmd/postar` 目录下使用 `go build` 构建服务(或 `go run` 启动服务),参考 `go` 命令。
_注意事项 1:默认的配置文件是 `postar.toml``postar-admin.toml`,默认的日志文件是 `postar.log``postar-admin.log`_

_注意:默认的配置文件路径是 `./postar.ini`,默认的日志输出是 `./log/postar.log`_
_注意事项 2:服务依赖 mysql 组件存储邮件相关配置,需要先在 mysql 上创建对应的库表,具体 sql 可以查看 `postar.sql`,后续库表变更也会体现在该文件中_

> 想知道怎么使用?查看 [_examples](_examples)
> 客户端:[码云](https://gitee.com/avino-plan/postar-client)[Github](https://github.com/avino-plan/postar-client)
_注意事项 3:客户端使用请查看 [码云](https://gitee.com/infra-io/postar-client)[GitHub](https://github.com/infra-io/postar-client)_

### 👥 贡献者

如果您觉得 **postar** 缺少您需要的功能,请不要犹豫,马上参与进来,发起一个 _**issue**_

### 📦 Postar 使用的技术

| 项目 | 作者 | 描述 | 链接 |
|------------|---------------|------------------------|----------------------------------------------------------------------------------------------|
| logit | FishGoddess | 一个高性能、功能强大且极易上手的日志库 | [码云](https://gitee.com/go-logit/logit) / [GitHub](https://github.com/go-logit/logit) |
| errors | FishGoddess | 一个用于优雅地处理 Go 中错误的库 | [码云](https://gitee.com/FishGoddess/errors) / [GitHub](https://github.com/FishGoddess/errors) |
| ants | panjf2000 | 一个高性能且低损耗的 goroutine 池 | [GitHub](https://github.com/panjf2000/ants) |
| gomail | alexcesaro | 一个用于在 Go 中发送邮件的库 | [GitHub](https://github.com/go-gomail/gomail/tree/v2) |
| ini | unknwon | 一个操作 ini 配置的库 | [GitHub](https://github.com/go-ini/ini) |
| httprouter | julienschmidt | 一个高性能的 http 路由库 | [GitHub](https://github.com/julienschmidt/httprouter) |
34 changes: 0 additions & 34 deletions _examples/config/postar.ini

This file was deleted.

48 changes: 0 additions & 48 deletions _examples/grpc.go

This file was deleted.

61 changes: 0 additions & 61 deletions _examples/http.go

This file was deleted.

16 changes: 0 additions & 16 deletions _icons/build.svg

This file was deleted.

Loading

0 comments on commit 0c4b299

Please sign in to comment.