MCPcopy Create free account

hub / github.com/WCY-dt/ponghub / functions

Functions191 in github.com/WCY-dt/ponghub

↓ 48 callersMethodresolveSpecialParameter
resolveSpecialParameter resolves non-datetime special parameters
internal/common/params/params.go:31
↓ 42 callersMethodError
()
internal/notifier/channels/utils.go:20
↓ 32 callersFunctionwriteToFile
writeToFile is a helper function that writes to file and handles errors
internal/notifier/notify.go:311
↓ 30 callersFunctionNewParameterResolver
NewParameterResolver creates a new parameter resolver with current time
internal/common/params/params.go:23
↓ 29 callersMethodResolveParameters
ResolveParameters resolves dynamic parameters in a string
internal/common/params/params.go:222
↓ 10 callersFunctionNewWebhookNotifier
NewWebhookNotifier creates a new generic webhook notifier
internal/notifier/channels/webhook.go:25
↓ 9 callersMethodSend
Send sends a generic webhook notification with enhanced configuration support
internal/notifier/channels/webhook.go:30
↓ 8 callersFunctionNewEmailNotifier
NewEmailNotifier creates a new email notifier
internal/notifier/channels/email.go:20
↓ 7 callersMethodString
String returns the string representation of the CheckResult
internal/types/types/chk_result/chk_result.go:20
↓ 7 callersFunctionlogIfTest
logIfTest logs the message only if we're in test mode
internal/checker/utils.go:25
↓ 6 callersFunctionGetLogPath
GetLogPath returns the default path to the data file where logs are stored
internal/types/types/default_config/default_config.go:105
↓ 5 callersFunctioncountEndpoints
countEndpoints counts the total number of endpoints in the map
internal/notifier/notify.go:302
↓ 5 callersMethodgenerateRandomString
generateRandomString generates a random string of specified length
internal/common/params/handlers.go:18
↓ 4 callersFunctionGetConfigPath
GetConfigPath returns the default path to the configuration file
internal/types/types/default_config/default_config.go:100
↓ 4 callersFunctionGetReportPath
GetReportPath returns the default path to the HTML report file
internal/types/types/default_config/default_config.go:110
↓ 4 callersFunctionloadLinesFromFile
loadLinesFromFile loads lines from a text file
internal/common/params/file_loader.go:12
↓ 4 callersMethodmathOperation
(input, operation string)
internal/common/params/handlers.go:120
↓ 4 callersFunctionwriteResponseBody
writeResponseBody writes response body if available and not too long
internal/notifier/notify.go:235
↓ 3 callersMethodHighlightChanges
HighlightChanges creates a highlighted version showing what parts were replaced
internal/common/params/params.go:306
↓ 3 callersFunctionNewDefaultNotifier
NewDefaultNotifier creates a new default notifier
internal/notifier/channels/default.go:18
↓ 3 callersMethodSend
Send sends an email notification with secure SMTP connection
internal/notifier/channels/email.go:25
↓ 3 callersMethodbuildEmailBody
buildEmailBody constructs the email body with proper headers
internal/notifier/channels/email.go:167
↓ 3 callersFunctioncollectCertProblemEndpoints
collectCertProblemEndpoints finds all endpoints whose certificates are expired or expiring soon
internal/notifier/notify.go:149
↓ 3 callersFunctioncollectUnavailableEndpoints
collectUnavailableEndpoints finds all endpoints with status NONE
internal/notifier/notify.go:136
↓ 3 callersFunctionconvertToHistory
convertToHistory converts logger history entries to reporter history format, sorts them by time and returns only the last displayNum entries.
internal/types/structures/reporter/utils.go:13
↓ 3 callersMethodformatTimeWithPattern
formatTimeWithPattern converts Go time format patterns to actual values
internal/common/params/handlers.go:41
↓ 3 callersMethodmaskSensitiveValue
maskSensitiveValue creates a masked version of a sensitive value
internal/common/params/params.go:202
↓ 3 callersFunctionremoveExistingNotifyFile
removeExistingNotifyFile removes the existing notify file if it exists
internal/notifier/notify.go:162
↓ 3 callersMethodsendMessage
sendMessage sends the actual email message using the SMTP client
internal/notifier/channels/email.go:135
↓ 3 callersFunctionwriteFailureDetails
writeFailureDetails writes failure details if available
internal/notifier/notify.go:223
↓ 2 callersMethodAddEntry
AddEntry adds a new entry to the history entry list.
internal/types/structures/logger/utils.go:33
↓ 2 callersFunctionCheckServices
CheckServices checks all services defined in the configuration
internal/checker/services.go:12
↓ 2 callersMethodCleanExpiredEntries
CleanExpiredEntries removes entries older than maxDays from the history entry list.
internal/types/structures/logger/utils.go:9
↓ 2 callersFunctionFilterLogs
FilterLogs filters the previous log to include only services and endpoints present in the current check results
internal/common/logger.go:39
↓ 2 callersFunctionGetLog
GetLog writes check results to JSON file
internal/logger/log_result.go:12
↓ 2 callersFunctionGetReport
GetReport generates a report based on the check results and log data
internal/reporter/report.go:18
↓ 2 callersFunctionReadConfigs
ReadConfigs loads the configuration from a YAML file at the specified path
internal/configure/config.go:15
↓ 2 callersFunctionReadLogs
ReadLogs loads log data from file or returns empty data
internal/common/logger.go:12
↓ 2 callersFunctionSendNotifications
SendNotifications sends notifications through various channels using the notification manager
internal/notifier/notify.go:51
↓ 2 callersFunctionSetDefaultMaxRetryTimes
SetDefaultMaxRetryTimes sets the default maxRetryTimes count for a given configuration pointer
internal/types/types/default_config/default_config.go:45
↓ 2 callersFunctionSetDefaultTimeout
SetDefaultTimeout sets the default timeout for a given configuration pointer
internal/types/types/default_config/default_config.go:38
↓ 2 callersFunctionWriteLog
WriteLog writes log data to file
internal/logger/log_result.go:30
↓ 2 callersFunctionWriteNotifications
WriteNotifications sends notifications based on the service check results
internal/notifier/notify.go:22
↓ 2 callersFunctionWriteReport
WriteReport generates an HTML report from the provided log data
internal/reporter/report.go:98
↓ 2 callersFunctioncreateHTTPClient
HTTPClient creates an HTTP client with optional TLS configuration
internal/notifier/channels/utils.go:37
↓ 2 callersMethodformatRecipients
formatRecipients formats the recipient list for the To header
internal/notifier/channels/email.go:192
↓ 2 callersMethodgetServiceName
getServiceName returns the name of the service at the given index
internal/notifier/manager.go:105
↓ 2 callersFunctiongetTestResult
getTestResult determines the test result based on the success count and actual attempts
internal/checker/utils.go:32
↓ 2 callersMethodresolveSpecialParameterWithSecret
resolveSpecialParameterWithSecret resolves parameters for display with sensitive data masking
internal/common/params/params.go:184
↓ 2 callersFunctionrunMainFunctionality
runMainFunctionality runs the main functionality for testing purposes. If copyExistingLog is true, it copies the existing log file to a temporary loca
cmd/ponghub/main_test.go:30
↓ 2 callersMethodtimeCalculation
(input, operation string)
internal/common/params/handlers.go:225
↓ 2 callersFunctionwriteCertificateStatus
writeCertificateStatus writes the certificate status with appropriate emoji and message
internal/notifier/notify.go:276
↓ 2 callersFunctionwriteNotificationReport
writeNotificationReport writes the complete notification report to the file
internal/notifier/notify.go:171
↓ 1 callersFunctionGetDefaultCertNotifyDays
GetDefaultCertNotifyDays returns the default number of days to notify before certificate expiration
internal/types/types/default_config/default_config.go:33
↓ 1 callersFunctionGetDefaultMaxLogDays
GetDefaultMaxLogDays returns the default maximum number of days to keep logs
internal/types/types/default_config/default_config.go:28
↓ 1 callersFunctionGetDefaultMaxRetryTimes
GetDefaultMaxRetryTimes returns the default maxRetryTimes count for service checks
internal/types/types/default_config/default_config.go:23
↓ 1 callersFunctionGetDefaultTimeout
GetDefaultTimeout returns the default timeout for service checks
internal/types/types/default_config/default_config.go:18
↓ 1 callersFunctionGetDisplayNum
GetDisplayNum returns the default number of logs per endpoint to display in the HTML report
internal/types/types/default_config/default_config.go:71
↓ 1 callersFunctionGetNotifyPath
GetNotifyPath returns the default path to the notification template file
internal/types/types/default_config/default_config.go:120
↓ 1 callersMethodGetOriginalValue
GetOriginalValue returns the original template value for configuration display
internal/common/params/params.go:301
↓ 1 callersMethodGetResolvedValue
GetResolvedValue returns the resolved value for display purposes
internal/common/params/params.go:296
↓ 1 callersFunctionGetTemplatePath
GetTemplatePath returns the default path to the HTML template file
internal/types/types/default_config/default_config.go:115
↓ 1 callersFunctionIsALL
IsALL checks if the CheckResult is ALL
internal/types/types/chk_result/chk_result.go:39
↓ 1 callersMethodIsEnabled
IsEnabled returns whether notifications are enabled
internal/notifier/manager.go:113
↓ 1 callersFunctionLoadFakeDomains
LoadFakeDomains loads fake domains from file
internal/common/params/file_loader.go:72
↓ 1 callersFunctionLoadFirstNames
LoadFirstNames loads first names from file
internal/common/params/file_loader.go:52
↓ 1 callersFunctionLoadLastNames
LoadLastNames loads last names from file
internal/common/params/file_loader.go:62
↓ 1 callersFunctionLoadUserAgents
LoadUserAgents loads user agent strings from file
internal/common/params/file_loader.go:39
↓ 1 callersFunctionMergeLogs
MergeLogs merges previous log data with current check results and cleans up old entries
internal/common/logger.go:88
↓ 1 callersFunctionNewNotificationManager
NewNotificationManager creates a new notification manager
internal/notifier/manager.go:19
↓ 1 callersFunctionParseCheckResult
ParseCheckResult parses a string into a CheckResult
internal/types/types/chk_result/chk_result.go:44
↓ 1 callersFunctionParseLogResult
ParseLogResult converts logger.Logger data into a reporter.Reporter format preserving config order
internal/types/structures/reporter/utils.go:37
↓ 1 callersMethodSend
(title, message string)
internal/notifier/notify.go:18
↓ 1 callersMethodSendNotification
SendNotification sends notification through all configured services
internal/notifier/manager.go:79
↓ 1 callersFunctionSetDefaultCertNotifyDays
SetDefaultCertNotifyDays sets the default number of days to notify before certificate expiration for a given configuration pointer
internal/types/types/default_config/default_config.go:59
↓ 1 callersFunctionSetDefaultDisplayNum
SetDefaultDisplayNum sets the default number of logs per endpoint to display in the HTML report for a given configuration pointer
internal/types/types/default_config/default_config.go:76
↓ 1 callersFunctionSetDefaultMaxLogDays
SetDefaultMaxLogDays sets the default maximum number of days to keep logs for a given configuration pointer
internal/types/types/default_config/default_config.go:52
↓ 1 callersFunctionWriteLogs
WriteLogs writes log data to file
internal/common/logger.go:30
↓ 1 callersMethodbase64Encode
(input string)
internal/common/params/handlers.go:99
↓ 1 callersMethodbase64Encode
base64Encode encodes string to base64
internal/notifier/channels/webhook.go:292
↓ 1 callersMethodbuildCustomPayload
buildCustomPayload builds payload using custom payload configuration
internal/notifier/channels/webhook.go:102
↓ 1 callersMethodbuildPayload
buildPayload constructs the webhook payload based on configuration
internal/notifier/channels/webhook.go:75
↓ 1 callersMethodbuildTemplatePayloadWithData
buildTemplatePayloadWithData builds payload using a template with provided data and content type
internal/notifier/channels/webhook.go:145
↓ 1 callersFunctioncalcMergedStatus
calcMergedStatus merges multiple statuses into a single status
internal/common/status.go:6
↓ 1 callersFunctioncheckEndpoint
checkEndpoint checks a single port based on the provided configuration
internal/checker/endpoints.go:19
↓ 1 callersFunctioncheckSSLCertificates
checkSSLCertificates checks the SSL certificates of the URL
internal/checker/cert.go:21
↓ 1 callersFunctioncontains
Helper function to check if string contains substring
internal/notifier/channels/webhook_test.go:432
↓ 1 callersFunctioncopyLogFile
copyLogFile copies the log file from srcPath to dstPath. If srcPath doesn't exist, it creates an empty JSON object file at dstPath.
cmd/ponghub/main_test.go:82
↓ 1 callersFunctioncreateTemplateFunc
createTemplateFunc defines custom template functions for the report
internal/reporter/report.go:148
↓ 1 callersMethodgenerateFakeDomain
()
internal/common/params/handlers.go:221
↓ 1 callersMethodgenerateFakeEmail
()
internal/common/params/handlers.go:209
↓ 1 callersMethodgenerateFakeName
()
internal/common/params/handlers.go:217
↓ 1 callersMethodgenerateFakePhone
()
internal/common/params/handlers.go:213
↓ 1 callersMethodgenerateFileExtension
()
internal/common/params/handlers.go:205
↓ 1 callersMethodgenerateHSLColor
()
internal/common/params/handlers.go:194
↓ 1 callersMethodgenerateHexColor
()
internal/common/params/handlers.go:183
↓ 1 callersMethodgenerateMimeType
()
internal/common/params/handlers.go:201
↓ 1 callersFunctiongenerateNotificationMessage
generateNotificationMessage creates a formatted message for notifications
internal/notifier/notify.go:76
↓ 1 callersMethodgenerateRGBColor
()
internal/common/params/handlers.go:187
↓ 1 callersMethodgenerateSecureRandomString
generateSecureRandomString generates a cryptographically secure random string
internal/common/params/handlers.go:31
next →1–100 of 191, ranked by callers