Documentation ¶
Index ¶
- Constants
- func AddTime(yourTime time.Time, addedTime int64, timeType string) (resultTime time.Time, err error)
- func CheckFamily(redisSession *redis.Client, username, oldUuid string) (isUsed bool, err error)
- func CheckToken(redisSession *redis.Client, username, uuid string) (isExistAccess, isExistRefresh bool, err error)
- func DeleteAllSession(redisSession *redis.Client, username string, uuid string) (err error)
- func GeneratePassword(password Passwords, passwordCost int8) (hash *string, err error)
- func GenerateRandString(strSize int, randType string) string
- func GetAllSessions(redisSession *redis.Client, username string) ([]interface{}, error)
- func GetCurrentUser(redisSession *redis.Client, uuidIdentifier string) (interface{}, error)
- func GetCurrentUserRefresh(redisSession *redis.Client, uuidIdentifier string) (interface{}, error)
- func InArray[T ArrayType](haystack []T, needle T) (bool, int, error)
- func InArrayComplex(haystack []any, needle any) (bool, int, error)
- func RemoveRedisSession(redisSession *redis.Client, username, uuid string) (totalLogin int64, err error)
- func SetFamily(redisSession *redis.Client, username, oldUuid, newUuid string, ...) (err error)
- func SetupLoginSession(redisSession *redis.Client, username string, data SessionData) (totalLogin int64, err error)
- type ArrayType
- type FamilyCheck
- type FtpCredential
- type HelperFtp
- type KeyRedisSessionData
- type Passwords
- type SessionData
- type SessionDetails
- type SessionToken
Constants ¶
const DefaultFTPPort = 21 // default ftp port
const DefaultFTPSPort = 990 // default ftps port
const DefaultSFTPPort = 22 // default sftp
Variables ¶
This section is empty.
Functions ¶
func AddTime ¶
func AddTime(yourTime time.Time, addedTime int64, timeType string) (resultTime time.Time, err error)
AddTime adding additional time to your time.
func CheckFamily ¶
CheckFamily check family
func CheckToken ¶
func DeleteAllSession ¶
func GeneratePassword ¶
GeneratePassword generates bcrypt hash string of the given plaintext password because generate password is by using bcrypt, to check hash and password, please use bycrypt CompareHashAndPassword
func GenerateRandString ¶
func GetAllSessions ¶
func GetCurrentUser ¶
GetCurrentUser get current user session from cookie uuid, uuid already set when jwt claim already set. you can access it by -> uuid, _ := ctx.Get("uuid") TODO: change return to users and device login details
func GetCurrentUserRefresh ¶
GetCurrentUserRefresh get current user session from cookie uuid, uuid already set when jwt claim already set. you can access it by -> uuid, _ := ctx.Get("uuid") TODO: change return to users and device login details
func InArrayComplex ¶
InArray checks whether needle is in haystack. if haystack is an array of struck, then needle need to be a function example : https://stackoverflow.com/questions/38654383/how-to-search-for-an-element-in-a-golang-slice
func RemoveRedisSession ¶
func SetFamily ¶
func SetFamily(redisSession *redis.Client, username, oldUuid, newUuid string, expiration int64) (err error)
SetFamily set family
func SetupLoginSession ¶
Types ¶
type FamilyCheck ¶
type FtpCredential ¶
type HelperFtp ¶
type HelperFtp struct { FtpCredential FtpCredential `json:"ftp_credential"` // contains filtered or unexported fields }
func BaseHelperFtp ¶
func (*HelperFtp) SetCredential ¶
func (helper *HelperFtp) SetCredential(ftpCredential FtpCredential) *HelperFtp
type KeyRedisSessionData ¶
type SessionData ¶
type SessionData struct { Token SessionToken SessionDetails SessionDetails `json:"session_details"` Authorization bool `json:"authorization"` }
type SessionDetails ¶
type SessionDetails struct { UserDetails interface{} DeviceDetails interface{} }