Documentation
¶
Index ¶
Constants ¶
View Source
const ( // PathGetJs is the GET endpoint for most of the javascript needed by the webapps. PathGetJs = "/_/js" // PathGetCss is the GET endpoint for all the css needed by the webapps. PathGetCss = "/_/css" // PathReload tells the server to reload all data from the file system. PathReload = "/_/r" // PathGetLabelsForFile is the GET endpoint for code block labels of one markdown file. PathGetLabelsForFile = "/_/getLabelsForFile" // PathGetHtmlForFile is the GET endpoint for HTML of one markdown file. PathGetHtmlForFile = "/_/getHtmlForFile" // PathRunBlock is the POST endpoint to trigger code block execution. PathRunBlock = "/_/runCodeBlock" // PathSave is the POST endpoint to save application state. PathSave = "/_/save" // KeyMdSessID is the param name for session ID. KeyMdSessID = "sid" // KeyIsTitleOn is the param name for is-the-title-on boolean. KeyIsTitleOn = "tit" KeyIsNavOn = "nav" // KeyMdFileIndex is the param name for the markdown file index. KeyMdFileIndex = "fix" // KeyBlockIndex is the param name for the code block index. KeyBlockIndex = "bix" )
These must all be unique, and preferably short. These are URL query parameter and cookie field names.
Variables ¶
View Source
var ( //go:embed session.js Js string )
Functions ¶
func AssureDefaults ¶
AssureDefaults inserts default values if values are missing.
Types ¶
type Bucket ¶
type Bucket struct { // The session ID. MdSessID TypeSessID // Is the header showing? IsHeaderOn bool IsNavOn bool // The active markdown file. MdFileIndex int // The active block in that file. BlockIndex int }
Bucket holds session state data, presumably associated with a cookie.
func ConvertToBucket ¶
ConvertToBucket creates a SessionData instance; a copy of the session data but in typesafe fields rather than a map of string to any.
Click to show internal directories.
Click to hide internal directories.