Documentation ¶
Index ¶
- Variables
- func TmplFileType(name string) string
- type DummyGetter
- type DummySetter
- type DumpWrite
- type Getter
- type HttpWrite
- type HttpWriter
- type MdView
- func (mdv *MdView) Dump(out, eout io.Writer, req_path string)
- func (mdv *MdView) Handler(w http.ResponseWriter, r *http.Request)
- func (mdv *MdView) ListenAndServe(cc task.Canceller) error
- func (mdv *MdView) MakeEtag(t time.Time) string
- func (mdv *MdView) Serve(cc task.Canceller, lstn net.Listener) error
- func (mdv *MdView) SumTemplate() ([]byte, error)
- func (mdv *MdView) TmplSvgIcon(name string) string
- type MdViewConfig
- type Setter
- type TmplOnce
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupportedSocketType = errors.New("unsupported socket type.")
Functions ¶
func TmplFileType ¶
Types ¶
type DummyGetter ¶
type DummyGetter struct{}
func (DummyGetter) Get ¶
func (DummyGetter) Get(string) string
type DummySetter ¶
type DummySetter struct{}
func (DummySetter) Set ¶
func (DummySetter) Set(string, string)
type DumpWrite ¶
type DumpWrite struct {
// contains filtered or unexported fields
}
func (*DumpWrite) WriteHeader ¶
type HttpWrite ¶
type HttpWrite struct {
// contains filtered or unexported fields
}
func NewHttpWriter ¶
func NewHttpWriter(w http.ResponseWriter, r *http.Request) *HttpWrite
func (*HttpWrite) WriteHeader ¶
type HttpWriter ¶
type MdView ¶
type MdView struct { SystemFS fs.FS SocketType string SocketPath string CacheControl string UrlTopPath string UrlLibPath string DocumentRoot upath.UPath IndexName string OriginTmpl *template.Template HtmlTmpl *template.Template MainTmplName string SvgIconPath upath.UPath Md2Html *md2html.Md2Html MimeExtTable *mtable.MimeExtTable MarkdownExt []string MarkdownConfig *md2html.MdConfig ThemeStyle string DirectoryViewMode string DirectoryViewRoots []upath.UPath DirectoryViewHidden []*regexp.Regexp DirectoryViewPathHidden []*regexp.Regexp TimeStampFormat string DirViewStamp *dirview.DirViewStamp TextViewMode string ConfigModTime time.Time TemplateTag []byte }
func NewMdView ¶
func NewMdView(cfg *MdViewConfig) (*MdView, error)
func (*MdView) SumTemplate ¶
func (*MdView) TmplSvgIcon ¶
type MdViewConfig ¶
type MdViewConfig struct { SocketType string SocketPath string CacheControl string `toml:",omitempty"` UrlTopPath string `toml:",omitempty"` UrlLibPath string `toml:",omitempty"` DocumentRoot upath.UPath IndexName string `toml:",omitempty"` TmplPaths []upath.UPath IconPath upath.UPath `toml:",omitempty"` MainTmpl string `toml:",omitempty"` MimeExtTable upath.Import[*mtable.MimeExtTable] `toml:",omitempty"` MarkdownExt []string `toml:",omitempty"` MarkdownConfig upath.Import[*md2html.MdConfig] `toml:",omitempty"` ThemeStyle string `toml:",omitempty"` DirectoryViewMode string DirectoryViewRoots []upath.UPath `toml:",omitempty"` DirectoryViewHidden []string `toml:",omitempty"` DirectoryViewPathHidden []string `toml:",omitempty"` TimeStampFormat string `toml:",omitempty"` TextViewMode string `toml:",omitempty"` SystemFS fs.FS `toml:"-"` ModTime time.Time `toml:"-"` }
func NewMdViewConfig ¶
func NewMdViewConfig(file string) (*MdViewConfig, error)
func NewMdViewConfigFS ¶
func NewMdViewConfigFS(fsys fs.FS, file string) (*MdViewConfig, error)
Click to show internal directories.
Click to hide internal directories.