Documentation ¶
Index ¶
Constants ¶
View Source
const FilenameExtension = ".dvar.go"
FilenameExtension is an extension of the generated files.
Variables ¶
View Source
var DefConf = Conf{
Path: "./",
Perm: 0755,
}
DefConf is the default configuration for DVarGen.
View Source
var ErrSubdir = errors.New("directory should not contain sub directories")
ErrSubdir happens when directory contains sub directories.
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct { Path string // Path of the generated file. Perm fs.FileMode // Perm of the generated file. }
Conf configures the generation process.
type DVarDesc ¶
type DVarDesc struct { Dir string // Generates var from content of this directory. Varname string // Name of the generated var, also name of the generated // file. Package string // Package of the generated file. }
DVarDesc is te description of the generated var.
type DVarGen ¶ added in v0.1.1
type DVarGen struct {
// contains filtered or unexported fields
}
DVarGen generates a map variable initialized with the contents of the directory.
func NewWith ¶ added in v0.1.1
func NewWith(persistor persistor_mod.Persistor) DVarGen
New creates a new configurable DVarGen.
Click to show internal directories.
Click to hide internal directories.