Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/atahani/golang-rest-api-sample
/ functions
Functions
59 in github.com/atahani/golang-rest-api-sample
⨍
Functions
59
◇
Types & classes
17
↓ 16 callers
Function
New
(httpCode int, code int, message string, description string)
util/specialerror/specialerror.go:35
↓ 9 callers
Method
Bind
(i interface{}, c echo.Context)
util/echo_binder.go:23
↓ 5 callers
Method
Error
()
util/specialerror/specialerror.go:39
↓ 5 callers
Function
NewArticleController
(s *mgo.Session, dbName string)
controller/article/article_controller.go:27
↓ 5 callers
Function
NewClientController
(s *mgo.Session, dbName string)
controller/client/client_controller.go:29
↓ 5 callers
Function
NewUserController
(s *mgo.Session, dbName string)
controller/user/user_controller.go:40
↓ 4 callers
Method
HashedAppKey
()
models/client.go:21
↓ 3 callers
Method
ClientAuthorization
(s *mgo.Session, dbName, appId, appKey string)
controller/client/client_controller.go:33
↓ 3 callers
Function
New
(message, description string)
util/operationresult/operationresult.go:14
↓ 3 callers
Method
StartTesting
()
util/testhelper/testhelper.go:26
↓ 3 callers
Function
generateAccessToken
(s *mgo.Session, dbName string, u *models.User, clientId, trustedAppId bson.ObjectId, deviceModel string, isRe
controller/user/user_controller.go:321
↓ 2 callers
Method
CreateNewClient
(c echo.Context)
controller/client/client_controller.go:64
↓ 2 callers
Function
rand_char
random char string with length and bytes sets
util/genrandom.go:45
↓ 1 callers
Function
AuthorizeUserByRolesMiddleware
echo middleware to check is this user have role
controller/user/user_controller.go:95
↓ 1 callers
Method
ChangeUserPassword
change password with authorized user NOT reset password TODO : should implement reset password flow like send reset password link to user by email
controller/user/user_controller.go:284
↓ 1 callers
Method
CreateArticle
(c echo.Context)
controller/article/article_controller.go:31
↓ 1 callers
Method
DeleteArticleById
(c echo.Context)
controller/article/article_controller.go:78
↓ 1 callers
Method
DeleteClientById
(c echo.Context)
controller/client/client_controller.go:161
↓ 1 callers
Method
GetArticleById
(c echo.Context)
controller/article/article_controller.go:58
↓ 1 callers
Method
GetArticlesOfUser
(c echo.Context)
controller/article/article_controller.go:137
↓ 1 callers
Method
GetClientById
(c echo.Context)
controller/client/client_controller.go:123
↓ 1 callers
Method
GetClients
(c echo.Context)
controller/client/client_controller.go:144
↓ 1 callers
Function
JWTAuthenticationMiddleware
echo middleware for checking JWT token is valid and authorize request
controller/user/user_controller.go:45
↓ 1 callers
Method
RefreshAccessToken
refresh the user access token
controller/user/user_controller.go:206
↓ 1 callers
Method
SignIn
authenticate the user with credential information email/username with password and generate access token
controller/user/user_controller.go:168
↓ 1 callers
Method
SignUpNewUser
(c echo.Context)
controller/user/user_controller.go:115
↓ 1 callers
Method
UpdateArticleById
(c echo.Context)
controller/article/article_controller.go:102
↓ 1 callers
Method
UpdateClientById
(c echo.Context)
controller/client/client_controller.go:90
↓ 1 callers
Method
UpdateUserProfile
update user model such as email , first, last, display name TODO : should implement user change image profile, get uploaded image resize it and save i
controller/user/user_controller.go:246
↓ 1 callers
Function
createNewClientInDB
create new client in db just for test
controller/user/user_controller_test.go:510
↓ 1 callers
Function
getSession
()
util/testhelper/testhelper.go:39
Function
CustomErrorHandler
(err error, c echo.Context)
util/specialerror/specialerror.go:43
Function
GenerateNewRefreshToken
generate new refresh token uuid
util/genrandom.go:25
Function
GenerateRandomNumber
generate random number in range
util/genrandom.go:39
Function
IsStringInSlice
the helper functions for slice and arrays
util/slice_and_array.go:4
Function
NewAppKey
generate new app key for new clients
util/genrandom.go:20
Function
NewCustomBinderWithValidation
()
util/echo_binder.go:19
Function
NewRandomPassword
generate new random password
util/genrandom.go:15
Function
TestAuthorizeUserByRolesMiddleware
(t *testing.T)
controller/user/user_controller_test.go:318
Function
TestChangeUserPassword
(t *testing.T)
controller/user/user_controller_test.go:438
Function
TestCreateArticle
(t *testing.T)
controller/article/article_controller_test.go:27
Function
TestCreateNewClient
(t *testing.T)
controller/client/client_controller_test.go:23
Function
TestDeleteArticleById
(t *testing.T)
controller/article/article_controller_test.go:181
Function
TestDeleteClientById
(t *testing.T)
controller/client/client_controller_test.go:174
Function
TestGetArticleById
(t *testing.T)
controller/article/article_controller_test.go:69
Function
TestGetArticlesOfUser
(t *testing.T)
controller/article/article_controller_test.go:159
Function
TestGetClientById
(t *testing.T)
controller/client/client_controller_test.go:63
Function
TestGetClients
(t *testing.T)
controller/client/client_controller_test.go:153
Function
TestJWTAuthenticationMiddleware
(t *testing.T)
controller/user/user_controller_test.go:274
Function
TestMain
(m *testing.M)
controller/client/client_controller_test.go:223
Function
TestMain
(m *testing.M)
controller/user/user_controller_test.go:532
Function
TestMain
(m *testing.M)
controller/article/article_controller_test.go:224
Function
TestRefreshAccessToken
(t *testing.T)
controller/user/user_controller_test.go:133
Function
TestSignIn
(t *testing.T)
controller/user/user_controller_test.go:201
Function
TestSignUpNewUser
(t *testing.T)
controller/user/user_controller_test.go:31
Function
TestUpdateArticleById
(t *testing.T)
controller/article/article_controller_test.go:109
Function
TestUpdateClientById
(t *testing.T)
controller/client/client_controller_test.go:102
Function
TestUpdateUserProfile
(t *testing.T)
controller/user/user_controller_test.go:362
Function
main
()
server.go:21