Documentation ¶
Index ¶
- Constants
- type ArgDecoder
- type ArgDecoders
- type BuildConfig
- type Command
- type Config
- type DockerCommand
- type Environ
- type Executor
- type Extensions
- type Fresher
- type GlobalExclude
- type Host
- type Log
- type Option
- type OptionFunc
- type WatcherConfig
- func (r *WatcherConfig) IsExclude(path string) (bool, error)
- func (r *WatcherConfig) IsInclude(path string) (bool, error)
- func (r *WatcherConfig) ShouldWatchFile(path string, opt *Option) (bool, error)
- func (r *WatcherConfig) SkipDir(dirName string, opt *Option) (bool, error)
- func (r *WatcherConfig) UnmarshalYAML(b []byte) error
- func (r *WatcherConfig) Walk(watcher *fsnotify.Watcher, opt *Option) (*WatcherPath, error)
- func (r *WatcherConfig) WalkWithDirName(watcher *fsnotify.Watcher, opt *Option, dirName string) (*WatcherPath, error)
- type WatcherPath
Constants ¶
View Source
const ( HostTypeLocal = iota HostTypeDocker )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgDecoder ¶ added in v0.0.3
type ArgDecoder struct {
// contains filtered or unexported fields
}
func (*ArgDecoder) UnmarshalYAML ¶ added in v0.0.3
func (a *ArgDecoder) UnmarshalYAML(b []byte) error
type ArgDecoders ¶ added in v0.0.3
type ArgDecoders []*ArgDecoder
func (ArgDecoders) Argument ¶ added in v0.0.3
func (a ArgDecoders) Argument() []string
type BuildConfig ¶
type BuildConfig struct { Target string `yaml:"target"` Host *Host `yaml:"host"` Output string `yaml:"output"` Environ Environ `yaml:"env"` Arg []string `yaml:"arg"` WithoutRun bool `yaml:"without_run"` BeforeCommands []*Command `yaml:"before"` AfterCommands []*Command `yaml:"after"` }
func (*BuildConfig) BuildCommand ¶
func (bc *BuildConfig) BuildCommand() Executor
func (*BuildConfig) Commands ¶
func (bc *BuildConfig) Commands() []Executor
func (*BuildConfig) RunCommand ¶
func (bc *BuildConfig) RunCommand() Executor
func (*BuildConfig) UnmarshalYAML ¶
func (bc *BuildConfig) UnmarshalYAML(b []byte) error
type Command ¶
type Command struct { Name string Arg []string Environ []string IsAsync bool // contains filtered or unexported fields }
func (*Command) UnmarshalYAML ¶
type Config ¶
type Config struct { Build *BuildConfig `yaml:"build"` Paths []*WatcherConfig `yaml:"path"` ExcludePath *GlobalExclude `yaml:"exclude"` Extensions Extensions `yaml:"extension"` Interval time.Duration `yaml:"interval"` }
func LoadConfig ¶
func (*Config) Options ¶
func (c *Config) Options() []OptionFunc
type DockerCommand ¶
type DockerCommand struct { *Command // contains filtered or unexported fields }
func (*DockerCommand) Exec ¶
func (c *DockerCommand) Exec() error
func (*DockerCommand) ExecContext ¶
func (c *DockerCommand) ExecContext(ctx context.Context) error
func (*DockerCommand) Kill ¶
func (c *DockerCommand) Kill() error
type Extensions ¶
type Extensions []string
func (Extensions) IsIncludeSameExt ¶
func (e Extensions) IsIncludeSameExt(fileName string) bool
type Fresher ¶
type Fresher struct {
// contains filtered or unexported fields
}
func New ¶
func New(fns ...OptionFunc) *Fresher
type GlobalExclude ¶
type GlobalExclude []string
type Host ¶
type Host struct { Type hostType LocationName string }
func (*Host) RunCommand ¶
func (*Host) UnmarshalYAML ¶
type OptionFunc ¶
type OptionFunc func(f *Fresher)
func ExecTarget ¶
func ExecTarget(bc *BuildConfig) OptionFunc
func ExtensionPaths ¶
func ExtensionPaths(exts Extensions) OptionFunc
func GlobalExcludePath ¶
func GlobalExcludePath(global *GlobalExclude) OptionFunc
func WatchConfigs ¶
func WatchConfigs(configs []*WatcherConfig) OptionFunc
func WatchInterval ¶
func WatchInterval(interval time.Duration) OptionFunc
type WatcherConfig ¶
type WatcherConfig struct { Name string `yaml:"name"` Excludes []string `yaml:"exclude"` Includes []string `yaml:"include"` }
func (*WatcherConfig) ShouldWatchFile ¶
func (r *WatcherConfig) ShouldWatchFile(path string, opt *Option) (bool, error)
func (*WatcherConfig) SkipDir ¶
func (r *WatcherConfig) SkipDir(dirName string, opt *Option) (bool, error)
func (*WatcherConfig) UnmarshalYAML ¶
func (r *WatcherConfig) UnmarshalYAML(b []byte) error
func (*WatcherConfig) Walk ¶
func (r *WatcherConfig) Walk(watcher *fsnotify.Watcher, opt *Option) (*WatcherPath, error)
func (*WatcherConfig) WalkWithDirName ¶
func (r *WatcherConfig) WalkWithDirName(watcher *fsnotify.Watcher, opt *Option, dirName string) (*WatcherPath, error)
type WatcherPath ¶
type WatcherPath struct {
// contains filtered or unexported fields
}
func NewWatcherPath ¶
func NewWatcherPath(wcs []*WatcherConfig, option *Option) *WatcherPath
func (*WatcherPath) AddIfNeeds ¶
func (w *WatcherPath) AddIfNeeds(path string, watcher *fsnotify.Watcher) error
func (*WatcherPath) Merge ¶
func (w *WatcherPath) Merge(wp *WatcherPath)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.