db

package
v0.0.0-...-f10ba98 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Date

func Date(fl validator.FieldLevel) bool

func InitDB

func InitDB(env *Env) *gorm.DB

func NewDsn

func NewDsn(dialect string, user string, password string, host string, port string, db string) (dsn string)

func NewValidator

func NewValidator() echo.Validator

Types

type Application

type Application struct {
	Env *Env
	Db  *gorm.DB
}

func App

func App() Application

type Env

type Env struct {
	AppEnv           string `mapstructure:"APP_ENV"`
	ServerAddress    string `mapstructure:"SERVER_ADDRESS"`
	ServerPort       int    `mapstructure:"SERVER_PORT"`
	ContextTimeout   int    `mapstructure:"CONTEXT_TIMEOUT"`
	DBDialect        string `mapstructure:"DB_DIALECT"`
	DBHost           string `mapstructure:"DB_HOST"`
	DBPort           string `mapstructure:"DB_PORT"`
	PostgresDB       string `mapstructure:"POSTGRES_DB"`
	PostgresUser     string `mapstructure:"POSTGRES_USER"`
	PostgresPassword string `mapstructure:"POSTGRES_PASSWORD"`

	AccessTokenSecret      string `mapstructure:"ACCESS_TOKEN_SECRET"`
	RefreshTokenSecret     string `mapstructure:"REFRESH_TOKEN_SECRET"`
	AccessTokenExpiryHour  int    `mapstructure:"ACCESS_TOKEN_EXPIRY_HOUR"`
	RefreshTokenExpiryHour int    `mapstructure:"REFRESH_TOKEN_EXPIRY_HOUR"`

	EmailSenderName     string `mapstructure:"EMAIL_SENDER_NAME"`
	EmailSenderAddress  string `mapstructure:"EMAIL_SENDER_ADDRESS"`
	EmailSenderPassword string `mapstructure:"EMAIL_SENDER_PASSWORD"`

	TwiliSmsNumber      string `mapstructure:"TWILIO_SMS_NUMBER"`
	TwiliWhatsappNumber string `mapstructure:"TWILIO_WHATSAPP_NUMBER"`
	TwiliMyNumber       string `mapstructure:"TWILIO_MY_NUMBER"`
	TwilioAccountSid    string `mapstructure:"TWILIO_ACCOUNT_SID"`
	TwilioAuthToken     string `mapstructure:"TWILIO_AUTH_TOKEN"`
}

func NewEnv

func NewEnv() *Env

Jump to

Keyboard shortcuts

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