Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/Sirneij/go-auth
/ functions
Functions
93 in github.com/Sirneij/go-auth
⨍
Functions
93
◇
Types & classes
18
↓ 31 callers
Method
serverErrorResponse
(w http.ResponseWriter, r *http.Request, err error)
go-auth-backend/cmd/api/errors.go:27
↓ 26 callers
Method
badRequestResponse
(w http.ResponseWriter, r *http.Request, err error)
go-auth-backend/cmd/api/errors.go:43
↓ 16 callers
Method
logError
(r *http.Request, err error)
go-auth-backend/cmd/api/errors.go:10
↓ 14 callers
Method
String
()
go-auth-backend/internal/jsonlog/jsonlog.go:21
↓ 13 callers
Method
PrintInfo
(message string, properties map[string]string, debug bool)
go-auth-backend/internal/jsonlog/jsonlog.go:44
↓ 12 callers
Method
PrintError
(err error, properties map[string]string, debug bool)
go-auth-backend/internal/jsonlog/jsonlog.go:47
↓ 10 callers
Method
unauthorizedResponse
(w http.ResponseWriter, r *http.Request, err error)
go-auth-backend/cmd/api/errors.go:47
↓ 9 callers
Method
Check
Check adds an error message to the map only if a validation check is not 'ok'.
go-auth-backend/internal/validator/validator.go:29
↓ 9 callers
Method
failedValidationResponse
(w http.ResponseWriter, r *http.Request, errors map[string]string)
go-auth-backend/cmd/api/errors.go:52
↓ 9 callers
Function
formatError
(obj)
frontend/src/lib/utils/helpers.js:75
↓ 7 callers
Method
readJSON
(w http.ResponseWriter, r *http.Request, dst interface{})
go-auth-backend/cmd/api/helpers.go:40
↓ 7 callers
Method
successResponse
(w http.ResponseWriter, r *http.Request, status int, message interface{})
go-auth-backend/cmd/api/success.go:17
↓ 7 callers
Method
writeJSON
(w http.ResponseWriter, status int, data interface{}, headers http.Header)
go-auth-backend/cmd/api/helpers.go:20
↓ 6 callers
Method
Set
(plaintextPassword string)
go-auth-backend/internal/data/user_password.go:9
↓ 6 callers
Method
Valid
Valid returns true if the errors map doesn't contain any entries.
go-auth-backend/internal/validator/validator.go:17
↓ 6 callers
Method
errorResponse
(w http.ResponseWriter, r *http.Request, status int, message interface{})
go-auth-backend/cmd/api/errors.go:17
↓ 6 callers
Method
extractParamsFromSession
(r *http.Request)
go-auth-backend/cmd/api/helpers.go:143
↓ 5 callers
Method
Scan
Scan implements the Scanner interface for NullTime
go-auth-backend/internal/types/time.go:16
↓ 5 callers
Method
getFromRedis
(key string)
go-auth-backend/cmd/api/helpers.go:123
↓ 5 callers
Method
logSuccess
(r *http.Request, status int, message interface{})
go-auth-backend/cmd/api/success.go:9
↓ 4 callers
Method
Get
(id uuid.UUID)
go-auth-backend/internal/data/user_queries.go:57
↓ 4 callers
Method
PrintFatal
(err error, properties map[string]string, debug bool)
go-auth-backend/internal/jsonlog/jsonlog.go:50
↓ 4 callers
Function
isEmpty
(obj)
frontend/src/lib/utils/helpers.js:63
↓ 4 callers
Method
print
(level Level, message string, properties map[string]string, debugEnv bool)
go-auth-backend/internal/jsonlog/jsonlog.go:54
↓ 4 callers
Method
storeInRedis
(prefix string, hash string, userID uuid.UUID, expiration time.Duration)
go-auth-backend/cmd/api/helpers.go:108
↓ 3 callers
Method
GetEmail
(email string, active bool)
go-auth-backend/internal/data/user_queries.go:182
↓ 3 callers
Method
Send
(recipient, templateFile string, data interface{})
go-auth-backend/internal/mailer/mailer.go:29
↓ 3 callers
Method
background
(fn func())
go-auth-backend/cmd/api/helpers.go:91
↓ 3 callers
Function
isValidEmail
(email)
frontend/src/lib/utils/helpers.js:29
↓ 2 callers
Method
AddError
AddError adds an error message to the map (so long as no entry already exists for // the given key).
go-auth-backend/internal/validator/validator.go:22
↓ 2 callers
Method
Matches
(plaintextPassword string)
go-auth-backend/internal/data/user_password.go:19
↓ 2 callers
Method
Write
(message []byte)
go-auth-backend/internal/jsonlog/jsonlog.go:87
↓ 2 callers
Function
isValidPasswordMedium
(password)
frontend/src/lib/utils/helpers.js:49
↓ 2 callers
Method
readIDParam
(r *http.Request)
go-auth-backend/cmd/api/helpers.go:134
↓ 1 callers
Method
ActivateUser
(userID uuid.UUID)
go-auth-backend/internal/data/user_queries.go:86
↓ 1 callers
Method
Insert
(user *User)
go-auth-backend/internal/data/user_queries.go:13
↓ 1 callers
Function
Read
(r *http.Request, name string)
go-auth-backend/internal/cookies/cookies.go:32
↓ 1 callers
Method
Update
(user *User)
go-auth-backend/internal/data/user_queries.go:114
↓ 1 callers
Method
UpdateUserPassword
(user *User)
go-auth-backend/internal/data/user_queries.go:100
↓ 1 callers
Function
ValidateEmail
(v *validator.Validator, email string)
go-auth-backend/internal/data/user_validation.go:5
↓ 1 callers
Function
ValidatePasswordPlaintext
(v *validator.Validator, password string)
go-auth-backend/internal/data/user_validation.go:10
↓ 1 callers
Function
Write
(w http.ResponseWriter, cookie http.Cookie)
go-auth-backend/internal/cookies/cookies.go:20
↓ 1 callers
Method
authenticateAndAuthorize
(next http.Handler)
go-auth-backend/cmd/api/middleware.go:44
↓ 1 callers
Method
deleteFileFromS3
(r *http.Request)
go-auth-backend/cmd/api/s3_utils.go:52
↓ 1 callers
Function
fetchMetrics
()
frontend/src/routes/auth/admin/+page.server.js:11
↓ 1 callers
Method
metrics
(next http.Handler)
go-auth-backend/cmd/api/middleware.go:25
↓ 1 callers
Function
openDB
(cfg config)
go-auth-backend/cmd/api/db.go:11
↓ 1 callers
Method
recoverPanic
(next http.Handler)
go-auth-backend/cmd/api/middleware.go:13
↓ 1 callers
Method
routes
()
go-auth-backend/cmd/api/routes.go:10
↓ 1 callers
Method
serve
()
go-auth-backend/cmd/api/server.go:16
↓ 1 callers
Function
updateConfigWithEnvVariables
()
go-auth-backend/cmd/api/config.go:15
↓ 1 callers
Method
uploadFileToS3
(r *http.Request)
go-auth-backend/cmd/api/s3_utils.go:16
Function
FormatOTP
(s string)
go-auth-backend/internal/tokens/utils.go:40
Function
GenerateOTP
()
go-auth-backend/internal/tokens/utils.go:19
Function
In
In returns true if a specific value is in a list of strings.
go-auth-backend/internal/validator/validator.go:36
Method
MarshalJSON
MarshalJSON for NullTime
go-auth-backend/internal/types/time.go:33
Function
Matches
Matches returns true if a string value matches a specific regexp pattern.
go-auth-backend/internal/validator/validator.go:46
Function
New
(host string, port int, username, password, sender string)
go-auth-backend/internal/mailer/mailer.go:20
Function
New
New is a helper which creates a new Validator instance with an empty errors map.
go-auth-backend/internal/validator/validator.go:12
Function
New
(out io.Writer, minLevel Level)
go-auth-backend/internal/jsonlog/jsonlog.go:40
Function
NewModels
(db *sql.DB)
go-auth-backend/internal/data/models.go:16
Function
ReadEncrypted
(r *http.Request, name string, secretKey []byte)
go-auth-backend/internal/cookies/cookies.go:72
Function
Unique
Unique returns true if all string values in a slice are unique.
go-auth-backend/internal/validator/validator.go:51
Method
UnmarshalJSON
UnmarshalJSON for NullTime
go-auth-backend/internal/types/time.go:44
Function
ValidateSecret
(v *validator.Validator, secret string)
go-auth-backend/internal/tokens/utils.go:49
Function
ValidateUser
(v *validator.Validator, user *User)
go-auth-backend/internal/data/user_validation.go:16
Function
WriteEncrypted
(w http.ResponseWriter, cookie http.Cookie, secretKey []byte)
go-auth-backend/internal/cookies/cookies.go:46
Method
activateUserHandler
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/activate.go:14
Method
changePasswordHandler
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/change_password.go:15
Method
currentUserHandler
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/current_user.go:9
Method
deleteFileOnS3Handler
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/delete_image_s3.go:8
Function
fallback
(node, params)
frontend/src/lib/utils/helpers.js:9
Function
handle
({ event, resolve })
frontend/src/hooks.server.js:4
Method
healthcheckHandler
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/healthcheck.go:8
Function
isValidPasswordStrong
(password)
frontend/src/lib/utils/helpers.js:39
Function
load
({ fetch, url, data })
frontend/src/routes/+layout.js:2
Function
load
({ locals })
frontend/src/routes/+layout.server.js:2
Function
load
({ locals })
frontend/src/routes/auth/register/+page.server.js:6
Function
load
({ locals, params })
frontend/src/routes/auth/about/[id]/+page.server.js:6
Function
load
({ locals })
frontend/src/routes/auth/login/+page.server.js:6
Function
load
({ locals })
frontend/src/routes/auth/logout/+page.server.js:5
Function
load
({ locals })
frontend/src/routes/auth/activate/[id]/+page.server.js:6
Function
load
({ locals, cookies })
frontend/src/routes/auth/admin/+page.server.js:5
Method
loginUserHandler
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/login.go:13
Method
logoutUserHandler
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/logout.go:11
Function
main
()
go-auth-backend/cmd/api/main.go:71
Method
methodNotAllowedResponse
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/errors.go:38
Method
notFoundResponse
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/errors.go:33
Method
regenerateTokenHandler
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/regenerate_token.go:13
Method
registerUserHandler
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/register.go:13
Method
requestChangePasswordHandler
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/request_password_change.go:16
Method
updateUserHandler
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/update_user.go:12
Method
uploadFileToS3Handler
(w http.ResponseWriter, r *http.Request)
go-auth-backend/cmd/api/upload_image_s3.go:8