package main
import (
"net/http"
"github.com/d4l3k/go-pry/pry"
"github.com/gin-gonic/gin"
)
func main() {
router := gin.Default()
router.LoadHTMLGlob("templates/*")
router.Static("/assets", "./assets")
router.GET("/", handleRoot)
router.Run(":1234")
}
func handleRoot(c *gin.Context) {
pry.Apply(&pry.Scope{Vals:map[string]interface{}{ "main": main, "handleRoot": handleRoot, "http": pry.Package{Name: "http", Functions: map[string]interface{}{"ErrBodyReadAfterClose": http.ErrBodyReadAfterClose,"ErrLineTooLong": http.ErrLineTooLong,"SetCookie": http.SetCookie,"MethodHead": http.MethodHead,"MethodPost": http.MethodPost,"MethodPut": http.MethodPut,"MethodPatch": http.MethodPatch,"MethodConnect": http.MethodConnect,"MethodTrace": http.MethodTrace,"MethodGet": http.MethodGet,"MethodDelete": http.MethodDelete,"MethodOptions": http.MethodOptions,"Dir": pry.Type(http.Dir("")),"ServeFile": http.ServeFile,"FileServer": http.FileServer,"ServeContent": http.ServeContent,"StatusPermanentRedirect": http.StatusPermanentRedirect,"StatusPaymentRequired": http.StatusPaymentRequired,"StatusExpectationFailed": http.StatusExpectationFailed,"StatusNotImplemented": http.StatusNotImplemented,"StatusServiceUnavailable": http.StatusServiceUnavailable,"StatusMultipleChoices": http.StatusMultipleChoices,"StatusProxyAuthRequired": http.StatusProxyAuthRequired,"StatusRequestEntityTooLarge": http.StatusRequestEntityTooLarge,"StatusNonAuthoritativeInfo": http.StatusNonAuthoritativeInfo,"StatusMovedPermanently": http.StatusMovedPermanently,"StatusUseProxy": http.StatusUseProxy,"StatusIMUsed": http.StatusIMUsed,"StatusMultiStatus": http.StatusMultiStatus,"StatusUnprocessableEntity": http.StatusUnprocessableEntity,"StatusFailedDependency": http.StatusFailedDependency,"StatusInternalServerError": http.StatusInternalServerError,"StatusOK": http.StatusOK,"StatusRequestTimeout": http.StatusRequestTimeout,"StatusRequestedRangeNotSatisfiable": http.StatusRequestedRangeNotSatisfiable,"StatusInsufficientStorage": http.StatusInsufficientStorage,"StatusSeeOther": http.StatusSeeOther,"StatusPartialContent": http.StatusPartialContent,"StatusUnavailableForLegalReasons": http.StatusUnavailableForLegalReasons,"StatusContinue": http.StatusContinue,"StatusNotAcceptable": http.StatusNotAcceptable,"StatusConflict": http.StatusConflict,"StatusAlreadyReported": http.StatusAlreadyReported,"StatusTeapot": http.StatusTeapot,"StatusPreconditionRequired": http.StatusPreconditionRequired,"StatusUnauthorized": http.StatusUnauthorized,"StatusLocked": http.StatusLocked,"StatusRequestHeaderFieldsTooLarge": http.StatusRequestHeaderFieldsTooLarge,"StatusVariantAlsoNegotiates": http.StatusVariantAlsoNegotiates,"StatusNetworkAuthenticationRequired": http.StatusNetworkAuthenticationRequired,"StatusPreconditionFailed": http.StatusPreconditionFailed,"StatusForbidden": http.StatusForbidden,"StatusLengthRequired": http.StatusLengthRequired,"StatusGatewayTimeout": http.StatusGatewayTimeout,"StatusLoopDetected": http.StatusLoopDetected,"StatusBadRequest": http.StatusBadRequest,"StatusNotExtended": http.StatusNotExtended,"StatusText": http.StatusText,"StatusProcessing": http.StatusProcessing,"StatusMethodNotAllowed": http.StatusMethodNotAllowed,"StatusRequestURITooLong": http.StatusRequestURITooLong,"StatusNoContent": http.StatusNoContent,"StatusHTTPVersionNotSupported": http.StatusHTTPVersionNotSupported,"StatusTooManyRequests": http.StatusTooManyRequests,"StatusNotFound": http.StatusNotFound,"StatusSwitchingProtocols": http.StatusSwitchingProtocols,"StatusGone": http.StatusGone,"StatusUnsupportedMediaType": http.StatusUnsupportedMediaType,"StatusUpgradeRequired": http.StatusUpgradeRequired,"StatusBadGateway": http.StatusBadGateway,"StatusFound": http.StatusFound,"StatusAccepted": http.StatusAccepted,"StatusResetContent": http.StatusResetContent,"StatusNotModified": http.StatusNotModified,"StatusTemporaryRedirect": http.StatusTemporaryRedirect,"StatusCreated": http.StatusCreated,"DefaultClient": http.DefaultClient,"PostForm": http.PostForm,"Head": http.Head,"Get": http.Get,"ErrUseLastResponse": http.ErrUseLastResponse,"Post": http.Post,"DefaultMaxIdleConnsPerHost": http.DefaultMaxIdleConnsPerHost,"ErrSkipAltProtocol": http.ErrSkipAltProtocol,"ProxyFromEnvironment": http.ProxyFromEnvironment,"DefaultTransport": http.DefaultTransport,"ProxyURL": http.ProxyURL,"NoBody": http.NoBody,"NewFileTransport": http.NewFileTransport,"ErrNotMultipart": http.ErrNotMultipart,"ErrNoCookie": http.ErrNoCookie,"MaxBytesReader": http.MaxBytesReader,"ParseHTTPVersion": http.ParseHTTPVersion,"ErrMissingContentLength": http.ErrMissingContentLength,"ErrNotSupported": http.ErrNotSupported,"ErrMissingBoundary": http.ErrMissingBoundary,"ReadRequest": http.ReadRequest,"ErrMissingFile": http.ErrMissingFile,"NewRequest": http.NewRequest,"ErrShortBody": http.ErrShortBody,"ErrHeaderTooLong": http.ErrHeaderTooLong,"ErrUnexpectedTrailer": http.ErrUnexpectedTrailer,"StateActive": http.StateActive,"StateClosed": http.StateClosed,"DefaultMaxHeaderBytes": http.DefaultMaxHeaderBytes,"NotFoundHandler": http.NotFoundHandler,"ErrBodyNotAllowed": http.ErrBodyNotAllowed,"TimeFormat": http.TimeFormat,"DefaultServeMux": http.DefaultServeMux,"ErrServerClosed": http.ErrServerClosed,"NotFound": http.NotFound,"StripPrefix": http.StripPrefix,"ServerContextKey": http.ServerContextKey,"ErrAbortHandler": http.ErrAbortHandler,"LocalAddrContextKey": http.LocalAddrContextKey,"StateHijacked": http.StateHijacked,"Handle": http.Handle,"TrailerPrefix": http.TrailerPrefix,"ListenAndServeTLS": http.ListenAndServeTLS,"RedirectHandler": http.RedirectHandler,"Serve": http.Serve,"NewServeMux": http.NewServeMux,"ErrHijacked": http.ErrHijacked,"ServeTLS": http.ServeTLS,"StateNew": http.StateNew,"ListenAndServe": http.ListenAndServe,"Error": http.Error,"ConnState": pry.Type(http.ConnState(0)),"ErrWriteAfterFlush": http.ErrWriteAfterFlush,"TimeoutHandler": http.TimeoutHandler,"ErrContentLength": http.ErrContentLength,"Redirect": http.Redirect,"HandleFunc": http.HandleFunc,"StateIdle": http.StateIdle,"ErrHandlerTimeout": http.ErrHandlerTimeout,"ErrNoLocation": http.ErrNoLocation,"ReadResponse": http.ReadResponse,"DetectContentType": http.DetectContentType,"Header": pry.Type(http.Header(map[string][]string(nil))),"ParseTime": http.ParseTime,"CanonicalHeaderKey": http.CanonicalHeaderKey,}}, "pry": pry.Package{Name: "pry", Functions: map[string]interface{}{"NewScope": pry.NewScope,"StringToType": pry.StringToType,"ValuesToInterfaces": pry.ValuesToInterfaces,"ErrChanSendFailed": pry.ErrChanSendFailed,"ErrBranchBreak": pry.ErrBranchBreak,"ErrBranchContinue": pry.ErrBranchContinue,"Fuzz": pry.Fuzz,"Type": pry.Type,"Append": pry.Append,"Make": pry.Make,"Close": pry.Close,"Len": pry.Len,"ErrChanRecvInSelect": pry.ErrChanRecvInSelect,"ErrDivisionByZero": pry.ErrDivisionByZero,"DeAssign": pry.DeAssign,"ComputeBinaryOp": pry.ComputeBinaryOp,"ErrChanRecvFailed": pry.ErrChanRecvFailed,"Highlight": pry.Highlight,"Pry": pry.Pry,"Apply": pry.Apply,}}, "gin": pry.Package{Name: "gin", Functions: map[string]interface{}{"AuthUserKey": gin.AuthUserKey,"Accounts": pry.Type(gin.Accounts(map[string]string(nil))),"BasicAuthForRealm": gin.BasicAuthForRealm,"BasicAuth": gin.BasicAuth,"Bind": gin.Bind,"H": pry.Type(gin.H(map[string]interface {}(nil))),"BindKey": gin.BindKey,"WrapH": gin.WrapH,"WrapF": gin.WrapF,"CreateTestContext": gin.CreateTestContext,"Dir": gin.Dir,"DebugMode": gin.DebugMode,"TestMode": gin.TestMode,"DefaultWriter": gin.DefaultWriter,"SetMode": gin.SetMode,"DisableBindValidation": gin.DisableBindValidation,"ENV_GIN_MODE": gin.ENV_GIN_MODE,"DefaultErrorWriter": gin.DefaultErrorWriter,"Mode": gin.Mode,"ReleaseMode": gin.ReleaseMode,"RecoveryWithWriter": gin.RecoveryWithWriter,"Recovery": gin.Recovery,"ErrorLoggerT": gin.ErrorLoggerT,"LoggerWithWriter": gin.LoggerWithWriter,"ErrorLogger": gin.ErrorLogger,"DisableConsoleColor": gin.DisableConsoleColor,"Logger": gin.Logger,"IsDebugging": gin.IsDebugging,"New": gin.New,"Default": gin.Default,"Version": gin.Version,"MIMEJSON": gin.MIMEJSON,"MIMEXML2": gin.MIMEXML2,"MIMEPlain": gin.MIMEPlain,"MIMEPOSTForm": gin.MIMEPOSTForm,"MIMEHTML": gin.MIMEHTML,"MIMEXML": gin.MIMEXML,"MIMEMultipartPOSTForm": gin.MIMEMultipartPOSTForm,"ErrorTypeRender": gin.ErrorTypeRender,"ErrorTypePrivate": gin.ErrorTypePrivate,"ErrorTypePublic": gin.ErrorTypePublic,"ErrorTypeNu": gin.ErrorTypeNu,"ErrorTypeBind": gin.ErrorTypeBind,"ErrorTypeAny": gin.ErrorTypeAny,"ErrorType": pry.Type(gin.ErrorType(0x0)),}}, }})
c.HTML(http.StatusOK, "index.tmpl", nil)
}