Versions in this module Expand all Collapse all v1 v1.12.0 Aug 10, 2026 v1.11.1 Aug 3, 2026 v1.11.0 Jul 20, 2026 v1.10.4 Jun 8, 2026 v1.10.3 Jun 5, 2026 v1.10.2 May 24, 2026 Changes in this version + func ConfigureAuditJSONMarshal(fn func(interface{}) ([]byte, error)) + func InitRedisFromEnv() error + func MaxTTL() time.Duration + func RedisEnabled() bool + func StoreRedisNoExpiry(id string, data interface{}) error v1.10.1 Apr 29, 2026 v1.9.2-beta.2 Aug 2, 2026 v1.9.2-beta.1 May 6, 2026 v1.9.1 Apr 29, 2026 Changes in this version + const AuditTrxStateChannelProcessed + const AuditTrxStateChannelSelected + const AuditTrxStateOrderCreated + const AuditTrxStateOrderExpired + const AuditTrxStatePaymentNotified + const AuditTrxStatePaymentReceived + const AuditTrxStateQrGenerated + const AuditTrxStateRequestReceived + const AuditTrxStateRequestValidated + const AuditTrxStateResponseReturned + const AuditTrxStateStatusChecked + const AuditTrxStateTransactionUpdated + const AuditTrxStateVendorRequestFailed + const AuditTrxStateVendorRequestSent + const AuditTrxStateVendorTokenAcquired + const AuditTrxStatusExpired + const AuditTrxStatusFailed + const AuditTrxStatusProcessing + const AuditTrxStatusSuccess + const CmdAuditTrailData + const CmdAuditTrailProcess + const CmdAuditTrailTrx + const FieldMerchantID + const FieldOrderID + const FieldReffNo + const FieldRoute + const FieldService + const FieldSpanID + const FieldTicketID + const FieldTraceID + const FieldTrxID + const FieldTrxNo + const FieldVendor + const Key + const Numeric + var DefaultRedisTimeout = 1000 * time.Millisecond + var GinLevel golog.Level = phlogger.GinLevel + var Log = phlogger.Log + var Logf = Log.Logf + var PushMaxRetries = 3 + var PushTimeout = 15 * time.Second + func AcquireLock(key string, ttl time.Duration) (bool, error) + func AcquireLockWithRetry(key string, ttl time.Duration, maxRetries int, retryDelay time.Duration) (*redsync.Mutex, bool, error) + func AddValidatorLibs() + func ConfigureLogForwarding(cfg phlogger.LogForwardConfig) + func ConfigureSentryLogging(enable bool) + func DeleteRedis(id string) error + func DeleteRedisWithContext(ctx context.Context, id string) error + func FlushSentry(timeout time.Duration) + func GetAppEnv() string + func GetAppName() string + func GetConfigurationStatus() map[string]interface + func GetMutex(key string) *redsync.Mutex + func GetOrGenerateRequestID(headerValue string) string + func GetRedis(id string) (string, error) + func GetRedisClient(redisHost, redisPort, redisPassword string, redisDb int) error + func GetRedisOptions() *redis.Options + func GetRedisPoolClient() (*redis.Client, error) + func GetRedisWithContext(ctx context.Context, id string) (string, error) + func GetSentryClient() *sentry.Client + func GetSentryClientOptions() *sentry.ClientOptions + func GetSentryData() *phsentry.SentryData + func GetTrxRedisBackoff() int + func GetTrxRedisLockTimeout() time.Duration + func IncrementMetric(event string) + func IncrementMetricBy(event string, n int64) + func InitRedSyncOnce() error + func InitRedisOptions(rawOpt redis.Options) *redis.Options + func InitSentry(options phsentry.SentryOptions) *sentry.Client + func InitSentryOptions(options phsentry.SentryOptions) + func InitializeApp() + func InitializeLogger() + func InitializeRedis(opt redis.Options) + func InitializeRedisWithRetry(opts RedisInitOptions) error + func InitializeSampler(cfg SamplerConfig) + func IsAuditTrailTrxEnabled() bool + func JSONEncode(obj interface{}) string + func JsonMinify(jsonB []byte) ([]byte, error) + func LogAuditTrailTrx(data AuditTrailTrx) + func LogAudittrailData(funcName, desc, source, commType string, key *[]string, ...) + func LogAudittrailDataV2(funcName, desc, source, commType string, key *[]string, ...) + func LogAudittrailProcess(funcName, desc, info string, key *[]string) + func LogAudittrailProcessV2(funcName, desc, info string, key *[]string) + func LogConfigurationWarnings() + func LogCtx(ctx context.Context, fields ...string) *phtrace.LogContextCtx + func LogD(format string, args ...interface{}) + func LogDCtx(ctx context.Context, format string, args ...interface{}) + func LogDRated(key string, format string, args ...interface{}) + func LogDRatedW(key string, window time.Duration, format string, args ...interface{}) + func LogE(format string, args ...interface{}) + func LogECtx(ctx context.Context, format string, args ...interface{}) + func LogERated(key string, format string, args ...interface{}) + func LogERatedW(key string, window time.Duration, format string, args ...interface{}) + func LogErr(err error) + func LogF(format string, args ...interface{}) + func LogForwardConfigFromEnv() phlogger.LogForwardConfig + func LogI(format string, args ...interface{}) + func LogICtx(ctx context.Context, format string, args ...interface{}) + func LogIRated(key string, format string, args ...interface{}) + func LogIRatedW(key string, window time.Duration, format string, args ...interface{}) + func LogJ(arg interface{}) + func LogJI(arg interface{}) + func LogSetLevel(levelName string) + func LogW(format string, args ...interface{}) + func LogWCtx(ctx context.Context, format string, args ...interface{}) + func LogWRated(key string, format string, args ...interface{}) + func LogWRatedW(key string, window time.Duration, format string, args ...interface{}) + func LoggerErrorHub(err interface{}, args ...interface{}) + func NewAmqp(addr string, c *AmqpClient) + func NewSentryData(dt *phsentry.SentryData) + func ReadBody(c echo.Context, idem string) (map[string]interface{}, string, error) + func RegisterMetricsHook(hook MetricsHook) + func ReleaseLock(key string) error + func ReleaseLockWithRetry(mutex *redsync.Mutex, maxRetries int) error + func RemoveMutex(key string) + func RevokeToken(next echo.HandlerFunc) echo.HandlerFunc + func SendSentryDebug(err error, args ...string) + func SendSentryError(err error, args ...string) + func SendSentryErrorWithContext(ctx context.Context, err error, args ...string) + func SendSentryEvent(event *sentry.Event, args ...string) + func SendSentryMessage(msg string, args ...string) + func SendSentryWarning(err error, args ...string) + func SendToSentryDebug(err error, service, module, function string) + func SendToSentryError(err error, service, module, function string) + func SendToSentryEvent(event *sentry.Event, service, module, function string) + func SendToSentryMessage(message string, service, module, function string) + func SendToSentryWarning(err error, service, module, function string) + func SentryEnabled() bool + func SentryLoggingFromEnv() bool + func SetAppEnv(v string) + func SetAppName(v string) + func StoreMutex(key string, mutex *redsync.Mutex) + func StoreRedis(id string, data interface{}, duration time.Duration) error + func StoreRedisWithContext(ctx context.Context, id string, data interface{}, duration time.Duration) error + func StoreRedisWithLock(id string, data interface{}, duration time.Duration) (err error) + func ToJson(data interface{}) string + func ToJsonIndent(data interface{}) string + func VerifCsrf(next echo.HandlerFunc) echo.HandlerFunc + func VerifIdemKey(next echo.HandlerFunc) echo.HandlerFunc + func VerifyMD5(idemKey string, request []byte) (string, error) + type AmqpClient struct + func NewAmqpClient(queueName, connName, addr string, config *amqp.Config) *AmqpClient + func SetUpRabbitMq(host, port, vhost, username, password, auditTrailQue, appName string) *AmqpClient + func (c *AmqpClient) AmqpConfig() amqp.Config + func (c *AmqpClient) Cc() error + func (c *AmqpClient) Channel() *amqp.Channel + func (c *AmqpClient) Close() error + func (c *AmqpClient) ConnName() string + func (c *AmqpClient) Consume() (<-chan amqp.Delivery, error) + func (c *AmqpClient) ErrLog() *log.Logger + func (c *AmqpClient) InfoLog() *log.Logger + func (c *AmqpClient) IsReady() bool + func (c *AmqpClient) Push(data []byte) error + func (c *AmqpClient) PushWithTTL(data []byte, ttl string) error + func (c *AmqpClient) SetAmqpConfig(amqpConfig *amqp.Config) + func (c *AmqpClient) UnsafePush(data []byte) error + func (c *AmqpClient) WaitForReady(timeout time.Duration) bool + type AuditPublisher struct + func GetAuditPublisher() *AuditPublisher + func GetAuditTrailTrxPublisher() *AuditPublisher + func NewAuditPublisher(client *AmqpClient, opts ...AuditPublisherOption) *AuditPublisher + func SetUpAuditTrailPublisher(host, port, vhost, username, password, queue, appName string, ...) *AuditPublisher + func SetUpAuditTrailTrxPublisher(enabled bool, host, port, vhost, username, password, queue, appName string, ...) *AuditPublisher + func (p *AuditPublisher) Start() + func (p *AuditPublisher) Stop() + func (p *AuditPublisher) Submit(payload MessagePayloadAudit) + type AuditPublisherOption func(*AuditPublisher) + func WithBufferSize(n int) AuditPublisherOption + func WithCircuitBreakerCooldown(d time.Duration) AuditPublisherOption + func WithCircuitBreakerThreshold(n int) AuditPublisherOption + func WithMaxRetries(n int) AuditPublisherOption + func WithMessageTTL(ttl string) AuditPublisherOption + func WithPublishTimeout(d time.Duration) AuditPublisherOption + func WithWorkerCount(n int) AuditPublisherOption + type AuditTrailData struct + CommunicationType string + Data *RequestAndResponse + Description string + Function string + Key []string + Source string + Subject string + type AuditTrailProcess struct + Data DataAuditTrailProcess + Description string + Function string + Key []string + Subject string + type AuditTrailTrx struct + Amount string + CommunicationType string + CreatedAt time.Time + Currency string + Description string + DurationMs int64 + ErrorCode string + EventTime string + Function string + MerchantNo string + Message string + Metadata map[string]interface{} + OrderNo string + PaymentCode string + QrValue string + ReffNo string + Request interface{} + Response interface{} + Rrn string + Service string + State string + Status string + TicketId string + VendorName string + type ConfigError struct + Field string + Level string + Message string + func ValidateConfiguration() []ConfigError + type DataAuditTrailProcess struct + Info string + Time string + type Detail struct + Data interface{} + Message string + StatusCode int + type Headers struct + Csrf string + IdempotencyKey string + RequestID string + Session string + func (h *Headers) ValiadateHeaderCsrf() interface{} + func (h *Headers) ValiadateHeaderIdem() interface{} + type HealthCheck struct + AppEnv string + AppName string + Checks []HealthStatus + Overall string + Timestamp time.Time + func CheckHealth() *HealthCheck + type HealthStatus struct + Component string + Latency int64 + Message string + Status string + type IRqAutoConnect interface + DeclareQueues func(queues ...string) (err error) + GetRqChannel func() *amqp.Channel + StartConnection func(username, password, host, port, vhost string) (c *amqp.Connection, err error) + Stop func() + type KeyedLimiter = phlogger.KeyedLimiter + func NewKeyedLimiter(r float64, burst int) *KeyedLimiter + type LockError struct + Err error + Key string + Op string + Reason string + func (e *LockError) Error() string + func (e *LockError) Unwrap() error + type LogContext = phlogger.LogContext + func NewLogContext(fields ...string) *LogContext + type MessagePayloadAudit struct + Command string + Data interface{} + Id int + ModuleId string + Time string + type MetricsHook = phlogger.MetricsHook + type RabbitMQConnection struct + Host string + Password string + Port string + QueueName string + Username string + VirtualHost string + func (connection *RabbitMQConnection) GlobalConn() + func (connection *RabbitMQConnection) QueueConn(RQ_QUEUE string) + type RabbitMQDefaultPayload struct + Data interface{} + Param interface{} + Route string + type RedisInitOptions struct + FailFast bool + MaxRetries int + Options redis.Options + RetryDelay time.Duration + type RedisMetricsDetailed struct + ActiveConns int + HitRate float64 + PoolStats *RedisPoolStats + PoolUtilized float64 + func GetRedisMetricsDetailed() *RedisMetricsDetailed + type RedisPoolStats struct + Hits uint32 + IdleConns int + Misses uint32 + StaleConns int + Timeouts uint32 + TotalConns int + func GetRedisMetrics() *RedisPoolStats + func GetRedisPoolStats() *RedisPoolStats + type Request struct + Body interface{} + BrowserId int + Header interface{} + IpAddress string + Latitude string + Longitude string + Param interface{} + Path string + QueryString interface{} + Time string + type RequestAndResponse struct + Request Request + Response ResponseAudit + type ResponseApi struct + Code int + Data interface{} + InternalCode string + Message string + Status string + func (r *ResponseApi) Accepted(data interface{}) + func (r *ResponseApi) BadRequest(message string, intenalCode string) + func (r *ResponseApi) InternalServerError(err error) + func (r *ResponseApi) Out(code int, message, internalCode string, status string, data interface{}) + func (r *ResponseApi) Success(message string, data interface{}) + func (r *ResponseApi) Unauthorized(message string, intenalCode string) + type ResponseAudit struct + Detail Detail + Time string + type SamplerConfig = phlogger.SamplerConfig + func SamplerConfigForEnv(env string) SamplerConfig + func SamplerConfigFromAppEnv() SamplerConfig