Documentation ¶
Index ¶
- Constants
- Variables
- func CloseWithErrLog(l Logger, c Closer)
- func Initialize(l Logger, dir string, tmplDir string, files []string) error
- type Closer
- type Creator
- type Day
- type DayElem
- type FileMap
- type Formatter
- func (f *Formatter) FormatDir(fMap FileMap, to string, move bool) *Formatter
- func (f Formatter) Map2Elem(fMap FileMap, optionFuncs ...Map2ElemOptionFunc) (elem TopElem)
- func (f Formatter) ParseFileMap(root string) FileMap
- func (f *Formatter) WriteDirTree(elem TopElem, filePath, templatePath, to string) *Formatter
- type Logger
- type Map2ElemOptionFunc
- type Month
- type MonthElem
- type SortType
- type TopElem
- type Year
- type YearElem
Constants ¶
View Source
const ErrLogOut = "log output: %v\n"
Variables ¶
View Source
var ErrNotParamater = errors.New("insufficient parameters")
Functions ¶
func CloseWithErrLog ¶
Types ¶
type Creator ¶
type Creator struct { Err error // contains filtered or unexported fields }
Creator generate file.
func (*Creator) SetNowFunc ¶
SetNowFunc sets the function that returns the current time.
type Formatter ¶
type Formatter struct { Err error // contains filtered or unexported fields }
Formatter is generator diary.
func (Formatter) Map2Elem ¶
func (f Formatter) Map2Elem(fMap FileMap, optionFuncs ...Map2ElemOptionFunc) (elem TopElem)
Map2Elem convert FileMap to TopElem.
func (Formatter) ParseFileMap ¶
ParseFileMap analys dir and parse FileMap.
Hidden files and directories are ignored.
type Logger ¶
type Logger interface { Debug(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) }
type Map2ElemOptionFunc ¶ added in v1.1.0
type Map2ElemOptionFunc func(*map2ElemOption)
func DaySort ¶ added in v1.1.0
func DaySort(s SortType) Map2ElemOptionFunc
DaySort specify day sort.
func MonthSort ¶ added in v1.1.0
func MonthSort(s SortType) Map2ElemOptionFunc
MonthSort specify month sort.
func YearSort ¶ added in v1.1.0
func YearSort(s SortType) Map2ElemOptionFunc
YearSort specify year sort.
Click to show internal directories.
Click to hide internal directories.