Documentation ¶
Index ¶
- Constants
- func BusinessErrorResponse(e *model.BusinessError) *model.Response
- func Decrypt(data []byte, hash string, logger *zap.Logger) (res string, ex *model.TechnicalError)
- func DefaultSuccessResponse(m string, data interface{}) *model.Response
- func Encrypt(d string, h string, logger *zap.Logger) (res []byte, ex *model.TechnicalError)
- func Exception(msg string, err error, d zap.Field, logger *zap.Logger) *model.TechnicalError
- func HMAC(d string, s string) string
- func Hash(key string) string
- func NewEnv(logger *zap.Logger) (*viper.Viper, *model.TechnicalError)
- func NewLog(prod bool) (z *zap.Logger, fh fiber.Handler)
- func RandomOtp(d int) (string, error)
- func RandomPassword(len int, d int, sym int, logger *zap.Logger) (res string, e *model.TechnicalError)
- func StringExists(key string, strs []string) bool
- func Transaction(identifier string) model.TransactionResponse
- func TransactionId(identifier string) string
- func ValidateStruct(err error) []*model.BadPayloadResponse
Constants ¶
View Source
const ChannelB2BClient = "B2BCLIENT"
View Source
const ChannelEBizKezbek = "EBIZKEZBEK"
View Source
const DefaultTrxId = "11111"
View Source
const ErrCodeBadPayload = "9008"
View Source
const ErrCodeBussClientAddTransaction = "BR-04"
View Source
const ErrCodeBussH2HCashbackFailed = "BR-05"
View Source
const ErrCodeBussMerchantCodeInvalid = "BR-04"
View Source
const ErrCodeBussNoCashback = "BR-07"
View Source
const ErrCodeBussPartnerExists = "BR-01"
View Source
const ErrCodeBussPartnerOTPInvalid = "BR-02"
View Source
const ErrCodeBussRewardFailed = "BR-06"
View Source
const ErrCodeInvalidChannel = "9009"
View Source
const ErrCodeNotFound = "9002"
View Source
const ErrCodeSomethingWrong = "9001"
View Source
const ErrCodeSubmitted = "9006"
View Source
const ErrCodeTokenExpired = "9007"
View Source
const ErrMsgBadPayload = "Please check again the given input"
View Source
const ErrMsgBussClientAddTransaction = "Failed to add transaction based on client request"
View Source
const ErrMsgBussH2HCashbackFailed = "Failed to contact H2H Provider"
View Source
const ErrMsgBussMerchantCodeInvalid = "Merchant code is invalid"
View Source
const ErrMsgBussNoCashback = "No cashback available for the given value"
View Source
const ErrMsgBussPartnerExists = "The given partner data is exists on system"
View Source
const ErrMsgBussPartnerOTPInvalid = "The given OTP and Transaction ID is invalid"
View Source
const ErrMsgBussRewardFailed = "Failed to add reward"
View Source
const ErrMsgInvalidChannel = "The given channel is invalid, try another channel"
View Source
const ErrMsgNotFound = "Data is not found"
View Source
const ErrMsgSomethingWrong = "Something went wrong, please contact administrator"
View Source
const ErrMsgSubmitted = "Failed to submit the data"
View Source
const ErrMsgTokenExpired = "The session has been expired"
View Source
const H2HGpaid = "GOPAIDH2H"
View Source
const H2HJosvo = "JOSVOH2H"
View Source
const H2HLinksaja = "LSAJAH2H"
View Source
const H2HMidtrans = "MTRANS"
View Source
const H2HXenit = "XENIT"
View Source
const HeaderApiKey = "x-api-key"
View Source
const HeaderClientChannel = "x-client-channel"
View Source
const HeaderClientDeviceId = "x-client-device"
View Source
const HeaderClientOs = "x-client-os"
View Source
const HeaderClientRefToken = "x-client-refresh-token"
View Source
const HeaderClientSignature = "x-client-signature"
View Source
const HeaderClientTimestamp = "x-client-timestamp"
View Source
const HeaderClientTrxId = "x-client-trxid"
View Source
const HeaderClientVersion = "x-client-version"
View Source
const HeaderSessionEmail = "x-session-email"
View Source
const HeaderSessionFullname = "x-session-fullname"
View Source
const HeaderSessionId = "x-session-id"
View Source
const HeaderSessionMsisdn = "x-session-msisdn"
View Source
const HeaderSessionRole = "x-session-role"
View Source
const HeaderSessionUsername = "x-session-username"
View Source
const StatusActive = 1
View Source
const StatusInactive = 0
View Source
const SuccessCode = "8000"
View Source
const SuccessMsgDataFound = "Here is your data"
View Source
const SuccessMsgSubmit = "Data submitted successfully"
Variables ¶
This section is empty.
Functions ¶
func BusinessErrorResponse ¶
func BusinessErrorResponse(e *model.BusinessError) *model.Response
func DefaultSuccessResponse ¶
func RandomPassword ¶
func StringExists ¶
func Transaction ¶
func Transaction(identifier string) model.TransactionResponse
func TransactionId ¶
func ValidateStruct ¶
func ValidateStruct(err error) []*model.BadPayloadResponse
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.