Rename the module, proto service, and all identifiers from simple_bank/ SimpleBank to api_tmpl/ApiTmpl, and regenerate the gRPC/gateway/swagger/ mock code accordingly. - Scrub real secrets (SMTP password, auth token secret) from api.env/ api_test.env, untrack them, and add api.env.example/api_test.env.example - Remove committed build artifacts (tmp/main, tmp/build-errors.log, dbml-error.log) and gitignore them going forward - Fix Dockerfile paths (build target, migrations copy) that referenced a stale project layout - Rewrite README to match the actual cmd/ + internal/ structure and add a "using this as a template" section
28 lines
965 B
Go
28 lines
965 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
|
|
db "github.com/FernandoJVideira/api_tmpl/internal/db/sqlc"
|
|
)
|
|
|
|
type UserService interface {
|
|
CreateUser(ctx context.Context, params RegisterUserRequest) (*RegisterUserResponse, error)
|
|
GetUser(ctx context.Context, username string) (*db.User, error)
|
|
UpdateUser(ctx context.Context, params UserUpdateRequest) (*db.User, error)
|
|
UpdatePassword(ctx context.Context, params PasswordUpdateRequest) (*db.User, error)
|
|
VerifyEmail(ctx context.Context, params EmailVerificationRequest) (*EmailVerificationResponse, error)
|
|
}
|
|
|
|
// AuthService defines operations related to authentication
|
|
type AuthService interface {
|
|
Login(ctx context.Context, params LoginCredentials) (*LoginResponse, error)
|
|
RenewAccessToken(ctx context.Context, params TokenRenewalRequest) (*TokenRenewalResponse, error)
|
|
}
|
|
|
|
// Ensure implementations satisfy interfaces at compile time
|
|
var (
|
|
_ UserService = (*userService)(nil)
|
|
_ AuthService = (*authService)(nil)
|
|
)
|