Documentation ¶
Index ¶
- Variables
- func ConnectDB(connName string, c db.Config) error
- func ErrorHandler(c *fiber.Ctx, err error) error
- func GetTrace(skip int) map[string]string
- func IsValid(v interface{}, tag string) bool
- func NewApp(cfg ...grest.App) *grest.App
- func NewErrorHandler(c *fiber.Ctx, statusCode int, message string, detail ...interface{}) error
- func ParseQuery(c *fiber.Ctx) url.Values
- func RemoveExpiredToken()
- func SendAlert(c *fiber.Ctx, message string, trace map[string]string)
- func Validate(lang string, v interface{}) error
- type Action
- type AnyTime
- type Ctx
- type LogInfo
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( APP_VERSION = "22.02.041727" APP_ENV = "production" APP_PORT = "4004" IS_MAIN_SERVER = false // set to true to run migration, seed and task scheduling CRYPTO_KEY = "3025ad23c43d4ef68a24d4f36cee560b" DB_DRIVER = "postgres" DB_HOST = "127.0.0.1" DB_PORT = 5432 DB_DATABASE = "grest-dev" DB_USERNAME = "postgres" DB_PASSWORD = "secret" DB_MAX_OPEN_CONNS = 25 DB_MAX_IDLE_CONNS = 25 DB_CONN_MAX_LIFETIME = time.Hour // on .env = "1h". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". DB_IS_DEBUG = false REDIS_HOST = "127.0.0.1" REDIS_PORT = "6379" REDIS_CACHE_DB = 0 REDIS_USERNAME = "" REDIS_PASSWORD = "" FS_DRIVER = "s3" FS_END_POINT = "s3.amazonaws.com" FS_PORT = 443 FS_REGION = "ap-southeast-1" FS_BUCKET_NAME = "grest-dev" FS_ACCESS_KEY = "" FS_SECRET_KEY = "" TELEGRAM_ALERT_TOKEN = "" TELEGRAM_ALERT_CHANNEL_ID = "" )
default config
Functions ¶
func ErrorHandler ¶
func NewErrorHandler ¶
func ParseQuery ¶
func RemoveExpiredToken ¶
func RemoveExpiredToken()
Types ¶
type Ctx ¶
type Ctx struct { Lang string Action Action User User IsTest bool IsPrintSQL bool MockDB sqlmock.Sqlmock // contains filtered or unexported fields }
func NewMockCtx ¶
func NewMockCtx() *Ctx
func (*Ctx) TxRollback ¶
func (c *Ctx) TxRollback()
type LogInfo ¶
type LogInfo struct { Error string `json:"error,omitempty"` Version string `json:"version,omitempty"` Env string `json:"env,omitempty"` Method string `json:"method,omitempty"` Path string `json:"path,omitempty"` IP []string `json:"ip,omitempty"` Slug string `json:"slug,omitempty"` Email string `json:"email,omitempty"` Referer string `json:"referer,omitempty"` Trace map[string]string `json:"trace,omitempty"` }
func NewLogInfo ¶
func NewLogInfo() LogInfo
Source Files ¶
Click to show internal directories.
Click to hide internal directories.