Documentation ¶
Index ¶
- Constants
- Variables
- func AddRouterGroup(group string, route string, method string, fp func(*gin.Context))
- func CheckLastModified(w http.ResponseWriter, r *http.Request, modtime time.Time) bool
- func ClearSession(c *gin.Context)
- func GetRequestBody(c *gin.Context) ([]byte, error)
- func GetSessionKey(c *gin.Context, key string) (sessionKey string)
- func Initialize(mode string, cookieDomain string)
- func InitializeLite(mode string)
- func ReadFileBase64(path string, c *gin.Context)
- func ReadGzipCSSFile(path string, c *gin.Context)
- func ReadGzipJSFile(path string, c *gin.Context)
- func ReadHTMLFile(path string, c *gin.Context)
- func ReadJSFile(path string, c *gin.Context)
- func ReadJSONFile(path string, c *gin.Context)
- func ReadJpgFile(path string, c *gin.Context)
- func ReadPngFile(path string, c *gin.Context)
- func RenderHTML(html string, c *gin.Context)
- func RespondEotFile(data []byte, modTime time.Time, c *gin.Context)
- func RespondError(message string) []byte
- func RespondGzipCSSFile(data []byte, modTime time.Time, c *gin.Context)
- func RespondGzipJSFile(data []byte, modTime time.Time, c *gin.Context)
- func RespondJSFile(data []byte, modTime time.Time, c *gin.Context)
- func RespondJSON(v interface{}, c *gin.Context)
- func RespondOtfFile(data []byte, modTime time.Time, c *gin.Context)
- func RespondSvgFile(data []byte, modTime time.Time, c *gin.Context)
- func RespondTtfFile(data []byte, modTime time.Time, c *gin.Context)
- func RespondWoff2File(data []byte, modTime time.Time, c *gin.Context)
- func RespondWoffFile(data []byte, modTime time.Time, c *gin.Context)
- func SaveSession(c *gin.Context)
- func SetSessionKey(c *gin.Context, key string, value string)
- type ErrorResponse
- type LocaleLanguage
Constants ¶
View Source
const StatusNotModified = 304 // RFC 7232, 4.1
View Source
const TimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT"
Variables ¶
View Source
var Router *gin.Engine
Functions ¶
func AddRouterGroup ¶
func CheckLastModified ¶
modtime is the modification time of the resource to be served, or IsZero(). return value is whether this request is now complete.
func ClearSession ¶
func Initialize ¶
func InitializeLite ¶
func InitializeLite(mode string)
func ReadFileBase64 ¶
Reads a file and responds with a base64 encoded string. Primarily used for jquery ajax response binary data blob encoding.
func ReadGzipCSSFile ¶
func ReadGzipJSFile ¶
func ReadHTMLFile ¶
Reads a file from the path parameter and returns to the client as text/html.
func ReadJSFile ¶
func ReadJSONFile ¶
Reads a file from the path parameter and returns to the client application/json
func ReadJpgFile ¶
func ReadPngFile ¶
func RenderHTML ¶
Takes a string and returns to the client as text/html.
func RespondError ¶
Returns an byte array comprised of a JSON formated object with the error message.
func RespondJSON ¶
Returns to the client application/json format for the passed interface.
func SaveSession ¶
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
type LocaleLanguage ¶
func GetLocaleLanguage ¶
func GetLocaleLanguage(c *gin.Context) (ll LocaleLanguage)
Click to show internal directories.
Click to hide internal directories.