Documentation ¶
Index ¶
- func IsThemeName(s string) bool
- func NewMultiManager(templateDir string, managers ...driver.Manager) driver.Manager
- func NewStaticDir(dir string, trimPrefix ...string) http.FileSystem
- func RGB2Hex(rgb string) string
- func Register(group string, t *Template)
- func Unregister(group string)
- type FileInfo
- type FileSystems
- func (f FileSystems) IsEmpty() bool
- func (f FileSystems) Open(name string) (file http.File, err error)
- func (f FileSystems) ReadDir(name string) (dirs []fs.FileInfo, err error)
- func (f FileSystems) ReadFile(name string) (content []byte, err error)
- func (f *FileSystems) Register(fileSystem http.FileSystem)
- func (f FileSystems) Size() int
- func (f FileSystems) Stat(name string) (fi fs.FileInfo, err error)
- type MultiManager
- func (b *MultiManager) AddAllow(allows ...string)
- func (b *MultiManager) AddCallback(rootDir string, callback func(name, typ, event string))
- func (b *MultiManager) AddIgnore(ignores ...string)
- func (b *MultiManager) AddWatchDir(ppath string) (err error)
- func (b *MultiManager) CancelWatchDir(oldDir string) (err error)
- func (b *MultiManager) ChangeWatchDir(oldDir string, newDir string) (err error)
- func (b *MultiManager) ClearAllows()
- func (b *MultiManager) ClearCache()
- func (b *MultiManager) ClearCallback()
- func (b *MultiManager) ClearIgnores()
- func (b *MultiManager) Close()
- func (b *MultiManager) DelAllow(allow string)
- func (b *MultiManager) DelCallback(rootDir string)
- func (b *MultiManager) DelIgnore(ignore string)
- func (b *MultiManager) GetManagers() []driver.Manager
- func (b *MultiManager) GetTemplate(filename string) (content []byte, err error)
- func (b *MultiManager) HasBindata() bool
- func (b *MultiManager) SetLogger(logger logger.Logger)
- func (b *MultiManager) SetTemplate(filename string, content []byte) error
- func (b *MultiManager) Start() error
- func (b *MultiManager) TemplateDir() string
- type PathFixer
- type PathFixers
- func (p *PathFixers) Add(dirName string, fixer PathFixer) *PathFixers
- func (p *PathFixers) AddDir(dirName string, parentPath string) *PathFixers
- func (p *PathFixers) Delete(names ...string) *PathFixers
- func (p *PathFixers) Fix(ctx echo.Context, t *Template, theme string, tmpl string) (string, bool)
- func (p *PathFixers) Keys() []string
- func (p *PathFixers) MakeFixer(parentPath string) PathFixer
- type PathHandle
- type SortFileInfoByFileType
- type StaticDir
- type Storer
- type Template
- func (t *Template) ClearCache()
- func (t *Template) Fix(ctx echo.Context, theme string, tmpl string) (string, bool)
- func (t *Template) Handle(ctx echo.Context, theme string, tmpl string) string
- func (t *Template) SetHandler(h PathHandle) *Template
- func (t *Template) SetPathFixers(h *PathFixers) *Template
- func (t *Template) SetStorer(storer Storer) *Template
- func (t *Template) SetThemeInfo(c echo.Context, v *ThemeInfo)
- func (t *Template) SetTmplDir(tmplDir string) *Template
- func (t *Template) Storer() Storer
- func (t *Template) ThemeInfo(c echo.Context) *ThemeInfo
- type ThemeAuthor
- type ThemeColor
- type ThemeColors
- type ThemeInfo
- func (t *ThemeInfo) AsLite() ThemeInfoLite
- func (t *ThemeInfo) ColorName() string
- func (t *ThemeInfo) Decode(b []byte) error
- func (t *ThemeInfo) DecodeFile(file string) error
- func (t *ThemeInfo) Embed() bool
- func (t *ThemeInfo) Encode() []byte
- func (t *ThemeInfo) EncodeToFile(destFile string) error
- func (t *ThemeInfo) HasColorName(colorName string, notDefault ...bool) bool
- func (t *ThemeInfo) HasForm(templateName string) bool
- func (t *ThemeInfo) IsColorName(colorName string) bool
- func (t *ThemeInfo) Render(templateName string) template.HTML
- func (t *ThemeInfo) SaveForm(ctx echo.Context, templateName string, ...) error
- func (t *ThemeInfo) SetEmbed() *ThemeInfo
- type ThemeInfoLite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsThemeName ¶
func NewMultiManager ¶
func NewStaticDir ¶
func NewStaticDir(dir string, trimPrefix ...string) http.FileSystem
func Unregister ¶
func Unregister(group string)
Types ¶
type FileSystems ¶
type FileSystems []http.FileSystem
func NewFileSystems ¶
func NewFileSystems() FileSystems
func (FileSystems) IsEmpty ¶
func (f FileSystems) IsEmpty() bool
func (FileSystems) ReadDir ¶
func (f FileSystems) ReadDir(name string) (dirs []fs.FileInfo, err error)
func (FileSystems) ReadFile ¶
func (f FileSystems) ReadFile(name string) (content []byte, err error)
func (*FileSystems) Register ¶
func (f *FileSystems) Register(fileSystem http.FileSystem)
func (FileSystems) Size ¶
func (f FileSystems) Size() int
type MultiManager ¶
type MultiManager struct {
// contains filtered or unexported fields
}
func (*MultiManager) AddAllow ¶
func (b *MultiManager) AddAllow(allows ...string)
func (*MultiManager) AddCallback ¶
func (b *MultiManager) AddCallback(rootDir string, callback func(name, typ, event string))
func (*MultiManager) AddIgnore ¶
func (b *MultiManager) AddIgnore(ignores ...string)
func (*MultiManager) AddWatchDir ¶
func (b *MultiManager) AddWatchDir(ppath string) (err error)
func (*MultiManager) CancelWatchDir ¶
func (b *MultiManager) CancelWatchDir(oldDir string) (err error)
func (*MultiManager) ChangeWatchDir ¶
func (b *MultiManager) ChangeWatchDir(oldDir string, newDir string) (err error)
func (*MultiManager) ClearAllows ¶
func (b *MultiManager) ClearAllows()
func (*MultiManager) ClearCache ¶
func (b *MultiManager) ClearCache()
func (*MultiManager) ClearCallback ¶
func (b *MultiManager) ClearCallback()
func (*MultiManager) ClearIgnores ¶
func (b *MultiManager) ClearIgnores()
func (*MultiManager) Close ¶
func (b *MultiManager) Close()
func (*MultiManager) DelAllow ¶
func (b *MultiManager) DelAllow(allow string)
func (*MultiManager) DelCallback ¶
func (b *MultiManager) DelCallback(rootDir string)
func (*MultiManager) DelIgnore ¶
func (b *MultiManager) DelIgnore(ignore string)
func (*MultiManager) GetManagers ¶
func (b *MultiManager) GetManagers() []driver.Manager
func (*MultiManager) GetTemplate ¶
func (b *MultiManager) GetTemplate(filename string) (content []byte, err error)
func (*MultiManager) HasBindata ¶
func (b *MultiManager) HasBindata() bool
func (*MultiManager) SetLogger ¶
func (b *MultiManager) SetLogger(logger logger.Logger)
func (*MultiManager) SetTemplate ¶
func (b *MultiManager) SetTemplate(filename string, content []byte) error
func (*MultiManager) Start ¶
func (b *MultiManager) Start() error
func (*MultiManager) TemplateDir ¶
func (b *MultiManager) TemplateDir() string
type PathFixers ¶
func (*PathFixers) Add ¶
func (p *PathFixers) Add(dirName string, fixer PathFixer) *PathFixers
func (*PathFixers) AddDir ¶
func (p *PathFixers) AddDir(dirName string, parentPath string) *PathFixers
func (*PathFixers) Delete ¶
func (p *PathFixers) Delete(names ...string) *PathFixers
func (*PathFixers) Keys ¶
func (p *PathFixers) Keys() []string
func (*PathFixers) MakeFixer ¶
func (p *PathFixers) MakeFixer(parentPath string) PathFixer
type SortFileInfoByFileType ¶
type SortFileInfoByFileType []FileInfo
func (SortFileInfoByFileType) Len ¶
func (s SortFileInfoByFileType) Len() int
func (SortFileInfoByFileType) Less ¶
func (s SortFileInfoByFileType) Less(i, j int) bool
func (SortFileInfoByFileType) Swap ¶
func (s SortFileInfoByFileType) Swap(i, j int)
type Storer ¶
type Storer interface { Put(echo.Context, string, *ThemeInfo) error Get(echo.Context, string) (*ThemeInfo, error) }
func NewFileStore ¶
type Template ¶
type Template struct { TmplDir string Kind string *PathFixers // contains filtered or unexported fields }
func (*Template) ClearCache ¶
func (t *Template) ClearCache()
func (*Template) SetHandler ¶
func (t *Template) SetHandler(h PathHandle) *Template
func (*Template) SetPathFixers ¶
func (t *Template) SetPathFixers(h *PathFixers) *Template
func (*Template) SetTmplDir ¶
type ThemeAuthor ¶
type ThemeColor ¶
type ThemeColor struct { Name string `json:"name,omitempty"` // 颜色英文名(用于调用相应颜色的css文件) Title string `json:"title,omitempty"` // 颜色中文标题 IsDefault bool `json:"isDefault,omitempty"` // 是否为默认颜色 Color string `json:"color,omitempty"` // 颜色值 PreviewImage string `json:"previewImage,omitempty"` // 预览图 }
func (ThemeColor) HexColor ¶
func (t ThemeColor) HexColor() string
type ThemeColors ¶
type ThemeColors []ThemeColor
type ThemeInfo ¶
type ThemeInfo struct { Author ThemeAuthor `json:"author,omitempty"` // 模板作者 Colors ThemeColors `json:"colors,omitempty"` // 多种颜色主题时,所有支持的颜色信息 Version string `json:"version,omitempty"` // 版本号(格式: 1.0.0) Name string `json:"name"` // 主题英文名 Title string `json:"title"` // 主题中文标题 UpdatedAt string `json:"updatedAt,omitempty"` // 更新时间(格式: 2006-01-02 15:04:05) Description string `json:"description,omitempty"` // 简介 PreviewImage string `json:"previewImage,omitempty"` // 预览图 PreviewURL string `json:"previewURL,omitempty"` // 预览网址 CustomConfig echo.H `json:"customConfig,omitempty"` // 可自定义配置的数据 FormConfig map[string]formConfig.Config `json:"formConfig,omitempty"` // 表单配置 Fallback []string `json:"fallback,omitempty"` // 兜底主题 // contains filtered or unexported fields }
ThemeInfo 模板主题信息
func GetThemeInfoFromContext ¶
func NewThemeInfo ¶
func NewThemeInfo() *ThemeInfo
func (*ThemeInfo) AsLite ¶
func (t *ThemeInfo) AsLite() ThemeInfoLite
func (*ThemeInfo) DecodeFile ¶
func (*ThemeInfo) EncodeToFile ¶
func (*ThemeInfo) HasColorName ¶
func (*ThemeInfo) IsColorName ¶
type ThemeInfoLite ¶
Click to show internal directories.
Click to hide internal directories.