Documentation ¶
Index ¶
- Constants
- Variables
- func Base64URLBytesEncode(str []byte) string
- func CheckErrorExist(ctx *gin.Context, err error, statusCode int) bool
- func CheckPermission(action, tableName string, userGroup *models.UserGroup) bool
- func ContainsString(s []string, e string) bool
- func CopyFile(sourceBucket, destinationBucket string, ...) error
- func CreateHostedZone(externalDomain string) (hostedZoneId string, nsRecords []string, err error)
- func Decode(s string) []byte
- func Decrypt(text, MySecret string) (string, error)
- func DeleteAllResourceRecordSets(hostedZoneID string) error
- func DeleteObject(bucketName, objectKey string) error
- func DeleteS3Folder(bucket, folder string) error
- func Encode(b []byte) string
- func Encrypt(text, MySecret string) (string, error)
- func FailOnError(err error, msg string)
- func GeneratToken() (string, error)
- func GenerateJwtToken() (accToken string, err error)
- func GenerateTpJwtToken(accountId, tpAccountId, userGroup string) (accToken string, err error)
- func GetAccountId(c *gin.Context) (string, error)
- func GetAccountIdField(tokenString string) (string, error)
- func GetAuthorizedField(tokenString string) (bool, error)
- func GetFlatOfArray(values []interface{}) (interface{}, error)
- func GetFlatOfInterface(values interface{}, ended *bool) interface{}
- func GetFromNestedJson(jsonBytes []byte, keys []string, index int) (interface{}, error)
- func GetMD5Hash(text string) string
- func GetNewUuid() string
- func GetObjectSize(bucketName, objectKey string) (int64, error)
- func GetObjectURL(bucketName, objectKey string, duration time.Duration) (string, error)
- func GetProjectDatabaseName(accountId string, projectName string) string
- func GetThirdPartyAccountId(c *gin.Context) (tpAccountId string, err error)
- func GetTpAccountIdField(tokenString string) (string, error)
- func GetUserGroup(tokenString string) (string, error)
- func GetUserPlan(accountId, projectType string) (map[string]interface{}, error)
- func HashPassword(password string) (hashedPassword string, err error)
- func InitializeDB() (*dbPkg.DB, error)
- func InitializeIntegrationConsts(address string)
- func InitializeMockDB() (*dbPkg.DB, sqlmock.Sqlmock, error)
- func MakeObjectPublic(bucketName, objectKey string) error
- func RandStringRunes(n int, letterRunes []rune) string
- func RegisterCustomValidators()
- func RequestSubdomainCertificate(fqdn string) (certificateArn, validationRecordName, validationRecordValue string, err error)
- func SetUpRouter() *gin.Engine
- func ShouldRedirectWithError(ctx *gin.Context, err error, url string) bool
- func UploadByteSliceToS3(fileBytes []byte, bucket string, fileName string, size int64, ...) error
- func UploadFileToS3(file multipart.File, bucketName, fileName string, size int64, isPublic bool) error
- func UpsertRoute53Record(domain, value, hostedZoneId, recordType string) error
- func ValidateCertificate(tlsArn string) (bool, error)
- type Header
- type HttpClient
- type HttpHelper
Constants ¶
View Source
const ForgetPasswordUseCase = "forget_password" // for security_code table (user management)
constants
Variables ¶
View Source
var ErrDatabaseJobIsPending = errors.New("datbase job status is pending")
View Source
var ErrDatabaseJobResultAlreadyExists = errors.New("database job result already exists")
View Source
var ErrDomainNotAvailable = errors.New("domain isn't available")
View Source
var ErrIntegrationNotFound = errors.New("integration not found")
View Source
var ErrPageNotFound = errors.New("page not found")
View Source
var ErrProjectNotFound = errors.New("project not found")
View Source
var ErrReachLimitationOfPlan = errors.New("you have reached your limit. please upgrade your plan")
Errors
View Source
var ErrUserDatabaseNotFound = errors.New("database not found. this error occurs when your project has not database")
View Source
var ErrUserNotFound = errors.New("user not found")
View Source
var FullRunes = []rune("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
TODO: ADD COMMENT! Why are there magic strings in the code?
View Source
var GitIntegrationProviders = []string{"github", "gitlab", "bitbucket"}
View Source
var LowercaseRunes = []rune("0123456789abcdefghijklmnopqrstuvwxyz")
View Source
var SpecialProviders = []string{"slack", "instagram", "typeform", "ebay", "mailchimp", "airtable", "gumroad", "hubspot"}
SpecialProviders are not supported by goth package (https://github.com/markbates/goth)
View Source
var UserDatabaseDefaultTables = []string{"user_info", "user_group", "security_code", "views"}
Functions ¶
func Base64URLBytesEncode ¶
func CheckPermission ¶
func ContainsString ¶
func CreateHostedZone ¶
func DeleteObject ¶
func DeleteS3Folder ¶
func FailOnError ¶
func GeneratToken ¶
func GenerateJwtToken ¶
GenerateJwtToken function generates a jwt token based on HS256 algorithm
func GenerateTpJwtToken ¶
GenerateJwtToken function generates a jwt token based on HS256 algorithm
func GetAccountIdField ¶
func GetAuthorizedField ¶
func GetFlatOfArray ¶
func GetFlatOfArray(values []interface{}) (interface{}, error)
func GetFlatOfInterface ¶
func GetFlatOfInterface(values interface{}, ended *bool) interface{}
func GetFromNestedJson ¶
func GetMD5Hash ¶
func GetNewUuid ¶
func GetNewUuid() string
func GetObjectSize ¶
func GetObjectURL ¶
func GetProjectDatabaseName ¶
func GetThirdPartyAccountId ¶
func GetTpAccountIdField ¶
func GetUserGroup ¶
func GetUserPlan ¶
func HashPassword ¶
HashPassword function hashes a plain text password with bcrypt package and return result
func InitializeDB ¶
func InitializeIntegrationConsts ¶
func InitializeIntegrationConsts(address string)
func InitializeMockDB ¶
func MakeObjectPublic ¶
func RandStringRunes ¶
func RegisterCustomValidators ¶
func RegisterCustomValidators()
func RequestSubdomainCertificate ¶
func RequestSubdomainCertificate(fqdn string) (certificateArn, validationRecordName, validationRecordValue string, err error)
RequestCertificate requests a certificate from AWS Certificate Manager and returns the ARN of the certificate plus the validation record name and value
func SetUpRouter ¶
func ShouldRedirectWithError ¶
func UploadByteSliceToS3 ¶
func UploadFileToS3 ¶
func UploadFileToS3(file multipart.File, bucketName, fileName string, size int64, isPublic bool) error
This function uploads a file to S3 bucket. You can specify the bucket name, file name, file size and whether the file is public or not.
func UpsertRoute53Record ¶
func ValidateCertificate ¶
Types ¶
type HttpClient ¶
func NewHttpClient ¶
func NewHttpClient() HttpClient
type HttpHelper ¶
type HttpHelper interface {
HttpRequest(method string, url string, body io.Reader, headers []Header, timeout time.Duration, followRedirect bool) (out []byte, err error, statusCode int, header *http.Header)
}
func NewHttpHelper ¶
func NewHttpHelper(client HttpClient) HttpHelper
Click to show internal directories.
Click to hide internal directories.