mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 07:15:25 +00:00
update all the makefiles (#111)
* update all the makefiles * add back openapi * update cache package * fix cache * update go mod
This commit is contained in:
@@ -5,13 +5,14 @@ init:
|
||||
go get -u github.com/golang/protobuf/proto
|
||||
go get -u github.com/golang/protobuf/protoc-gen-go
|
||||
go get github.com/micro/micro/v3/cmd/protoc-gen-micro
|
||||
go get github.com/micro/micro/v3/cmd/protoc-gen-openapi
|
||||
.PHONY: proto
|
||||
proto:
|
||||
protoc --openapi_out=. --proto_path=. --micro_out=. --go_out=. proto/otp.proto
|
||||
|
||||
docs:
|
||||
protoc --openapi_out=. --proto_path=. --micro_out=. --go_out=. proto/otp.proto
|
||||
@redoc-cli bundle api-otp.json
|
||||
.PHONY: api
|
||||
api:
|
||||
protoc --openapi_out=. --proto_path=. proto/otp.proto
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
|
||||
@@ -38,7 +38,7 @@ func (e *Otp) Generate(ctx context.Context, req *pb.GenerateRequest, rsp *pb.Gen
|
||||
|
||||
secret = key.Secret()
|
||||
|
||||
if err := cache.Context(ctx).Put(req.Id, secret, time.Now().Add(time.Minute*5)); err != nil {
|
||||
if err := cache.Context(ctx).Set(req.Id, secret, time.Now().Add(time.Minute*5)); err != nil {
|
||||
logger.Error("Failed to store secret: %v", err)
|
||||
return errors.InternalServerError("otp.generate", "failed to generate code")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user