Documentation
¶
Index ¶
- Constants
- Variables
- func Wdir() string
- type Buffer
- type BufferOut
- type Command
- type Context
- type FileWatcher
- type Files
- type Fly
- type Func
- type Ignore
- type LogWriter
- type Project
- type Recovery
- type Resource
- type Response
- type Schema
- type Settings
- func (s Settings) Create(path string, name string) *os.File
- func (s Settings) Fatal(err error, msg ...interface{})
- func (s *Settings) Flimit() error
- func (s *Settings) Read(out interface{}) error
- func (s *Settings) Remove(d string) error
- func (s Settings) Stream(file string) ([]byte, error)
- func (s *Settings) Write(out interface{}) error
- type Tool
- type Tools
- type Watch
Constants ¶
View Source
const ( Permission = 0775 File = ".fly.yaml" FileOut = ".r.outputs.log" FileErr = ".r.errors.log" FileLog = ".r.logs.log" )
settings const
Variables ¶
View Source
var ( // RPrefix tool name RPrefix = "fly" // RVersion current version RVersion = "1.0.0" // RExt file extension RExt = ".yaml" // RFile config file name RFile = "." + RPrefix + RExt //RExtWin windows extension RExtWin = ".exe" )
View Source
var ( //Output writer Output = color.Output // Red color Red = colorBase(color.FgHiRed) // Blue color Blue = colorBase(color.FgHiBlue) // Green color Green = colorBase(color.FgHiGreen) // Yellow color Yellow = colorBase(color.FgHiYellow) // Magenta color Magenta = colorBase(color.FgHiMagenta) )
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct { StdOut []BufferOut `json:"stdOut"` StdLog []BufferOut `json:"stdLog"` StdErr []BufferOut `json:"stdErr"` }
Buffer define an array buffer for each log files
type BufferOut ¶
type BufferOut struct { Time time.Time `json:"time"` Text string `json:"text"` Path string `json:"path"` Type string `json:"type"` Stream string `json:"stream"` Errors []string `json:"errors"` }
BufferOut is used for exchange information between "fly cli" and "web fly"
type Command ¶
type Command struct { Cmd string `yaml:"command" json:"command"` Type string `yaml:"type" json:"type"` Path string `yaml:"path,omitempty" json:"path,omitempty"` Global bool `yaml:"global,omitempty" json:"global,omitempty"` Output bool `yaml:"output,omitempty" json:"output,omitempty"` }
Command fields
type Context ¶
type Context struct { Path string Project *Project Stop <-chan bool Watcher FileWatcher Event fsnotify.Event }
Context is used as argument for func
type FileWatcher ¶
type FileWatcher interface { Close() error Add(string) error Walk(string, bool) string Remove(string) error Errors() <-chan error Events() <-chan fsnotify.Event }
FileWatcher is an interface for implementing file notification watchers
func EventWatcher ¶
func EventWatcher() (FileWatcher, error)
EventWatcher returns an fs-event based file watcher
func NewFileWatcher ¶
func NewFileWatcher() (FileWatcher, error)
NewFileWatcher tries to use an fs-event watcher, and falls back to the poller if there is an error
func PollingWatcher ¶
func PollingWatcher(interval time.Duration) FileWatcher
PollingWatcher returns a poll-based file watcher
type Files ¶
type Files struct { Clean bool `yaml:"clean,omitempty" json:"clean,omitempty"` Outputs Resource `yaml:"outputs,omitempty" json:"outputs,omitempty"` Logs Resource `yaml:"logs,omitempty" json:"log,omitempty"` Errors Resource `yaml:"errors,omitempty" json:"error,omitempty"` }
Files defines the files generated by fly
type Fly ¶
type Fly struct { Settings Settings `yaml:"settings" json:"settings"` Schema `yaml:",inline" json:",inline"` Sync chan string `yaml:"-" json:"-"` Err Func `yaml:"-" json:"-"` After Func `yaml:"-" json:"-"` Before Func `yaml:"-" json:"-"` Change Func `yaml:"-" json:"-"` Reload Func `yaml:"-" json:"-"` }
Fly main struct
type Project ¶
type Project struct { Name string `yaml:"name" json:"name"` Path string `yaml:"path" json:"path"` Env map[string]string `yaml:"env,omitempty" json:"env,omitempty"` Args []string `yaml:"args,omitempty" json:"args,omitempty"` Tools Tools `yaml:"commands" json:"commands"` Watcher Watch `yaml:"watcher" json:"watcher"` Buffer Buffer `yaml:"-" json:"buffer"` ErrPattern string `yaml:"pattern,omitempty" json:"pattern,omitempty"` // contains filtered or unexported fields }
Project info
type Schema ¶
type Schema struct {
Projects []Project `yaml:"schema" json:"schema"`
}
Schema projects list
type Settings ¶
type Settings struct { Files `yaml:"files,omitempty" json:"files,omitempty"` FileLimit int32 `yaml:"flimit,omitempty" json:"flimit,omitempty"` Recovery Recovery `yaml:"recovery,omitempty" json:"recovery,omitempty"` }
Settings defines a group of general settings and options
type Tool ¶
type Tool struct { Args []string `yaml:"args,omitempty" json:"args,omitempty"` Path string `yaml:"path,omitempty" json:"path,omitempty"` Dir string `yaml:"dir,omitempty" json:"dir,omitempty"` //wdir of the command Status bool `yaml:"status,omitempty" json:"status,omitempty"` Output bool `yaml:"output,omitempty" json:"output,omitempty"` // contains filtered or unexported fields }
Tool info
type Tools ¶
type Tools struct { Clean Tool `yaml:"clean,omitempty" json:"clean,omitempty"` Vet Tool `yaml:"vet,omitempty" json:"vet,omitempty"` Fmt Tool `yaml:"fmt,omitempty" json:"fmt,omitempty"` Test Tool `yaml:"test,omitempty" json:"test,omitempty"` Generate Tool `yaml:"generate,omitempty" json:"generate,omitempty"` Install Tool `yaml:"install,omitempty" json:"install,omitempty"` Build Tool `yaml:"build,omitempty" json:"build,omitempty"` Run Tool `yaml:"run,omitempty" json:"run,omitempty"` }
Tools go
type Watch ¶
type Watch struct { Exts []string `yaml:"extensions" json:"extensions"` Paths []string `yaml:"paths" json:"paths"` Scripts []Command `yaml:"scripts,omitempty" json:"scripts,omitempty"` Hidden bool `yaml:"hidden,omitempty" json:"hidden,omitempty"` Ignore []string `yaml:"ignored_paths,omitempty" json:"ignored_paths,omitempty"` }
Watch info
Click to show internal directories.
Click to hide internal directories.