Documentation ¶
Index ¶
- Constants
- Variables
- func Auth(next echo.HandlerFunc) echo.HandlerFunc
- func FormErrID(c echo.Context, a interface{}) error
- func GetFlashdata(c echo.Context, name string) []string
- func MySQL() (*sql.DB, error)
- func Postgres() (*sql.DB, error)
- func SetFlashdata(c echo.Context, name, value string)
- func TestPing()
- type CustomValidator
Constants ¶
View Source
const CSRF_KEY = "csrf_token"
View Source
const SESSION_ID = "id"
Variables ¶
View Source
var DateDisplay = "2006-01-02"
View Source
var DateTimeDisplay = "2006-01-02 15:04:05"
View Source
var E = echo.New()
View Source
var ECSRF = middleware.CSRFWithConfig(middleware.CSRFConfig{ TokenLookup: "form:" + CSRF_KEY, ContextKey: CSRF_KEY, })
** * CSRF bawaan echo * e.Use(ECSRF) * Digunakan di route web *
View Source
var FormErrors map[string]interface{}
View Source
var GCSRF = csrf.Protect( []byte("AB4F63F9AC65152575886860DDE480A1"), csrf.RequestHeader(CSRF_KEY), csrf.FieldName(CSRF_KEY), csrf.ErrorHandler(http.HandlerFunc(serverError403)), )
*** * gorilla csrf * Dipasang di route web yang ingin dengan csrf *
View Source
var GetJson map[string]m
View Source
var Header = "header"
View Source
var Layout = "main-layout"
View Source
var Modals = "modals"
View Source
var Popup = "popup"
View Source
var SessionStore = newCookieStore()
pilih session yang digunakan
View Source
var Sidebar = "sidebar"
View Source
var TimeZone = "asia/jakarta"
Functions ¶
func Auth ¶
func Auth(next echo.HandlerFunc) echo.HandlerFunc
func SetFlashdata ¶
Types ¶
type CustomValidator ¶
type CustomValidator struct {
// contains filtered or unexported fields
}
custom form validator
func (*CustomValidator) Validate ¶
func (cv *CustomValidator) Validate(i interface{}) error
Click to show internal directories.
Click to hide internal directories.