Documentation
¶
Index ¶
- Variables
- func Process(config Config)
- func RegisterFileMapper(name string, fileMapper FileMapper)
- func Run(fileMappers map[string]FileMapper)
- func SetFileMappers(newFileMappers map[string]FileMapper)
- func Watch(config Config)
- type Config
- type DelegatingFileMapper
- type DirArgs
- type ExternalFileMapper
- type FileMapper
- type Globals
- type MtimeFileMapper
- type ProcessCmd
- type WatchCmd
- type WatchConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var PassThroughFileMapper = &DelegatingFileMapper{ GetFileDestPathFunc: func(relSrcFile string, absSrcFile string, baseSrcFile string, mappedRootSrcPath string, mappedRootDestPath string) (string, error) { return relSrcFile, nil }, }
Functions ¶
func RegisterFileMapper ¶
func RegisterFileMapper(name string, fileMapper FileMapper)
func Run ¶
func Run(fileMappers map[string]FileMapper)
func SetFileMappers ¶
func SetFileMappers(newFileMappers map[string]FileMapper)
Types ¶
type Config ¶
type Config struct {
Globals `yaml:",inline"`
RootPathMappings map[string]string
FileMapper FileMapper `yaml:"-"`
Watch WatchConfig
}
func (*Config) ApplyCliConfig ¶
func (*Config) UnmarshalConfigFile ¶
type DelegatingFileMapper ¶
type DelegatingFileMapper struct {
GetFileDestPathFunc func(relSrcFile string, absSrcFile string, baseSrcFile string,
mappedRootSrcPath string, mappedRootDestPath string) (string, error)
}
func NewFileMapper ¶
func (*DelegatingFileMapper) GetFileDestPath ¶
type ExternalFileMapper ¶
type ExternalFileMapper struct {
Executable string
}
func NewExternalFileMapper ¶
func NewExternalFileMapper(executable string) *ExternalFileMapper
func (*ExternalFileMapper) GetFileDestPath ¶
type FileMapper ¶
type FileMapper interface {
GetFileDestPath(relSrcFile string, absSrcFile string, baseSrcFile string,
mappedRootSrcPath string, mappedRootDestPath string) (string, error)
}
func GetFileMapper ¶
func GetFileMapper(fileMapperRef string, debug bool) (FileMapper, error)
type Globals ¶
type Globals struct {
ConfigPath string `help:"Path to configuration yaml file." name:"config" type:"existingfile" yaml:"-"`
Debug bool `help:"Enable debug mode."`
DryRun bool `help:"Show actions that would be performed without doing anything."`
Copy bool `help:"Copy files to destination instead of using hard links."`
FileMapperRef string `help:"FileMapper type or external executable to map files from src to dest." name:"mapper" yaml:"mapper"`
SrcDir string `yaml:"src" kong:"-"`
DestDir string `yaml:"dest" kong:"-"`
}
type MtimeFileMapper ¶
type MtimeFileMapper struct {
DatePathFormat string
}
func NewMtimeFileMapper ¶
func NewMtimeFileMapper(datePathFormat string) *MtimeFileMapper
func (*MtimeFileMapper) GetFileDestPath ¶
type ProcessCmd ¶
type ProcessCmd struct {
DirArgs
}
func (*ProcessCmd) Run ¶
func (c *ProcessCmd) Run(globals *Globals) error
type WatchCmd ¶
type WatchCmd struct {
WatchConfig
DirArgs
}
type WatchConfig ¶
type WatchConfig struct {
EventBufferSize int `help:"Size of file event buffer (if buffer is full events are dropped). Default 1000."`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.