Documentation ¶
Index ¶
- Constants
- Variables
- func BinPath() string
- func Clamp(val, min, max int) int
- func CloseFile(mFile *os.File)
- func CreateFile(fileName string) (*os.File, error)
- func CssStaticUrl() string
- func FontsStaticUrl() string
- func GetGasUrl() string
- func GetStringFromURL(r *http.Request, key string, defaultVal string) string
- func HashBySha256(val string) string
- func Hostname() string
- func IsFileOrDirExist(path string) bool
- func OpenPngAsByte(filePath string) ([]byte, error)
- func PixelToInt(val string) int
- func ResponseByJSON(w http.ResponseWriter, statusCode int, message string)
- func ResponseByPage(w http.ResponseWriter, r *http.Request, statusCode int, message string)
- func ResponseByQRCode(w http.ResponseWriter, statusCode int, message string)
- func SaveBytesAsPng(filePath string, data []byte) error
- type ResponseMethod
Constants ¶
View Source
const ( BackgroundColor = "#2885D3" ContainerColor = "#151718" ContainerWidth = "700px" FontSize = "18px" DefaultCssStyle = "TomorrowNight-dark" DefaultFontStyle = "fontsFace" )
View Source
const ( MaxLocalCatchOfImg = 50 MaxCodeLength = 2000 MaxCodeLines = 50 MaxLocalCatchOfCode = 50 )
Variables ¶
View Source
var CssStyle = map[string]string{
"TomorrowNight-dark": "TomorrowNight-dark",
"Coy-light": "Coy-light",
"Default-light": "Default-light",
"Funky-dark": "Funky-dark",
"Okaidia-dark": "Okaidia-dark",
"SolarizedLight-light": "SolarizedLight-light",
"Twilight-dark": "Twilight-dark",
}
View Source
var GolangImg []byte
Functions ¶
func CssStaticUrl ¶
func CssStaticUrl() string
func FontsStaticUrl ¶
func FontsStaticUrl() string
func GetStringFromURL ¶
func HashBySha256 ¶
func IsFileOrDirExist ¶
func OpenPngAsByte ¶
func PixelToInt ¶
func ResponseByJSON ¶
func ResponseByJSON(w http.ResponseWriter, statusCode int, message string)
func ResponseByPage ¶
func ResponseByQRCode ¶
func ResponseByQRCode(w http.ResponseWriter, statusCode int, message string)
func SaveBytesAsPng ¶
Types ¶
type ResponseMethod ¶
type ResponseMethod int
const ( Json ResponseMethod = 0 QRCode ResponseMethod = 1 Page ResponseMethod = 2 )
Click to show internal directories.
Click to hide internal directories.