Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/akilans/golang-mini-projects
/ functions
Functions
99 in github.com/akilans/golang-mini-projects
⨍
Functions
99
◇
Types & classes
17
↓ 15 callers
Function
jsonMessageByte
response as json format
04-bookstore-api/main.go:29
↓ 13 callers
Function
check
check for any error
07-ssh-sftp-agent/main.go:16
↓ 12 callers
Function
checkIfError
Common function to check any error
14_akit-ops/main.go:21
↓ 8 callers
Function
jsonMessageByte
response message struct as json format
11-jwt-golang/main.go:29
↓ 7 callers
Function
check
check for any error
02-organize-folder/main.go:11
↓ 7 callers
Function
check
check for any error
10-golang-ssh-concurrent-file-uploder/main.go:27
↓ 5 callers
Function
checkError
(err error)
01-bookstore-cli-flag-json/books.go:11
↓ 5 callers
Function
getBooks
Get books - returns books and error
04-bookstore-api/books.go:9
↓ 5 callers
Function
jsonMessageByte
response message struct as json format
rest-api-to-exec-shell/main.go:26
↓ 4 callers
Function
getBooks
get all the books
01-bookstore-cli-flag-json/books.go:20
↓ 3 callers
Function
getBookById
Get books - returns book, book index and error
04-bookstore-api/books.go:23
↓ 3 callers
Function
saveBooks
save books to books.json file
04-bookstore-api/books.go:43
↓ 3 callers
Function
triggerEmail
alert user by sending an email
03-web-monitor/main.go:115
↓ 2 callers
Function
IsBookExists
check book exits or not
12-fiber-book-rest/models/booksModel.go:71
↓ 2 callers
Method
UploadFileToServer
Upload file to remote SSH server
10-golang-ssh-concurrent-file-uploder/main.go:68
↓ 2 callers
Function
alertUser
(web string, err error, webStatusSlice *[]webStatus)
03-web-monitor/main.go:82
↓ 2 callers
Function
checkError
print logs in console
04-bookstore-api/main.go:36
↓ 2 callers
Function
handleAddBook
add or update a book logic
01-bookstore-cli-flag-json/books.go:91
↓ 2 callers
Function
saveBooks
save books to books.json file
01-bookstore-cli-flag-json/books.go:32
↓ 1 callers
Function
Auth
Middleware auth handler
11-jwt-golang/main.go:82
↓ 1 callers
Function
CreateJWT
Create JWT token Function to create JWT token
12-fiber-book-rest/controllers/usersController.go:181
↓ 1 callers
Function
CreateJWT
Function to create JWT token
11-jwt-golang/main.go:43
↓ 1 callers
Function
SyncDB
Migrate tables
12-fiber-book-rest/models/booksModel.go:92
↓ 1 callers
Function
ValidateBookStruct
validate book payload
12-fiber-book-rest/controllers/booksController.go:23
↓ 1 callers
Function
ValidateJWT
Function to validate JWT Get the token from user and validate it
11-jwt-golang/main.go:67
↓ 1 callers
Function
ValidateLoginUserStruct
(user Login)
12-fiber-book-rest/controllers/usersController.go:43
↓ 1 callers
Function
ValidateUserStruct
validate user payload
12-fiber-book-rest/controllers/usersController.go:28
↓ 1 callers
Function
checkError
print logs in console
06-system-monitor/info.go:13
↓ 1 callers
Function
checkForPreviousAlert
check for the web is in webstatus slice
03-web-monitor/main.go:133
↓ 1 callers
Function
checkForReminderInterval
to when it trigger email last last time triggered email + reminder interval > current timem then return true then update time
03-web-monitor/main.go:156
↓ 1 callers
Function
cloneRepo
clone the provided repo
14_akit-ops/git.go:11
↓ 1 callers
Function
createDefaultFolders
function to create default folders such as Images, Music, Docs, Others, Videos
02-organize-folder/main.go:44
↓ 1 callers
Function
createUpdateDeployment
Create / Update deployment function
14_akit-ops/createUpdate.go:52
↓ 1 callers
Function
createUpdateService
Create / Update service function
14_akit-ops/createUpdate.go:15
↓ 1 callers
Function
detectChanges
Detect any changes in the repo
14_akit-ops/git.go:21
↓ 1 callers
Function
generatePassword
(passwordLength int, minSpecialChar int, minUpperChar int, minNumberChar int)
05-random-password-flag/main.go:65
↓ 1 callers
Function
generatePassword
()
05-random-password/main.go:57
↓ 1 callers
Function
getCpuInfo
get cpu info it returns cpuNumCores, cpuPercentage
06-system-monitor/info.go:46
↓ 1 callers
Function
getHostInfo
get host info It returns hostName, architecture, operationSystem
06-system-monitor/info.go:35
↓ 1 callers
Function
getMemInfo
Get memory info It returns total, free memory in MB and used memory percentage
06-system-monitor/info.go:22
↓ 1 callers
Function
handleDeleteBook
(deleteCmd *flag.FlagSet, id *string)
01-bookstore-cli-flag-json/books.go:133
↓ 1 callers
Function
handleGetBooks
get all the books logic
01-bookstore-cli-flag-json/books.go:46
↓ 1 callers
Function
listDeployments
Function to list all the Deployments in the specific namespace
13-k8s-client-go/main.go:41
↓ 1 callers
Function
listPods
Function to list all the pods in the specific namespace
13-k8s-client-go/main.go:22
↓ 1 callers
Function
organizeFolder
function to Oraganize folders
02-organize-folder/main.go:56
↓ 1 callers
Method
sshDemoWithPassword
SSH auth with Password
10-golang-ssh-concurrent-file-uploder/main.go:122
↓ 1 callers
Function
sshDemoWithPrivateKey
()
07-ssh-sftp-agent/main.go:118
↓ 1 callers
Method
sshDemoWithPrivateKey
SSH auth with Private Key
10-golang-ssh-concurrent-file-uploder/main.go:138
Function
AddBook
add a book
12-fiber-book-rest/models/booksModel.go:42
Function
AddBookHandler
Add a new book function * Get new book inputs from user validate it Store in the DB */
12-fiber-book-rest/controllers/booksController.go:60
Function
AddUser
add user
12-fiber-book-rest/models/usersModel.go:12
Function
AddUserHandler
Add User Handler * Get email and password from user Validate email and password based on Login struct rules hash the password using bcrypt Store email
12-fiber-book-rest/controllers/usersController.go:65
Function
CheckHashPassword
Compare password
12-fiber-book-rest/helpers/utils.go:21
Function
ConnectDB
Connect to DB
12-fiber-book-rest/initializers/db.go:14
Function
DeleteBookByID
Delete a book by id
12-fiber-book-rest/models/booksModel.go:81
Function
DeleteBookHandler
Delete books function * Validate provided book id in the URL If book doesn't exists send book not found message else delete a book */
12-fiber-book-rest/controllers/booksController.go:179
Function
GenerateHashPassword
Generate Hash Password
12-fiber-book-rest/helpers/utils.go:15
Function
GetBookByID
Get book details
12-fiber-book-rest/models/booksModel.go:62
Function
GetBookHandler
Get book by id function * Validate provided book id in the URL Get book details from DB If no book returned send book not found message else give book
12-fiber-book-rest/controllers/booksController.go:97
Function
GetBooks
add a book Get books
12-fiber-book-rest/models/booksModel.go:32
Function
GetDB
Get DB connection
12-fiber-book-rest/initializers/db.go:29
Function
GetUserByEmail
add user
12-fiber-book-rest/models/usersModel.go:22
Function
HomeHandler
Handle home route
11-jwt-golang/main.go:130
Function
JwtError
Custom error message for invalid JWT
12-fiber-book-rest/controllers/usersController.go:204
Function
ListBooksHandler
List books function
12-fiber-book-rest/controllers/booksController.go:39
Function
LoadEnvs
Load ENV variables from .env file
12-fiber-book-rest/initializers/env.go:10
Function
LogError
Log erros
12-fiber-book-rest/helpers/utils.go:10
Function
LoginHandler
Login Handler * Get email and password from user Validate email and password based on Login struct rules get user details by provided email id if not
12-fiber-book-rest/controllers/usersController.go:132
Function
LoginHandler
Handle login
11-jwt-golang/main.go:103
Function
Routes
Define all routes and handlers call
12-fiber-book-rest/routes/routes.go:12
Function
SecureHandler
Handle secure route
11-jwt-golang/main.go:135
Function
UpdateBook
Update a book
12-fiber-book-rest/models/booksModel.go:52
Function
UpdateBookHandler
Update a book by id function * Validate provided book id in the URL Get book details from DB If no book returned send book not found message else upda
12-fiber-book-rest/controllers/booksController.go:129
Function
executeShell
Allow only POST method Validate Payload - It should contain command and argument Parse the post data and execute the command in the payload
rest-api-to-exec-shell/main.go:36
Function
getSysInfo
(w http.ResponseWriter, r *http.Request)
06-system-monitor/main.go:40
Function
handleAddBook
add book handler
04-bookstore-api/main.go:109
Function
handleDeleteBookById
delete book by id handler
04-bookstore-api/main.go:192
Function
handleGetBookById
get book by id handler
04-bookstore-api/main.go:86
Function
handleGetBooks
List all the books handler
04-bookstore-api/main.go:70
Function
handleUpdateBook
update book handler
04-bookstore-api/main.go:144
Function
init
Init function to connect to DB, get DB connection and migrate tables
12-fiber-book-rest/models/booksModel.go:23
Function
main
()
03-web-monitor/main.go:47
Function
main
()
08-file-folder-zip/main.go:22
Function
main
()
01-bookstore-cli-flag-json/main.go:18
Function
main
Main function
12-fiber-book-rest/main.go:13
Function
main
()
05-random-password-flag/main.go:19
Function
main
()
07-ssh-sftp-agent/main.go:38
Function
main
()
09-pack-mod-demo/main.go:11
Function
main
main function starts here
06-system-monitor/main.go:27
Function
main
main function starts here
04-bookstore-api/main.go:44
Function
main
()
14_akit-ops/main.go:27
Function
main
Main function Start the server
rest-api-to-exec-shell/main.go:68
Function
main
Main function
02-organize-folder/main.go:19
Function
main
()
13-k8s-client-go/main.go:59
Function
main
Main function
10-golang-ssh-concurrent-file-uploder/main.go:35
Function
main
()
playground/main.go:5
Function
main
()
05-random-password/main.go:24
Function
main
()
11-jwt-golang/main.go:139
Function
sshDemoWithPassword
()
07-ssh-sftp-agent/main.go:103