Skip to content

Commit

Permalink
stripe down, get basic grpc working
Browse files Browse the repository at this point in the history
  • Loading branch information
danthegoodman1 committed Jul 11, 2024
1 parent 7633795 commit 0daaa10
Show file tree
Hide file tree
Showing 32 changed files with 263 additions and 2,703 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GoAPITemplate
# EpicEpoch

## Log Context

Expand Down
50 changes: 2 additions & 48 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,7 @@ tasks:
single-test:
cmds:
- go test --count=1 -v {{.CLI_ARGS}}
# task single-test -- ./emailing -run TestSendEmail
# - go test --count=1 -v ./... -run {{.CLI_ARGS}}
# task single-test -- TestName

install-deps:
gen:
cmds:
- go install github.com/rubenv/sql-migrate/...@{{.sql_migrate_version}}
- go install github.com/kyleconroy/sqlc/cmd/sqlc@{{.sql_c_version}}

sql-up:
preconditions:
- msg: set env CRDB_DSN and SQL_ENV to local,staging,prod,development
sh: echo $SQL_ENV | grep .
cmds:
- sql-migrate up --env=$SQL_ENV
- task: sql-status

sql-down:
preconditions:
- msg: set env CRDB_DSN and SQL_ENV to local,staging,prod,development
sh: echo $SQL_ENV | grep .
cmds:
- sql-migrate down --env=$SQL_ENV
- task: sql-status

sql-status:
preconditions:
- msg: set env CRDB_DSN and SQL_ENV to local,staging,prod,development
sh: echo $SQL_ENV | grep .
cmds:
- sql-migrate status --env=$SQL_ENV

sql-gen:
desc: generate typed methods for SQL execution
silent: true
cmds:
# concatenates all migrations but drops the "migrate down" parts
- ls migrations/*.sql migrations/*.sql.later | xargs -n1 sed '/^-- +migrate Down/ ,$d' > schema.sql
# There are a bunch of SQL features that don't matter for SQLC but break their parser
- sed -i -e 's/ON UPDATE NOW[(][)]//g' schema.sql
- sed -i -e 's/CREATE DATABASE.*//g' schema.sql
- sed -i -e 's/CREATE INDEX.*//g' schema.sql
- sed -i -e 's/CREATE USER.*//g' schema.sql
- sed -i -e 's/GRANT.*//g' schema.sql
- sed -i -e 's/DESC//g' schema.sql
- sed -i -e 's/USING HASH.*//g' schema.sql
- rm -f query/*.sql.go
- sqlc generate
- rm schema.sql*
- echo done
- buf generate
15 changes: 15 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: v2
managed:
enabled: true
override:
- file_option: go_package_prefix
value: github.com/bufbuild/buf-tour/gen
plugins:
- remote: buf.build/protocolbuffers/go
out: proto
opt: paths=source_relative
# - remote: buf.build/connectrpc/go
# out: gen
# opt: paths=source_relative
inputs:
- directory: proto
9 changes: 9 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v2
modules:
- path: proto
lint:
use:
- DEFAULT
breaking:
use:
- FILE
39 changes: 0 additions & 39 deletions crdb/crdb.go

This file was deleted.

23 changes: 0 additions & 23 deletions dbconfig.yml

This file was deleted.

25 changes: 1 addition & 24 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/danthegoodman1/GoAPITemplate
module github.com/danthegoodman1/EpicEpoch

go 1.22

Expand All @@ -9,46 +9,30 @@ require (
github.com/google/uuid v1.3.1
github.com/jackc/pgtype v1.12.0
github.com/jackc/pgx/v5 v5.4.3
github.com/joho/godotenv v1.5.1
github.com/labstack/echo/v4 v4.11.1
github.com/matoous/go-nanoid/v2 v2.0.0
github.com/prometheus/client_golang v1.16.0
github.com/rs/zerolog v1.29.1
github.com/rubenv/sql-migrate v1.2.0
github.com/samber/lo v1.38.1
github.com/segmentio/ksuid v1.0.4
github.com/stretchr/testify v1.8.4
github.com/uber-go/tally/v4 v4.1.7
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
go.temporal.io/api v1.21.0
go.temporal.io/sdk v1.23.1
go.temporal.io/sdk/contrib/opentelemetry v0.2.0
go.temporal.io/sdk/contrib/tally v0.2.0
golang.org/x/net v0.17.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
github.com/go-gorp/gorp/v3 v3.0.2 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/gogo/status v1.1.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
Expand All @@ -60,15 +44,10 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/robfig/cron v1.2.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/twmb/murmur3 v1.1.5 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
Expand All @@ -77,7 +56,6 @@ require (
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/text v0.13.0 // indirect
Expand All @@ -86,5 +64,4 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 0daaa10

Please sign in to comment.