Skip to content

Commit

Permalink
Merge pull request #3 from gouline/cleanup
Browse files Browse the repository at this point in the history
Bringing dependencies up to date
  • Loading branch information
gouline authored Sep 3, 2024
2 parents 54a3692 + 0072d72 commit 38bb1b7
Show file tree
Hide file tree
Showing 604 changed files with 214 additions and 272,761 deletions.
7 changes: 0 additions & 7 deletions .gitattributes

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: master

on:
push:
branches:
- master
release:
types:
- created

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Use .env.example
run: cp .env.example .env

- name: Test
run: make test
18 changes: 18 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: pull_request

on:
pull_request:
branches:
- master

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Use .env.example
run: cp .env.example .env

- name: Test
run: make test
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

162 changes: 0 additions & 162 deletions Gopkg.lock

This file was deleted.

33 changes: 0 additions & 33 deletions Gopkg.toml

This file was deleted.

15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
include .env # Requires SLACK_CLIENT_ID and SLACK_CLIENT_SECRET

CMD=blaster
CMD := blaster

HOST ?= 127.0.0.1
PORT ?= 5001

$(CMD): clean
go build -o ./bin/$(CMD) ./cmd/$(CMD)

clean:
rm -f ./$(CMD)
rm -f ./bin/$(CMD)

test: $(CMD)
go test -v ./...

run: $(CMD)
GIN_MODE=debug PORT=5000 ./bin/$(CMD)

heroku: $(CMD)
heroku local
GIN_MODE=debug \
HOST=$(HOST) \
PORT=$(PORT) \
./bin/$(CMD)
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ Slack bot for sending out announcements.

## Running locally

Running the proper Heroku way is done as follows:

```
go get ./...
heroku local
```

However, there's nothing stopping you from running it like a normal Go app:

```
make run
```
10 changes: 8 additions & 2 deletions cmd/blaster/main.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package main

import (
"fmt"
"log"
"os"

gintemplate "github.com/foolin/gin-template"
"github.com/gin-gonic/gin"
_ "github.com/heroku/x/hmetrics/onload"
"github.com/gouline/blaster/internal/pkg/handlers"
)

func main() {
host := os.Getenv("HOST")
if host == "" {
host = "0.0.0.0"
log.Printf("$HOST can be set, defaulting to %s", host)
}

port := os.Getenv("PORT")
if port == "" {
port = "5000"
Expand Down Expand Up @@ -44,5 +50,5 @@ func main() {
apiGroup.GET("/suggest", handlers.APISuggest)
apiGroup.POST("/send", handlers.APISend)

router.Run(":" + port)
router.Run(fmt.Sprintf("%s:%s", host, port))
}
40 changes: 40 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module github.com/gouline/blaster

go 1.23.0

require (
github.com/foolin/gin-template v0.0.0-20190415034731-41efedfb393b
github.com/gin-gonic/gin v1.10.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/slack-go/slack v0.14.0
)

require (
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 38bb1b7

Please sign in to comment.