Documentation ¶
Index ¶
- Variables
- func CreateFolderToS3(foldername string, folderpath string, auth *Auth) (folderPath string, err error)
- func CreateMemberToken(userid, roleId int, secretKey string, loginType string) (string, error)
- func CreateS3Session(Db *gorm.DB) (ses *s3.S3, err error)
- func GenerateEmail() error
- func IsDeleted(db *gorm.DB) *gorm.DB
- func SetS3value(Db *gorm.DB) error
- type Action
- type Auth
- func (auth *Auth) CheckMemberLogin(memberlogin MemberLoginCheck, tenantid int) (TblMember, error)
- func (auth *Auth) CheckOtpLogin(email string) (Tbluser, error)
- func (auth *Auth) CheckWebAuth(login *SocialLogin) (string, Tbluser, bool, error)
- func (auth *Auth) Checklogin(Username string, Password string, tenantid int) (string, int, error)
- func (auth *Auth) CreateToken() (string, error)
- func (auth *Auth) GenerateMemberToken(memberid int, loginType string, secretKey string, tenantid int) (token string, err error)
- func (permission *Auth) IsGranted(modulename string, permisison Action, tenantid int) (bool, error)
- func (auth *Auth) MemberVerifyToken(token string, secret string) (memberid int, groupid int, loginType string, err error)
- func (auth *Auth) OtpLoginVerification(otp int, email string, tenantid int) (Tbluser, string, bool, error)
- func (auth *Auth) UpdateMemberOTP(otp OTP, tenantid int) (int, time.Time, error)
- func (auth *Auth) UpdateUserOTP(user Tbluser) (Tbluser, error)
- func (auth *Auth) VerifyToken(token string, secret string) (userid int, loginType string, err error)
- type Authentication
- type Config
- type MemberLoginCheck
- type OTP
- type SocialLogin
- type TblMember
- type TblModule
- type TblModulePermission
- type TblMstrTenant
- type TblRolePermission
- type TblStorageType
- type Tblrole
- type Tbluser
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorPassword = errors.New("invalid password") ErrorToken = errors.New("invalid token") ErrorOtpExpiry = errors.New("otp expired") ErrorConvertTime = errors.New("could not convert interface to time.Time") ErrorMemberLogin = errors.New("select any one of the config for member login") ErrorInactive = errors.New("user disabled please contact admin") ErrorInvalidOTP = errors.New("invalid OTP") ErrorInactiveMember = errors.New("inactive member") ErrorTokenExpiry = errors.New("token expired") )
View Source
var ( AWSID string AWSKEY string AWSREGION string AWSBUCKET string )
View Source
var Authmodel authmodel
Functions ¶
func CreateFolderToS3 ¶ added in v0.0.21
func CreateMemberToken ¶ added in v0.0.6
Create meber token
func GenerateEmail ¶
func GenerateEmail() error
func SetS3value ¶ added in v0.0.21
Types ¶
type Auth ¶
type Auth struct { UserId int ExpiryTime int ExpiryFlg bool SecretKey string DB *gorm.DB AuthFlg bool PermissionFlg bool RoleId int RoleName string DataAccess int }
func (*Auth) CheckMemberLogin ¶
func (auth *Auth) CheckMemberLogin(memberlogin MemberLoginCheck, tenantid int) (TblMember, error)
func (*Auth) CheckOtpLogin ¶ added in v0.0.29
func (*Auth) CheckWebAuth ¶ added in v0.0.18
func (*Auth) Checklogin ¶
Check UserName Password - userlogin
func (*Auth) CreateToken ¶
CreateToken creates a token
func (*Auth) GenerateMemberToken ¶ added in v0.0.6
func (auth *Auth) GenerateMemberToken(memberid int, loginType string, secretKey string, tenantid int) (token string, err error)
member token
func (*Auth) MemberVerifyToken ¶ added in v0.0.6
func (auth *Auth) MemberVerifyToken(token string, secret string) (memberid int, groupid int, loginType string, err error)
verify token
func (*Auth) OtpLoginVerification ¶ added in v0.0.17
func (*Auth) UpdateMemberOTP ¶ added in v0.0.6
update otp
func (*Auth) UpdateUserOTP ¶ added in v0.0.17
type Authentication ¶
type Config ¶
type Config struct { UserId int //(optional) if you use login function this userid no need ExpiryTime int //It should be an hour not a mintues, UTC time only ExpiryFlg bool //if you want to check token expiry time enable expiryflg true otherwise expirytime not check SecretKey string //jwt secretkey DB *gorm.DB //database connection DataBaseType Type RoleId int RoleName string OTPAttempt int //how many times otp attempt }
type MemberLoginCheck ¶
type SocialLogin ¶ added in v0.0.18
type TblMember ¶
type TblMember struct { Id int Uuid string FirstName string LastName string Email string MobileNo string IsActive int ProfileImage string ProfileImagePath string LastLogin int MemberGroupId int Password string Username string Otp int OtpExpiry time.Time LoginTime time.Time IsDeleted int DeletedOn time.Time DeletedBy int CreatedOn time.Time CreatedBy int ModifiedOn time.Time ModifiedBy int TenantId int }
type TblModulePermission ¶
type TblMstrTenant ¶ added in v0.0.18
type TblRolePermission ¶
type TblStorageType ¶ added in v0.0.21
type TblStorageType struct { Id int Local string Aws datatypes.JSONMap `gorm:"type:jsonb"` Azure datatypes.JSONMap `gorm:"type:jsonb"` Drive datatypes.JSONMap `gorm:"type:jsonb"` SelectedType string }
func GetSelectedType ¶ added in v0.0.21
func GetSelectedType(Db *gorm.DB) (storageType TblStorageType, err error)
type Tblrole ¶ added in v0.0.18
type Tblrole struct { Id int `gorm:"column:id"` Name string `gorm:"column:name"` Description string `gorm:"column:description"` Slug string `gorm:"column:slug"` IsActive int `gorm:"column:is_active"` IsDeleted int `gorm:"column:is_deleted"` CreatedOn time.Time `gorm:"column:created_on"` CreatedBy int `gorm:"column:created_by"` ModifiedOn time.Time `gorm:"column:modified_on;DEFAULT:NULL"` ModifiedBy int `gorm:"column:modified_by;DEFAULT:NULL"` CreatedDate string `gorm:"-:migration;<-:false"` User []Tbluser `gorm:"-"` TenantId int `gorm:"column:tenant_id;DEFAULT:NULL"` }
type Tbluser ¶ added in v0.0.17
type Tbluser struct { Id int `gorm:"column:id"` Uuid string `gorm:"column:uuid"` FirstName string `gorm:"column:first_name"` LastName string `gorm:"column:last_name"` RoleId int `gorm:"column:role_id"` Email string `gorm:"column:email"` Username string `gorm:"column:username"` Password string `gorm:"column:password"` MobileNo string `gorm:"column:mobile_no"` IsActive int `gorm:"column:is_active"` ProfileImage string `gorm:"column:profile_image"` ProfileImagePath string `gorm:"column:profile_image_path"` StorageType string `gorm:"column:storage_type"` DataAccess int `gorm:"column:data_access"` CreatedOn time.Time `gorm:"column:created_on"` CreatedBy int `gorm:"column:created_by"` ModifiedOn time.Time `gorm:"column:modified_on;DEFAULT:NULL"` ModifiedBy int `gorm:"column:modified_by;DEFAULT:NULL"` LastLogin time.Time `gorm:"column:last_login;DEFAULT:NULL"` IsDeleted int `gorm:"column:is_deleted"` DeletedOn time.Time `gorm:"column:deleted_on;DEFAULT:NULL"` DeletedBy int `gorm:"column:deleted_by;DEFAULT:NULL"` ModuleName string `gorm:"-"` RouteName string `gorm:"-:migration;<-:false"` DisplayName string `gorm:"-:migration;<-:false"` Description string `gorm:"-"` ModuleId int `gorm:"-:migration;<-:false"` PermissionId int `gorm:"-"` FullAccessPermission int `gorm:"-:migration;<-:false"` RoleName string `gorm:"-:migration;<-:false"` DefaultLanguageId int `gorm:"column:default_language_id"` NameString string `gorm:"-"` TenantId int Otp int `gorm:"column:otp"` OtpExpiry *time.Time `gorm:"column:otp_expiry"` }
Click to show internal directories.
Click to hide internal directories.