base

package
v0.0.0-...-d7ff5e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HHT = "03"
	HH  = "15"
	MM  = "04"
	SS  = "05"

	Z   = "MST"
	ZZZ = "MST"
)

ccccc

Variables

This section is empty.

Functions

func AddDurationInString

func AddDurationInString(timeStart time.Time, extendDuration string) time.Time

func AddDurationInString

func AddSysLog

func AddSysLog(memberID int, currentData, updatedData map[string]interface{}, logType, event string, c *gin.Context) string

AddSysLog retrieve server data and add to sys log

func AlphaNumericCertainCharactersOnly

func AlphaNumericCertainCharactersOnly(s string, character []string) bool

AlphaNumericCertainCharactersOnly func

func AlphaNumericOnly

func AlphaNumericOnly(s string) bool

AlphaNumericOnly func

func Bcrypt

func Bcrypt(str string) (string, error)

Bcrypt func

func CallCreateNewPushNotificationGroupApi

func CallCreateNewPushNotificationGroupApi(arrData CreateNewPushNotificationGroupStruct) error

CallCreateNewPushNotificationGroupApi func

func CallSendPushNotificationInGroupApi

func CallSendPushNotificationInGroupApi(arrData CallSendPushNotificationInGroupApiStruct) error

CallSendPushNotificationIndApi func

func CallSendPushNotificationIndApi

func CallSendPushNotificationIndApi(arrData CallSendPushNotificationIndApiStruct) error

CallSendPushNotificationIndApi func

func CallSubscribePushNotificationToGroupApi

func CallSubscribePushNotificationToGroupApi(arrData CallSubscribePushNotificationToGroupApiStruct) error

CallSubscribePushNotificationToGroupApi func

func CallUnsubscribePushNotificationFromGroupApi

func CallUnsubscribePushNotificationFromGroupApi(arrData CallUnsubscribePushNotificationFromGroupApiStruct) error

CallUnsubscribePushNotificationFromGroupApi func

func CheckBcryptPassword

func CheckBcryptPassword(hash string, password string) error

CheckBcryptPassword func check bcrypt hashed password

func CheckImageType

func CheckImageType(mime string) bool

CheckImageType func

func CheckMd5SecondaryPin

func CheckMd5SecondaryPin(secondaryPinMd5 string, secondaryPin string) error

CheckMd5SecondaryPin func check md5 hashed secondary pin

func CheckMigratedAccPassword

func CheckMigratedAccPassword(hashed string, password string, debug bool) error

CheckMigratedAccPassword func

func CheckVersioNumberFormat

func CheckVersioNumberFormat(version string) (err error)

CheckVersioNumberFormat func

func ConvertFormat

func ConvertFormat(format string) string

ConvertFormat func

func DateRangeValidate

func DateRangeValidate(daterange []string) error

DateRangeValidate func

func EncodeMD5

func EncodeMD5(value string) string

added by kahhou - for api hash EncodeMD5 md5 encryption

func FirstNameChecking

func FirstNameChecking(s string) string

FirstNameChecking func

func GenerateRandomString

func GenerateRandomString(length int, charSet string) string

GenerateRandomString func

func GetCurrentDateTimeT

func GetCurrentDateTimeT() time.Time

GetCurrentDateTimeT func

func GetCurrentTime

func GetCurrentTime(format string) string

GetCurrentTime func

func GetCurrentTimeV2

func GetCurrentTimeV2(format string) (string, error)

GetCurrentTimeV2 func

func GetHashAlgo

func GetHashAlgo() []string

func GetLatestExchangePriceMovementByTokenType

func GetLatestExchangePriceMovementByTokenType(tokenType string) (float64, error)

func GetLatestPriceMovementByTokenType

func GetLatestPriceMovementByTokenType(tokenType string) (float64, error)

func GetMemberLogData

func GetMemberLogData(arrTable []string, memberID int) (string, map[string]interface{})

GetMemberLogData get member log data

func GetTimeZone

func GetTimeZone() *time.Location

GetTimeZone func

func HashInput

func HashInput(data map[string]interface{}, hash string) string

func IntArrayToString

func IntArrayToString(a []int, delim string) string

IntArrayToString func

func IsValidETHAddress

func IsValidETHAddress(v string) bool

func IsValidTRXAddress

func IsValidTRXAddress(v string) bool

func LogErrorLog

func LogErrorLog(data1 interface{}, data2 interface{}, data3 interface{}, callTelegramStatus bool)

func LogErrorLog. this included call telegram function

func LogErrorLogV2

func LogErrorLogV2(data1 interface{}, data2 interface{}, data3 interface{}, callTelegramStatus bool, groupName string)

func LogErrorLogV2. this included call telegram function + diff group

func NoSpace

func NoSpace(s string) bool

NoSpace func

func PasswordChecking

func PasswordChecking(s string) bool

PasswordChecking func

func ProcessMemberPushNotificationGroup

func ProcessMemberPushNotificationGroup(tx *gorm.DB, action string, arrData ProcessMemberPushNotificationGroupStruct)

func ProcessMemberPushNotificationGroup

func ProcessPushNotificationDataV1

func ProcessPushNotificationDataV1(arrData ProcessPushNotificationDataV1Struct, translateTitle, translateMsg, saveSysNotification bool)

func SHA256

func SHA256(data string) string

SHA256 func

func SecondaryPinChecking

func SecondaryPinChecking(s string) bool

SecondaryPinChecking func

func SendSlack

func SendSlack(text string) error

SendSlack func

func SendTelegramMsgViaBot

func SendTelegramMsgViaBot(arrData TelegramMsgStruct)

func SendTelegramMsgViaBot

func SplitData

func SplitData(data []interface{}, size int) [][]interface{}

SplitData Separate data into several size

func SplitVersionNumber

func SplitVersionNumber(version string) (major int, minor int, build int, err error)

SplitVersionNumber split version number to 3 int

func StrToDateTime

func StrToDateTime(str, format string) (time.Time, error)

StrToDateTime func

func StrToUnixTime

func StrToUnixTime(str string) (int64, error)

StrToUnixTime func

func TemplateReplace

func TemplateReplace(text string, data interface{}) (string, error)

TemplateReplace func

func TimeFormat

func TimeFormat(time time.Time, format string) string

TimeFormat func

func UsernameChecking

func UsernameChecking(s string) string

UsernameChecking func

func ValidateDateTimeFormat

func ValidateDateTimeFormat(dateTime string, format string) (string, bool)

ValidateDateTimeFormat func

Types

type APIResponse

type APIResponse struct {
	Status     string
	StatusCode int
	Header     http.Header
	Body       string
}

APIResponse struct

func MultiPartPost

func MultiPartPost(url string, header map[string]string, body map[string]string, file map[string]FileStruct) (*APIResponse, error)

MultiPartPost func

func MultiPartPostV2

func MultiPartPostV2(url string, header map[string]string, body map[string]string, file map[string]FileStruct, extraSetting ExtraSettingStruct) (*APIResponse, error)

MultiPartPostV2 func

func PostFormRequestApi

func PostFormRequestApi(url string, header map[string]string, body map[string]string, resStruct interface{}) (*APIResponse, error)

PostFormRequestApi func

func RequestAPI

func RequestAPI(method, url string, header map[string]string, body map[string]interface{}, resStruct interface{}) (*APIResponse, error)

RequestAPI func

func RequestAPIV2

func RequestAPIV2(method, url string, header map[string]string, body map[string]interface{}, resStruct interface{}, extraSetting ExtraSettingStruct) (*APIResponse, error)

RequestAPI func

func RequestBinanceAPI

func RequestBinanceAPI(method, url string, header map[string]string, body map[string]interface{}, resStruct interface{}) (*APIResponse, error)

type CallSendMailApiStruct

type CallSendMailApiStruct struct {
	Subject  string
	Message  string
	Type     string
	FromMail string
	FromName string
	ToEmail  []string
	ToName   []string
	CCEmail  []string // optional
	CCName   []string // optional
	BccEmail []string // optional
}

CallSendMailApi struct

func (CallSendMailApiStruct) CallSendMailApi

func (s CallSendMailApiStruct) CallSendMailApi() error

type CallSendPushNotificationInGroupApiStruct

type CallSendPushNotificationInGroupApiStruct struct {
	GroupName string
	Subject   string
	Msg       string
	CusMsg    string
}

type CallSendPushNotificationIndApiStruct

type CallSendPushNotificationIndApiStruct struct {
	Os      string
	RegID   string
	Subject string
	Msg     string
	CusMsg  string
}

type CallSubscribePushNotificationToGroupApiStruct

type CallSubscribePushNotificationToGroupApiStruct struct {
	GroupName string
	Os        string
	RegID     string
}

type CallUnsubscribePushNotificationFromGroupApiStruct

type CallUnsubscribePushNotificationFromGroupApiStruct struct {
	GroupName string
	Os        string
	RegID     string
}

type CreateNewPushNotificationGroupStruct

type CreateNewPushNotificationGroupStruct struct {
	GroupName string
	Os        string
}

type ExtraSettingStruct

type ExtraSettingStruct struct {
	InsecureSkipVerify bool
}

type FileStruct

type FileStruct struct {
	File     io.Reader
	FileName string
}

FileStruct MultiPartPost file type

type HrMinSec

type HrMinSec struct {
	Hours   float64
	Minutes float64
	Seconds float64
}

func ConvertSecToHrMinSec

func ConvertSecToHrMinSec(duration time.Duration) HrMinSec

ConvertSecToHrMinSec func

type Pagination

type Pagination struct {
	Page      int64
	DataArr   []interface{}
	HeaderArr interface{}
}

func (*Pagination) PaginationInterfaceV1

func (p *Pagination) PaginationInterfaceV1() interface{}

func (*Pagination) PaginationInterfaceV2

func (p *Pagination) PaginationInterfaceV2() interface{}

type PriceMovementIndByTokenTypeRst

type PriceMovementIndByTokenTypeRst struct {
	// ID         int       `json:"id"`
	TokenPrice float64 `json:"token_price"`
	// BLatest    int       `json:"b_latest"`
	CreatedAt time.Time `json:"created_at"`
}

func GetPriceMovementIndByTokenTypeFn

func GetPriceMovementIndByTokenTypeFn(arrData PriceMovementIndByTokenTypeStruct) ([]PriceMovementIndByTokenTypeRst, error)

GetPriceMovementIndByTokenTypeFn

type PriceMovementIndByTokenTypeStruct

type PriceMovementIndByTokenTypeStruct struct {
	MemberID  int
	TokenType string
	Limit     int
	Date      time.Time
}

type ProcessMemberPushNotificationGroupStruct

type ProcessMemberPushNotificationGroupStruct struct {
	GroupName string
	Os        string
	RegID     string
	MemberID  int
	PrjID     int
	SourceID  int
}

type ProcessPushNotificationDataV1Struct

type ProcessPushNotificationDataV1Struct struct {
	EntMemberID   int
	PnMsgID       string
	ApiKeysName   string
	SourceID      int
	MsgTitle      string
	MsgTitleValue map[string]string
	Msg           string
	MsgValue      map[string]string
	GroupName     string
	LangCode      string
	CustomData    string
	ArrFn         string
}

type PushNotificationContentStruct

type PushNotificationContentStruct struct {
	Msg    string            `json:"title"`
	Params map[string]string `json:"params"`
}

type SecondaryPin

type SecondaryPin struct {
	MemId              int
	SecondaryPin       string
	MemberSecondaryPin string
	LangCode           string
}

func (*SecondaryPin) CheckSecondaryPin

func (s *SecondaryPin) CheckSecondaryPin() error

check hashed secondary pin--- form input secondary pin, current secondary pin

type TelegramMsgStruct

type TelegramMsgStruct struct {
	Group string
	Text  string
}

func TelegramMsgStruct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL