Documentation ¶
Overview ¶
Package source holds all the assets for Statping. This includes CSS, JS, SCSS, HTML and other website related content. This package uses Rice to compile all assets into a single 'rice-box.go' file.
Required Dependencies ¶
- rice -> https://github.com/GeertJohan/go.rice - sass -> https://sass-lang.com/install
Compile Assets ¶
To compile all the HTML, JS, SCSS, CSS and image assets you'll need to have rice and sass installed on your local system.
sass source/scss/base.scss source/css/base.css cd source && rice embed-go
More info on: https://github.com/hunterlong/statping
Code generated by go generate; DO NOT EDIT. This file was generated by robots at 2019-02-20 20:48:21.189612 -0800 PST m=+0.033163561
This contains the most recently Markdown source for the Statping Wiki.
Index ¶
- Variables
- func Assets()
- func CompileSASS(folder string) error
- func CopyAllToPublic(box *rice.Box, folder string) error
- func CopyToPublic(box *rice.Box, folder, file string) error
- func CreateAllAssets(folder string) error
- func DeleteAllAssets(folder string) error
- func HelpMarkdown() string
- func MakePublicFolder(folder string) error
- func OpenAsset(folder, file string) string
- func SaveAsset(data []byte, folder, file string) error
- func UsingAssets(folder string) bool
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( CssBox *rice.Box // CSS files from the 'source/css' directory, this will be loaded into '/assets/css' ScssBox *rice.Box // SCSS files from the 'source/scss' directory, this will be loaded into '/assets/scss' JsBox *rice.Box // JS files from the 'source/js' directory, this will be loaded into '/assets/js' TmplBox *rice.Box // HTML and other small files from the 'source/tmpl' directory, this will be loaded into '/assets' FontBox *rice.Box // HTML and other small files from the 'source/tmpl' directory, this will be loaded into '/assets' )
var CompiledWiki = []byte("<a class=\"scrollclick\" href=\"#\" data-id=\"page_0\">Types of Monitoring</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_1\">Features</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_2\">Start Statping</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_3\">Linux</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_4\">Mac</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_5\">Windows</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_6\">AWS EC2</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_7\">Docker</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_8\">Mobile App</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_9\">Heroku</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_10\">API</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_11\">Makefile</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_12\">Notifiers</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_13\">Notifier Events</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_14\">Notifier Example</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_15\">Prometheus Exporter</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_16\">SSL</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_17\">Config with .env File</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_18\">Static Export</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_19\">Statping Plugins</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_20\">Statuper</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_21\">Build and Test</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_22\">Contributing</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_23\">PGP Signature</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_24\">Testing</a><br><a class=\"scrollclick\" href=\"#\" data-id=\"page_25\">Deployment</a><br>\n\n<div class=\"mt-5\" id=\"page_0\"><h1>Types of Monitoring</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_1\"><h1>Features</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_2\"><h1>Start Statping</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_3\"><h1>Linux</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_4\"><h1>Mac</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_5\"><h1>Windows</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_6\"><h1>AWS EC2</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_7\"><h1>Docker</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_8\"><h1>Mobile App</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_9\"><h1>Heroku</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_10\"><h1>API</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_11\"><h1>Makefile</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_12\"><h1>Notifiers</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_13\"><h1>Notifier Events</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_14\"><h1>Notifier Example</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_15\"><h1>Prometheus Exporter</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_16\"><h1>SSL</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_17\"><h1>Config with .env File</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_18\"><h1>Static Export</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_19\"><h1>Statping Plugins</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_20\"><h1>Statuper</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_21\"><h1>Build and Test</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_22\"><h1>Contributing</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_23\"><h1>PGP Signature</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_24\"><h1>Testing</h1></div>\n\n\n<div class=\"mt-5\" id=\"page_25\"><h1>Deployment</h1></div>\n")
CompiledWiki contains all of the Statping Wiki pages from the Github Wiki repo.
Functions ¶
func Assets ¶
func Assets()
Assets will load the Rice boxes containing the CSS, SCSS, JS, and HTML files.
func CompileSASS ¶
CompileSASS will attempt to compile the SASS files into CSS
func CopyAllToPublic ¶ added in v0.79.2
CopyAllToPublic will copy all the files in a rice box into a local folder
func CopyToPublic ¶
CopyToPublic will create a file from a rice Box to the '/assets' directory
func CreateAllAssets ¶
CreateAllAssets will dump HTML, CSS, SCSS, and JS assets into the '/assets' directory
func DeleteAllAssets ¶
DeleteAllAssets will delete the '/assets' folder
func HelpMarkdown ¶
func HelpMarkdown() string
HelpMarkdown will return the Markdown of help.md into HTML
func MakePublicFolder ¶
MakePublicFolder will create a new folder
func OpenAsset ¶
OpenAsset returns a file's contents as a string
Example ¶
OpenAsset("js", "main.js")
Output:
func SaveAsset ¶
SaveAsset will save an asset to the '/assets/' folder.
Example ¶
data := []byte("alert('helloooo')") SaveAsset(data, "js", "test.js")
Output:
func UsingAssets ¶
UsingAssets returns true if the '/assets' folder is found in the directory
Types ¶
This section is empty.