MCPcopy Create free account

hub / github.com/dhax/go-base / functions

Functions190 in github.com/dhax/go-base

↓ 18 callersMethodRender
Render sets the application-specific error code in AppCode.
auth/pwdless/errors.go:29
↓ 13 callersMethodRender
Render sets the application-specific error code in AppCode.
api/app/errors.go:22
↓ 12 callersFunctionErrUnauthorized
ErrUnauthorized renders status 401 Unauthorized with custom error message.
auth/pwdless/errors.go:35
↓ 11 callersMethodRender
Render sets the application-specific error code in AppCode.
api/admin/errors.go:22
↓ 10 callersFunctionlog
(r *http.Request)
auth/pwdless/api.go:83
↓ 8 callersMethodGet
(accountID int)
api/app/profile.go:22
↓ 7 callersFunctionGetLogEntry
Helper methods used by the application to get the request-scoped logger entry and set additional fields between handlers. GetLogEntry return the reque
logging/logger.go:113
↓ 6 callersFunctionErrUnauthorized
ErrUnauthorized renders status 401 Unauthorized with custom error message.
auth/jwt/errors.go:37
↓ 6 callersMethodRender
Render sets the application-specific error code in AppCode.
auth/jwt/errors.go:31
↓ 5 callersMethodDelete
(*pwdless.Account)
api/admin/accounts.go:28
↓ 5 callersFunctionErrInvalidRequest
ErrInvalidRequest returns status 422 Unprocessable Entity including error message.
api/admin/errors.go:28
↓ 4 callersFunctionErrInvalidRequest
ErrInvalidRequest returns status 422 Unprocessable Entity including error message.
api/app/errors.go:28
↓ 4 callersMethodGet
(id int)
api/admin/accounts.go:26
↓ 4 callersMethodValidate
Validate validates Account struct and returns validation errors.
auth/pwdless/account.go:51
↓ 4 callersFunctiontestRequest
(t *testing.T, ts *httptest.Server, method, path string, body io.Reader, token string)
auth/pwdless/api_test.go:331
↓ 3 callersMethodCanLogin
CanLogin returns true if user is allowed to login.
auth/pwdless/account.go:63
↓ 3 callersMethodClaims
Claims returns the account's claims to be signed
auth/pwdless/account.go:68
↓ 3 callersFunctionClaimsFromCtx
ClaimsFromCtx retrieves the parsed AppClaims from request context.
auth/jwt/authenticator.go:23
↓ 3 callersFunctionErrRender
ErrRender returns status 422 Unprocessable Entity rendering response error.
api/app/errors.go:49
↓ 3 callersFunctionNewEmail
NewEmail returns an email address.
email/mailer.go:67
↓ 3 callersFunctionParseStructToMap
(c any)
auth/jwt/tokenauth.go:79
↓ 3 callersFunctionnewAccountResponse
(a *pwdless.Account)
api/admin/accounts.go:85
↓ 2 callersMethodBind
(r *http.Request)
auth/pwdless/api.go:91
↓ 2 callersMethodBind
(r *http.Request)
api/app/account.go:136
↓ 2 callersMethodBind
(r *http.Request)
api/admin/accounts.go:77
↓ 2 callersMethodCreateOrUpdateToken
(t *jwt.Token)
auth/pwdless/api.go:31
↓ 2 callersMethodCreateToken
CreateToken creates an in-memory login token referencing account ID. It returns a token containing a random tokenstring and expiry date.
auth/pwdless/logintoken.go:42
↓ 2 callersFunctionDBConn
DBConn returns a postgres connection pool.
database/postgres.go:16
↓ 2 callersMethodDeleteToken
(t *jwt.Token)
auth/pwdless/api.go:32
↓ 2 callersFunctionErrRender
ErrRender returns status 422 Unprocessable Entity rendering response error.
api/admin/errors.go:38
↓ 2 callersFunctionErrValidation
ErrValidation returns status 422 Unprocessable Entity stating validation errors.
api/app/errors.go:38
↓ 2 callersFunctionErrValidation
ErrValidation returns status 422 Unprocessable Entity stating validation errors.
api/admin/errors.go:48
↓ 2 callersMethodGenTokenPair
GenTokenPair returns both an access token and a refresh token.
auth/jwt/tokenauth.go:53
↓ 2 callersMethodGetAccount
(id int)
auth/pwdless/api.go:26
↓ 2 callersMethodGetToken
(token string)
auth/pwdless/api.go:30
↓ 2 callersFunctionNew
New configures application resources and routes.
api/api.go:25
↓ 2 callersFunctionNewLogger
NewLogger creates and configures a new logrus Logger.
logging/logger.go:24
↓ 2 callersFunctionNewMockMailer
()
email/mockMailer.go:15
↓ 2 callersFunctionNewResource
NewResource returns a configured authentication resource.
auth/pwdless/api.go:45
↓ 2 callersFunctionNewStructuredLogger
NewStructuredLogger implements a custom structured logrus Logger.
logging/logger.go:49
↓ 2 callersFunctionRefreshTokenFromCtx
RefreshTokenFromCtx retrieves the parsed refresh token from context.
auth/jwt/authenticator.go:28
↓ 2 callersMethodRouter
Router provides necessary routes for passwordless authentication flow.
auth/pwdless/api.go:69
↓ 2 callersMethodRouter
Router provides application routes.
api/app/api.go:44
↓ 2 callersMethodUpdate
(p *models.Profile)
api/app/profile.go:23
↓ 2 callersMethodUpdateAccount
(a *Account)
auth/pwdless/api.go:28
↓ 2 callersMethodVerifier
Verifier http middleware will verify a jwt string from a http request.
auth/jwt/tokenauth.go:48
↓ 2 callersMethodWrite
(status, bytes int, header http.Header, elapsed time.Duration, extra any)
logging/logger.go:91
↓ 2 callersMethoddelete
(token string)
auth/pwdless/logintoken.go:76
↓ 2 callersFunctionencode
(v any)
auth/pwdless/api_test.go:372
↓ 2 callersFunctiongenRefreshJWT
func genJWT(c jwt.AppClaims) string { claims, _ := jwt.ParseStructToMap(c) _, tokenString, _ := auth.TokenAuth.JwtAuth.Encode(claims) return tokenS
auth/pwdless/api_test.go:365
↓ 2 callersFunctionlog
(r *http.Request)
api/app/api.go:53
↓ 2 callersFunctionnewAccountResponse
(a *pwdless.Account)
api/app/account.go:91
↓ 2 callersFunctionnewProfileResponse
(p *models.Profile)
api/app/profile.go:73
↓ 2 callersMethodrouter
()
api/app/account.go:44
↓ 1 callersMethodApply
Apply applies an AccountFilter on a bun.SelectQuery.
database/admAccountStore.go:71
↓ 1 callersMethodBind
(r *http.Request)
api/app/profile.go:65
↓ 1 callersMethodClaims
Claims returns the token claims to be signed
auth/jwt/token.go:39
↓ 1 callersMethodCreate
(*pwdless.Account)
api/admin/accounts.go:25
↓ 1 callersMethodCreateJWT
CreateJWT returns an access token for provided account claims.
auth/jwt/tokenauth.go:66
↓ 1 callersMethodCreateRefreshJWT
CreateRefreshJWT returns a refresh token for provided token Claims.
auth/jwt/tokenauth.go:91
↓ 1 callersMethodDeleteToken
(*jwt.Token)
api/app/account.go:29
↓ 1 callersFunctionExecute
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the r
cmd/root.go:25
↓ 1 callersMethodGetAccountByEmail
(email string)
auth/pwdless/api.go:27
↓ 1 callersMethodGetAccountID
GetAccountID looks up the token by tokenstring and returns the account ID or error if token not found or expired.
auth/pwdless/logintoken.go:54
↓ 1 callersMethodList
(*database.AccountFilter)
api/admin/accounts.go:24
↓ 1 callersFunctionLoginTokenEmail
LoginTokenEmail creates and sends a login token email with provided template content.
auth/pwdless/emails.go:20
↓ 1 callersFunctionMigrate
Migrate runs all migrations
database/migrations/main.go:25
↓ 1 callersFunctionNewAPI
NewAPI configures and returns application API.
api/app/api.go:29
↓ 1 callersFunctionNewAPI
NewAPI configures and returns admin application API.
api/admin/api.go:33
↓ 1 callersFunctionNewAccountFilter
NewAccountFilter returns an AccountFilter with options parsed from request url values.
database/admAccountStore.go:43
↓ 1 callersFunctionNewAccountResource
NewAccountResource creates and returns an account resource.
api/app/account.go:38
↓ 1 callersFunctionNewAccountResource
NewAccountResource creates and returns an account resource.
api/admin/accounts.go:37
↓ 1 callersFunctionNewAccountStore
NewAccountStore returns an AccountStore.
database/accountStore.go:19
↓ 1 callersFunctionNewAdmAccountStore
NewAdmAccountStore returns an AccountStore.
database/admAccountStore.go:28
↓ 1 callersFunctionNewAuthStore
NewAuthStore return an AuthStore.
database/authStore.go:18
↓ 1 callersFunctionNewLoginTokenAuth
NewLoginTokenAuth configures and returns a LoginToken authentication instance.
auth/pwdless/logintoken.go:31
↓ 1 callersFunctionNewMailer
NewMailer returns a configured SMTP Mailer.
email/smtp.go:15
↓ 1 callersFunctionNewProfileResource
NewProfileResource creates and returns a profile resource.
api/app/profile.go:32
↓ 1 callersFunctionNewProfileStore
NewProfileStore returns a ProfileStore implementation.
database/profileStore.go:17
↓ 1 callersFunctionNewServer
NewServer creates and configures an APIServer serving all application routes.
api/server.go:20
↓ 1 callersFunctionNewTokenAuth
NewTokenAuth configures and returns a JWT authentication instance.
auth/jwt/tokenauth.go:20
↓ 1 callersMethodParseClaims
ParseClaims parses JWT claims into AppClaims.
auth/jwt/claims.go:23
↓ 1 callersMethodParseClaims
ParseClaims parses the JWT claims into RefreshClaims.
auth/jwt/claims.go:60
↓ 1 callersMethodPurgeExpiredToken
()
auth/pwdless/api.go:33
↓ 1 callersMethodRender
Render sets the application-specific error code in AppCode.
auth/authorize/errors.go:20
↓ 1 callersFunctionRequiresRole
RequiresRole middleware restricts access to accounts having role parameter in their jwt claims.
auth/authorize/roles.go:13
↓ 1 callersFunctionSPAHandler
SPAHandler serves the public Single Page Application.
api/api.go:106
↓ 1 callersMethodSend
(Message)
email/mailer.go:21
↓ 1 callersMethodStart
Start runs ListenAndServe on the http.Server with graceful shutdown.
api/server.go:46
↓ 1 callersMethodUpdate
(*pwdless.Account)
api/admin/accounts.go:27
↓ 1 callersMethodUpdateToken
(*jwt.Token)
api/app/account.go:28
↓ 1 callersMethodValidate
Validate validates Profile struct and returns validation errors.
models/profile.go:34
↓ 1 callersMethodadd
(lt LoginToken)
auth/pwdless/logintoken.go:70
↓ 1 callersFunctioncheckConn
(db *bun.DB)
database/postgres.go:36
↓ 1 callersMethodchoresTicker
()
auth/pwdless/chores.go:9
↓ 1 callersFunctioncorsConfig
()
api/api.go:90
↓ 1 callersFunctiongenRoutesDoc
()
cmd/gendoc.go:49
↓ 1 callersMethodget
(token string)
auth/pwdless/logintoken.go:63
↓ 1 callersFunctionhasRole
(role string, roles []string)
auth/authorize/roles.go:27
↓ 1 callersFunctionlog
(r *http.Request)
api/admin/api.go:57
next →1–100 of 190, ranked by callers