-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acb1f00
commit 2ab6dd9
Showing
28 changed files
with
2,864 additions
and
14 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,33 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS build | ||
|
||
ARG SERVICE_NAME=permission-service | ||
|
||
WORKDIR /build | ||
|
||
# Copy sources | ||
COPY . . | ||
|
||
WORKDIR /build/services/$SERVICE_NAME | ||
|
||
RUN go mod download | ||
|
||
WORKDIR /build | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg \ | ||
CGO_ENABLED=0 \ | ||
GOOS=$TARGETOS \ | ||
GOARCH=$TARGETARCH \ | ||
go build -ldflags="-s -w" -o $SERVICE_NAME ./services/$SERVICE_NAME/cmd/$SERVICE_NAME | ||
|
||
FROM alpine | ||
|
||
ARG SERVICE_NAME=permission-service | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=build /build/$SERVICE_NAME /build/services/$SERVICE_NAME/run ./ | ||
CMD ["./permission-service"] |
32 changes: 32 additions & 0 deletions
32
services/permission-service/cmd/permission-service/main.go
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,32 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/emortalmc/mono-services/services/permission-service/internal/app" | ||
"github.com/emortalmc/mono-services/services/permission-service/internal/config" | ||
"go.uber.org/zap" | ||
"log" | ||
) | ||
|
||
func main() { | ||
cfg := config.LoadGlobalConfig() | ||
|
||
unsugared, err := createLogger(cfg) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
logger := unsugared.Sugar() | ||
|
||
app.Run(cfg, logger) | ||
} | ||
|
||
func createLogger(cfg config.Config) (logger *zap.Logger, err error) { | ||
if cfg.Development { | ||
logger, err = zap.NewDevelopment() | ||
} else { | ||
logger, err = zap.NewProduction() | ||
} | ||
if err != nil { | ||
return nil, err | ||
} | ||
return logger, nil | ||
} |
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,78 @@ | ||
module github.com/emortalmc/mono-services/services/permission-service | ||
|
||
go 1.21 | ||
|
||
require ( | ||
github.com/emortalmc/proto-specs/gen/go v0.0.0-20240927103241-2584fd28e0f9 | ||
github.com/golang/mock v1.6.0 | ||
github.com/google/uuid v1.6.0 | ||
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1 | ||
github.com/ory/dockertest/v3 v3.10.0 | ||
github.com/segmentio/kafka-go v0.4.39 | ||
github.com/spf13/pflag v1.0.5 | ||
github.com/spf13/viper v1.19.0 | ||
github.com/stretchr/testify v1.9.0 | ||
go.mongodb.org/mongo-driver v1.17.1 | ||
go.uber.org/zap v1.27.0 | ||
google.golang.org/grpc v1.67.1 | ||
google.golang.org/protobuf v1.35.1 | ||
) | ||
|
||
require ( | ||
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect | ||
github.com/Microsoft/go-winio v0.6.0 // indirect | ||
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect | ||
github.com/containerd/continuity v0.3.0 // indirect | ||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect | ||
github.com/docker/cli v20.10.23+incompatible // indirect | ||
github.com/docker/docker v20.10.24+incompatible // indirect | ||
github.com/docker/go-connections v0.4.0 // indirect | ||
github.com/docker/go-units v0.5.0 // indirect | ||
github.com/fsnotify/fsnotify v1.7.0 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/golang/snappy v0.0.4 // indirect | ||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect | ||
github.com/hashicorp/hcl v1.0.0 // indirect | ||
github.com/imdario/mergo v0.3.13 // indirect | ||
github.com/klauspost/compress v1.17.2 // indirect | ||
github.com/magiconair/properties v1.8.7 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect | ||
github.com/montanaflynn/stats v0.7.1 // indirect | ||
github.com/opencontainers/go-digest v1.0.0 // indirect | ||
github.com/opencontainers/image-spec v1.0.2 // indirect | ||
github.com/opencontainers/runc v1.1.5 // indirect | ||
github.com/pelletier/go-toml/v2 v2.2.2 // indirect | ||
github.com/pierrec/lz4/v4 v4.1.15 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect | ||
github.com/rogpeppe/go-internal v1.10.0 // indirect | ||
github.com/sagikazarmark/locafero v0.4.0 // indirect | ||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect | ||
github.com/sirupsen/logrus v1.9.0 // indirect | ||
github.com/sourcegraph/conc v0.3.0 // indirect | ||
github.com/spf13/afero v1.11.0 // indirect | ||
github.com/spf13/cast v1.6.0 // indirect | ||
github.com/subosito/gotenv v1.6.0 // indirect | ||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect | ||
github.com/xdg-go/scram v1.1.2 // indirect | ||
github.com/xdg-go/stringprep v1.0.4 // indirect | ||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect | ||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect | ||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect | ||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect | ||
go.uber.org/multierr v1.10.0 // indirect | ||
golang.org/x/crypto v0.26.0 // indirect | ||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect | ||
golang.org/x/mod v0.17.0 // indirect | ||
golang.org/x/net v0.28.0 // indirect | ||
golang.org/x/sync v0.8.0 // indirect | ||
golang.org/x/sys v0.24.0 // indirect | ||
golang.org/x/text v0.17.0 // indirect | ||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect | ||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | ||
gopkg.in/ini.v1 v1.67.0 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Oops, something went wrong.