-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from myrunes/dev
release v1.5.0
- Loading branch information
Showing
49 changed files
with
3,173 additions
and
810 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
|
||
build_backend: | ||
name: Build Back End | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.13 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13 | ||
id: go | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v1 | ||
|
||
- name: Get dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
- name: Build Backend | ||
run: | | ||
go build -v ./cmd/server/*.go | ||
build_frontend: | ||
name: Build Front End | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Use Node.js 13.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 13.x | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v1 | ||
|
||
- name: Get dependencies | ||
working-directory: ./web | ||
run: | | ||
npm ci | ||
- name: Build Front End Files | ||
working-directory: ./web | ||
run: | | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/myrunes/myrunes/pkg/comparison" | ||
) | ||
|
||
func main() { | ||
fmt.Println(comparison.Alphabetically("ac", "ab")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package mailserver | ||
|
||
import ( | ||
"gopkg.in/gomail.v2" | ||
) | ||
|
||
type Config struct { | ||
Host string `json:"host"` | ||
Port int `json:"port"` | ||
Username string `json:"username"` | ||
Password string `json:"password"` | ||
} | ||
|
||
type MailServer struct { | ||
dialer *gomail.Dialer | ||
|
||
defFrom string | ||
defFromName string | ||
} | ||
|
||
func NewMailServer(config *Config, defFrom, defFromName string) (*MailServer, error) { | ||
ms := new(MailServer) | ||
ms.dialer = gomail.NewPlainDialer(config.Host, config.Port, config.Username, config.Password) | ||
|
||
closer, err := ms.dialer.Dial() | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
defer closer.Close() | ||
|
||
ms.defFrom = defFrom | ||
ms.defFromName = defFromName | ||
|
||
return ms, nil | ||
} | ||
|
||
func (ms *MailServer) SendMailRaw(msg *gomail.Message) error { | ||
return ms.dialer.DialAndSend(msg) | ||
} | ||
|
||
func (ms *MailServer) SendMail(from, fromName, to, subject, body, bodyType string) error { | ||
if from == "" { | ||
from = ms.defFrom | ||
} | ||
|
||
if fromName == "" { | ||
fromName = ms.defFromName | ||
} | ||
|
||
msg := gomail.NewMessage() | ||
msg.SetAddressHeader("From", from, fromName) | ||
msg.SetAddressHeader("To", to, "") | ||
msg.SetHeader("Subject", subject) | ||
msg.SetBody(bodyType, body) | ||
return ms.SendMailRaw(msg) | ||
} | ||
|
||
func (ms *MailServer) SendMailFromDef(to, subject, body, bodyType string) error { | ||
return ms.SendMail("", "", to, subject, body, bodyType) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.