Documentation ¶
Index ¶
- Variables
- func BinSearchIndex(x string) int
- func CRC32Hasher(b []byte) uint32
- func Caller() string
- func CheckErr(err error) error
- func Entries() *[]string
- func Exists(k string) bool
- func IsBuilding() bool
- func IsLocked() bool
- func Lock()
- func Remove(k string)
- func SearchPath(path string) (string, error)
- func Set(k, sourceFile string, v *FData)
- func StartFrom(x string) <-chan string
- func Unlock()
- type FData
- type MapFS
- type MapFST
Constants ¶
This section is empty.
Variables ¶
var QuitOnErr bool
QuitOnErr Build vs local dev. Should probably be part of a config but for now if Doreload is true we set this also in serve
var UseMemFS = false
UseMemFS determines if local dev files are stored on disk or in memory
Functions ¶
func BinSearchIndex ¶ added in v0.4.3
BinSearchIndex finds where the element exists or where it would be inserted to keep slice sorted
func CRC32Hasher ¶ added in v0.4.3
CRC32Hasher is a simple means to check for changes
func IsBuilding ¶
func IsBuilding() bool
IsBuilding tells us if already in a build. if true then already at 1 0 != 1
func SearchPath ¶ added in v0.4.3
SearchPath starts at path and looks for .js|.mjs. Need the error so we stop the build if filecannot be found..
Types ¶
type FData ¶ added in v0.4.3
type FData struct { // store content/css/ssr per component/layout. // B can be the concatenated css for bundle.css, the layout file bytes or the compiled component. // If memory is an issue maybe let a flag decide what we keep in mem. B []byte // A component can have a script and maybe style so this applies in the latter case else it is nil. // Might be a litle confusing to see stylePath storing/using B and CSS getting appended but CSS is each component's css // of which we combine all. CSS []byte // Used to store prev compiled ssr which is reused if no changes to layout file. SSR []byte // flag that is used for now to signify that once file has been processed once it doesn't need to be done again. // This is specific to gopack for now anyway // Hash of last check Hash uint32 Processed bool }
FData todo: maybe keep local and have fucntions to do the work
type MapFST ¶ added in v0.4.3
type MapFST struct {
// contains filtered or unexported fields
}
MapFST just serves a purpose of holding buildDir and implementing serveHTTP so we are a HandlerFunc
func (*MapFST) ServeHTTP ¶ added in v0.4.3
func (h *MapFST) ServeHTTP(w http.ResponseWriter, r *http.Request)
Basically the inverse of StripPrefix logic. There is an overlap with names that breaks things as one can overwrite the other, "public"+... avoids this. eventually this and basically all other build related logic could become a "Builder" type that stores all config etc..