Documentation
¶
Index ¶
- func RegisterPlugin(name string, funcs []PluginFunc)
- type App
- func CreateDevModeTestApp(logger *utils.Logger, fileData map[string]string) (*App, *util.WorkFs, error)
- func CreateTestApp(logger *utils.Logger, fileData map[string]string) (*App, *util.WorkFs, error)
- func CreateTestAppInt(logger *utils.Logger, path string, fileData map[string]string, isDev bool) (*App, *util.WorkFs, error)
- func CreateTestAppRoot(logger *utils.Logger, fileData map[string]string) (*App, *util.WorkFs, error)
- func NewApp(sourceFS *util.SourceFs, workFS *util.WorkFs, logger *utils.Logger, ...) *App
- type PluginFunc
- type PluginMap
- type Request
- type SSEMessage
- type TestFile
- type TestFileInfo
- type TestReadFS
- func (f *TestReadFS) Glob(pattern string) ([]string, error)
- func (f *TestReadFS) Open(name string) (fs.File, error)
- func (f *TestReadFS) ParseFS(funcMap template.FuncMap, patterns ...string) (*template.Template, error)
- func (f *TestReadFS) ReadFile(name string) ([]byte, error)
- func (f *TestReadFS) Reset()
- func (f *TestReadFS) Stat(name string) (fs.FileInfo, error)
- func (d *TestReadFS) StaticFiles() []string
- type TestWriteFS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPlugin ¶
func RegisterPlugin(name string, funcs []PluginFunc)
RegisterPlugin registers a plugin with Clace
Types ¶
type App ¶
type App struct { *utils.Logger *utils.AppEntry Name string CustomLayout bool Config *util.AppConfig // contains filtered or unexported fields }
App is the main object that represents a Clace app. It is created when the app is loaded
func CreateDevModeTestApp ¶
func CreateTestApp ¶
func CreateTestAppInt ¶
func CreateTestAppRoot ¶
func (*App) Initialize ¶
type PluginFunc ¶ added in v0.3.0
type PluginFunc struct {
// contains filtered or unexported fields
}
PluginFunc is the Clace plugin function mapping to starlark function
type PluginMap ¶ added in v0.3.0
type PluginMap map[string]PluginFunc
PluginMap is the plugin function mapping to PluginFuncs
type Request ¶
type Request struct { AppName string AppPath string AppUrl string PagePath string PageUrl string Method string IsDev bool IsPartial bool PushEvents bool HtmxVersion string Headers http.Header RemoteIP string UrlParams map[string]string Form url.Values Query url.Values PostForm url.Values Data any }
Request is a starlark.Value that represents an HTTP request. A Request is created from the Go http.Request and passed to the starlark handler function as it only argument. The Data field is updated with the handler's response and then the template evaluation is done with the same Request
type SSEMessage ¶
type SSEMessage struct {
// contains filtered or unexported fields
}
type TestFile ¶
type TestFile struct {
// contains filtered or unexported fields
}
func CreateTestFile ¶
type TestFileInfo ¶
type TestFileInfo struct {
// contains filtered or unexported fields
}
func (*TestFileInfo) IsDir ¶
func (fi *TestFileInfo) IsDir() bool
func (*TestFileInfo) ModTime ¶
func (fi *TestFileInfo) ModTime() time.Time
func (*TestFileInfo) Mode ¶
func (fi *TestFileInfo) Mode() fs.FileMode
func (*TestFileInfo) Name ¶
func (fi *TestFileInfo) Name() string
func (*TestFileInfo) Size ¶
func (fi *TestFileInfo) Size() int64
func (*TestFileInfo) Sys ¶
func (fi *TestFileInfo) Sys() any
type TestReadFS ¶ added in v0.2.0
type TestReadFS struct {
// contains filtered or unexported fields
}
func (*TestReadFS) Glob ¶ added in v0.2.0
func (f *TestReadFS) Glob(pattern string) ([]string, error)
func (*TestReadFS) ReadFile ¶ added in v0.2.0
func (f *TestReadFS) ReadFile(name string) ([]byte, error)
func (*TestReadFS) Reset ¶ added in v0.3.0
func (f *TestReadFS) Reset()
func (*TestReadFS) Stat ¶ added in v0.2.0
func (f *TestReadFS) Stat(name string) (fs.FileInfo, error)
func (*TestReadFS) StaticFiles ¶ added in v0.3.0
func (d *TestReadFS) StaticFiles() []string
type TestWriteFS ¶ added in v0.2.0
type TestWriteFS struct {
*TestReadFS
}
func (*TestWriteFS) Remove ¶ added in v0.2.0
func (f *TestWriteFS) Remove(name string) error
Click to show internal directories.
Click to hide internal directories.