Documentation ¶
Overview ¶
Package session holds code to manage state in a cookie. TODO: continue this? If the only use case is to start the
server locally and run one session, then there's no case for storing a cookie and quickly putting the user back to the same codeblock in the same markdown. OTOH, if there's a development cycle here where the markdown is being editted and reloaded, using a cookie to get back to the same spot in the same markdown file could be nice.
Index ¶
Constants ¶
This section is empty.
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.