Skip to content

Commit

Permalink
WiP Various Changes
Browse files Browse the repository at this point in the history
- Removed Redis and replaced with in memory storage in go for faster and simpler access
- Updated schemas for database (added a few new ones)
- Cleaned up main and broke setup functions to another file
- Moved handlers to own package/folder
- A few other changes
  • Loading branch information
FM1337 committed Apr 7, 2024
1 parent eef1eae commit 6ba470f
Show file tree
Hide file tree
Showing 62 changed files with 10,675 additions and 2,275 deletions.
8 changes: 3 additions & 5 deletions .env-required
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
DB_URL=
ENV=production
CONFIGURED=false
REDIS_ADDR=
REDIS_PASSWORD=
REDIS_DB=


BOT_TOKEN=
BOT_OWNER_ID=
BOT_ERROR_CHANNEL=
BOT_ERROR_SERVER=
BOT_ERROR_CHANNEL_ID=
BOT_ERROR_SERVER_ID=
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.env
ASB
.vscode/settings.json
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
.DEFAULT_GOAL := build

export PROJECT := "ASB"
export PACKAGE := "github.com/FM1337/ASB"


VERSION=$(shell git describe --tags --always --abbrev=0 --match=v* 2> /dev/null | sed -r "s:^v::g" || echo 0)
VERSION_FULL=$(shell git describe --tags --always --dirty --match=v* 2> /dev/null | sed -r "s:^v::g" || echo 0)

$(info $(shell mkdir -p $(DIRS)))
BIN=$(CURDIR)/bin
export GOBIN=$(CURDIR)/bin

build: go-fetch go-build
@echo

go-prepare: go-fetch
go generate -x ./...

go-fetch:
go mod download
go mod tidy

go-upgrade-deps:
go get -u ./...
go mod tidy

go-upgrade-deps-patch:
go get -u=patch ./...
go mod tidy

go-dlv: go-prepare
dlv debug \
--headless --listen=:2345 \
--api-version=2 --log \
--allow-non-terminal-interactive \
${PACKAGE} -- --debug

go-debug: go-prepare
go run ${PACKAGE} --debug

go-debug-fast:
go run ${PACKAGE} --debug

go-build: go-prepare go-fetch
CGO_ENABLED=0 \
go build \
-ldflags '-d -s -w -extldflags=-static' \
-tags=netgo,osusergo,static_build \
-installsuffix netgo \
-buildvcs=false \
-trimpath \
-o ${PROJECT} \
${PACKAGE}
62 changes: 18 additions & 44 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,70 +1,44 @@
module github.com/FM1337/ASB

go 1.22.0
go 1.22.2

require (
entgo.io/ent v0.13.1
github.com/apex/log v1.9.0
github.com/bwmarrin/discordgo v0.28.1
github.com/jackc/pgx/v5 v5.5.5
github.com/lrstanley/clix v1.0.1
)

require (
ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43 // indirect
github.com/agext/levenshtein v1.2.1 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bwmarrin/discordgo v0.28.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
ariga.io/atlas v0.21.1 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/go-chi/chi/v5 v5.0.11 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-playground/form/v4 v4.2.1 // 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.16.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/go-openapi/inflect v0.21.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gookit/color v1.5.4 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/gorilla/sessions v1.2.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/hcl/v2 v2.13.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/hashicorp/hcl/v2 v2.20.1 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/jessevdk/go-flags v1.5.0 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/lrstanley/chix v1.0.3 // indirect
github.com/lrstanley/go-bogon v1.0.0 // indirect
github.com/markbates/goth v1.78.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/redis/go-redis/v9 v9.5.1 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/sethvargo/go-githubactions v1.2.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/zclconf/go-cty v1.8.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
github.com/zclconf/go-cty v1.14.4 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.32.0 // indirect
golang.org/x/tools v0.20.0 // indirect
)
Loading

0 comments on commit 6ba470f

Please sign in to comment.