Documentation
¶
Index ¶
- func BytesToBytes(del []byte, src ...[]byte) []byte
- func FilesToBytes(del string, src ...string) ([]byte, error)
- func FilesToFile(filename string, perm os.FileMode, del string, src ...string) error
- func StringsToString(del string, src ...string) string
- type Config
- type Manager
- type Sources
- func (s *Sources) Add(src string) error
- func (s *Sources) AddSources(src ...string) error
- func (s *Sources) ExistSource(src string) bool
- func (s Sources) Get(i int) (string, error)
- func (s *Sources) GetAllDirs() ([]string, error)
- func (s *Sources) GetAllFilepaths() ([]string, error)
- func (s Sources) GetFilepaths(i int) ([]string, error)
- func (s *Sources) Total() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToBytes ¶
BytesToBytes concatenate a list of bytes by the given delimiter
func FilesToBytes ¶
FilesToBytes concatenate a list of files by the given delimiter. you can set a matching pattern to select the sources you want to process.
func FilesToFile ¶
FilesToFile concatenate a list of files by the given delimiter
func StringsToString ¶
StringsToString concatenate a list of strings by the given delimiter
Types ¶
type Config ¶
Config store a map of sources to concatenate.
func (Config) ExistSource ¶
ExistSource return true i the given source was found at the sets
func (Config) TotalFiles ¶
TotalFiles return the number of files
func (Config) TotalFilesInSet ¶
TotalFilesInSet return the number of files of a sepcific set
type Manager ¶
type Manager struct {
Config Config
}
Manager create a manager to organize the source files and process the data.
func (*Manager) GetDirsOfSources ¶
GetDirsOfSources return a list of all source directories
func (*Manager) ProcessAll ¶
ProcessAll run the Process func at all sets
func (*Manager) ReadConfig ¶
ReadConfig reads a json configuration file and set the data to the Config variable
type Sources ¶
type Sources []string
Sources store a list of source paths
func (*Sources) Add ¶
Add a filepath to the Sources array. if src is an empty string or already exist, return an error.
func (*Sources) AddSources ¶
AddSources add a list of sources to the array
func (*Sources) ExistSource ¶
ExistSource return true i the given source was found at the sets
func (*Sources) GetAllDirs ¶
GetAllDirs get dir and get all dirs
func (*Sources) GetAllFilepaths ¶
GetAllFilepaths return a list of all filepaths
func (Sources) GetFilepaths ¶
GetFilepaths return a list of filepaths for the given source. if the source is a glob, the function return all matched paths.