Documentation ¶
Index ¶
- Constants
- func BaseURL(c *gin.Context) string
- func CalculatePercentageChange(current, previous int) float64
- func GenerateRandomNumber(length int) (int, error)
- func GenerateRandomString(length int) (string, error)
- func GenerateToken(JWTSecretKey, email, name, userid string) (signedToken string, err error)
- func GetBaseURL(c *gin.Context) string
- func GetFile(assetParam admin.AssetParams) (*admin.AssetResult, error)
- func HashPassword(password string) (string, error)
- func ParseTemplateFile(filename string, mapping interface{}) (string, error)
- func RandRange(min, max int) int
- func ReturnError(c *gin.Context, message string, err error, status int)
- func ReturnJSON(c *gin.Context, message string, data interface{}, statusCode int)
- func SendEmail(subject, fromName, template, name, email string, templateData interface{})
- func TimeNow(timezone string) (string, error)
- func UploadFile(file io.Reader, filename string) (*uploader.UploadResult, error)
- type AccountReset
- type AccountStatus
- type AppError
- type AuthTokenJwtClaim
- type IError
- type ListProjectOffsets
- type OtpVerify
- type ProjectType
- type UpdateAccountInformation
- type UserRepositoryInterface
Constants ¶
View Source
const ( INVALID_REQUEST_BODY = "invalid request body" REQUEST_BODY_PARSE_ERROR = "request body parse error" )
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomNumber ¶
func GenerateRandomString ¶
func GenerateToken ¶
GenerateToken generates a jwt token
func GetBaseURL ¶
func GetFile ¶
func GetFile(assetParam admin.AssetParams) (*admin.AssetResult, error)
func HashPassword ¶
func ParseTemplateFile ¶
func SendEmail ¶
func SendEmail(subject, fromName, template, name, email string, templateData interface{})
func UploadFile ¶
Types ¶
type AccountReset ¶
type AccountReset struct {
Email string `json:"email" validate:"required,email"`
}
type AccountStatus ¶
type AccountStatus int
type AuthTokenJwtClaim ¶
type AuthTokenJwtClaim struct { Email string Name string UserId string jwt.StandardClaims }
func GetAuthenticatedUser ¶
func GetAuthenticatedUser(c *gin.Context) (*AuthTokenJwtClaim, error)
type ListProjectOffsets ¶
type ListProjectOffsets struct {
Projects []string `json:"projects" validate:"required"`
}
type ProjectType ¶
type ProjectType string
type UserRepositoryInterface ¶
type UserRepositoryInterface interface { Where(condition, value string) ([]*models.User, error) FindByCondition(condition, value string) (*models.User, bool, error) FindByAccountType(value string) ([]*models.User, bool, error) Find(id uuid.UUID) (*models.User, error) Exists(id uuid.UUID) (bool, error) Create(item *models.User) error Save(u *models.User) (*models.User, error) RawCount(q string, count *int64) error QueryWithArgs(q string, args ...interface{}) ([]*models.User, error) RawSmartSelect(q string, res interface{}, args ...interface{}) error }
Click to show internal directories.
Click to hide internal directories.