app

package
v0.0.0-...-e3d9ab2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvEnumProduction  = "production"
	EnvEnumAcceptance  = "acceptance"
	EnvEnumTesting     = "testing"
	EnvEnumDevelopment = "development"
)

Variables

View Source
var Brevo *brevo
View Source
var Cache *cache.Cache
View Source
var Config struct {
	ENV                     string `yaml:"-" env:"ENV"`
	HOST                    string `yaml:"host" env:"HOST"`
	PORT                    int    `yaml:"port" env:"PORT"`
	SITE_BASE_URL_API       string `yaml:"site_base_url_api" env:"SITE_BASE_URL_API"`
	SITE_BASE_URL_FE        string `yaml:"site_base_url_fe" env:"SITE_BASE_URL_FE"`
	COOKIE_DOMAIN           string `yaml:"cookie_domain" env:"COOKIE_DOMAIN"`
	COOKIE_HTTPS_ONLY       bool   `yaml:"cookie_https_only" env:"COOKIE_HTTPS_ONLY"`
	JWT_SECRET              string `yaml:"jwt_secret" env:"-"`
	JWT_SECRET_BASE64       string `yaml:"-" env:"JWT_SECRET"`
	STRIPE_SECRET_KEY       string `yaml:"stripe_secret_key" env:"STRIPE_SECRET_KEY"`
	STRIPE_WEBHOOK          string `yaml:"stripe_webhook" env:"STRIPE_WEBHOOK"`
	DB_HOST                 string `yaml:"db_host" env:"DB_HOST"`
	DB_PORT                 int    `yaml:"db_port" env:"DB_PORT"`
	DB_NAME                 string `yaml:"db_name" env:"DB_NAME"`
	DB_USER                 string `yaml:"db_user" env:"DB_USER"`
	DB_PASS                 string `yaml:"db_pass" env:"DB_PASS"`
	SMTP_HOST               string `yaml:"smtp_host" env:"SMTP_HOST"`
	SMTP_PORT               int    `yaml:"smtp_port" env:"SMTP_PORT"`
	SMTP_SENDER             string `yaml:"smtp_sender" env:"SMTP_SENDER"`
	SMTP_USER               string `yaml:"smtp_user" env:"SMTP_USER"`
	SMTP_PASS               string `yaml:"smtp_pass" env:"SMTP_PASS"`
	GOSCOPE2_USER           string `yaml:"goscope2_user" env:"GOSCOPE2_USER"`
	GOSCOPE2_PASS           string `yaml:"goscope2_pass" env:"GOSCOPE2_PASS"`
	SENDINBLUE_API_KEY      string `yaml:"sendinblue_api_key" env:"SENDINBLUE_API_KEY"`
	IMGBB_KEY               string `yaml:"imgbb_key" env:"IMGBB_KEY"`
	ONESIGNAL_APP_ID        string `yaml:"onesignal_app_id" env:"ONESIGNAL_APP_ID"`
	ONESIGNAL_REST_API_KEY  string `yaml:"onesignal_rest_api_key" env:"ONESIGNAL_REST_API_KEY"`
	APPSTORE_REVIEWER_EMAIL string `yaml:"appstore_reviewer_email" env:"APPSTORE_REVIEWER_EMAIL"`
	IMAGES_DIR              string `yaml:"images_dir" env:"IMAGES_DIR"`
}
View Source
var Faker = faker.New()
View Source
var OneSignalClient *onesignal.APIClient

Functions

func BrevoInit

func BrevoInit()

func CacheFindOrUpdate

func CacheFindOrUpdate[V any](key string, duration time.Duration, update func() (*V, error)) (*V, error)

func ConfigInit

func ConfigInit(pwd string, files ...string)

func ConfigTestInit

func ConfigTestInit(path string)

func DatabaseAutoMigrate

func DatabaseAutoMigrate(db *gorm.DB)

func DatabaseInit

func DatabaseInit() *gorm.DB

func MailCreate

func MailCreate() *models.Mail

func MailInit

func MailInit()

func MailSend

func MailSend(db *gorm.DB, m *models.Mail) error

func MailpitRemoveAllEmails

func MailpitRemoveAllEmails()

func OneSignalCreateNotification

func OneSignalCreateNotification(db *gorm.DB, userUIDs []string, notificationTitle, notificationContent onesignal.StringMap) error

Chunk notifications

func OneSignalEllipsisContent

func OneSignalEllipsisContent(content string) onesignal.StringMap

func OneSignalInit

func OneSignalInit()

func RunTestMain

func RunTestMain(m *testing.M, dbP **gorm.DB, configPath string)

Types

type OneSignalErrorResponse

type OneSignalErrorResponse struct {
	Errors   []string          `json:"errors,omitempty"`
	Warnings map[string]string `json:"warnings,omitempty"`
}

func (OneSignalErrorResponse) GetInvalidExternalUserIds

func (e OneSignalErrorResponse) GetInvalidExternalUserIds() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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