Documentation
¶
Overview ¶
This file adds a simple wrapper around some os's methods so that they can be stubbed easily in a testing scenario. LocalFileSystem is the concrete implementation MemFileSystem is the one used in tests
Index ¶
- Constants
- func CreateGokeConfig() error
- func CurrentConfigFile() string
- func FileExists(filename string) bool
- func GOBDeserialize[T any](structStr string, structShell *T) T
- func GOBSerialize[T any](structInstance T) string
- func GokeFiles() []string
- func JoinInnerArgs(args []string) string
- func ReadYamlConfig() (string, error)
- type Executor
- type FileSystem
- type Global
- type LocalFileSystem
- func (fs *LocalFileSystem) FileExists(filename string) bool
- func (fs *LocalFileSystem) Getwd() (dir string, err error)
- func (fs *LocalFileSystem) Glob(path string) ([]string, error)
- func (fs *LocalFileSystem) ReadFile(name string) ([]byte, error)
- func (fs *LocalFileSystem) Remove(name string) error
- func (fs *LocalFileSystem) Stat(name string) (fs.FileInfo, error)
- func (fs *LocalFileSystem) TempDir() string
- func (fs *LocalFileSystem) WriteFile(name string, data []byte, perm fs.FileMode) error
- type Lockfile
- type OptionHandler
- type Options
- type Parseable
- type Process
- type Ref
- type ShellProcess
- type Task
Constants ¶
View Source
const CURRENT_VERSION = "0.2.6"
View Source
const DefaultTask = "main"
This represent the default task, so when the user doesn't provide any args to the program, we default to this.
Variables ¶
This section is empty.
Functions ¶
func CreateGokeConfig ¶
func CreateGokeConfig() error
func CurrentConfigFile ¶
func CurrentConfigFile() string
func FileExists ¶
func GOBDeserialize ¶
Deserialize a struct
func JoinInnerArgs ¶
func ReadYamlConfig ¶
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶
func NewExecutor(p *Parseable, l *Lockfile, opts *Options, proc Process, fs FileSystem, ctx *context.Context) Executor
Executor constructor.
type FileSystem ¶
type FileSystem interface { ReadFile(name string) ([]byte, error) WriteFile(name string, data []byte, perm fs.FileMode) error Getwd() (dir string, err error) Stat(name string) (fs.FileInfo, error) FileExists(filename string) bool Remove(name string) error TempDir() string Glob(path string) ([]string, error) }
type Global ¶
type Global struct { string]string `yaml:"environment,omitempty"` Events struct { BeforeEachRun []string `yaml:"before_each_run,omitempty"` AfterEachRun []string `yaml:"after_each_run,omitempty"` BeforeEachTask []string `yaml:"before_each_task,omitempty"` AfterEachTask []string `yaml:"after_each_task,omitempty"` } `yaml:"events,omitempty"` } `yaml:"global,omitempty"` }Env map[
type LocalFileSystem ¶
type LocalFileSystem struct{}
func (*LocalFileSystem) FileExists ¶
func (fs *LocalFileSystem) FileExists(filename string) bool
func (*LocalFileSystem) Getwd ¶
func (fs *LocalFileSystem) Getwd() (dir string, err error)
func (*LocalFileSystem) Remove ¶
func (fs *LocalFileSystem) Remove(name string) error
func (*LocalFileSystem) TempDir ¶
func (fs *LocalFileSystem) TempDir() string
type Lockfile ¶
type Lockfile struct { JSON lockFileJson // contains filtered or unexported fields }
func NewLockfile ¶
func NewLockfile(files []string, opts *Options, fs FileSystem) Lockfile
func (*Lockfile) Bootstrap ¶
func (l *Lockfile) Bootstrap()
Loads existing lock information generates it for the first time.
func (*Lockfile) GetCurrentProject ¶
func (l *Lockfile) GetCurrentProject() singleProjectJson
Returns the lock information for the current project.
func (*Lockfile) UpdateTimestampsForFiles ¶
Update timestamps for files in current project.
type OptionHandler ¶
type Options ¶
type Options struct { TaskName string `docopt:"<task>"` Watch bool `docopt:"-w,--watch"` NoCache bool `docopt:"-c,--no-cache"` Force bool `docopt:"-f,--force"` Quiet bool `docopt:"-q,--quiet"` Args []string `docopt:"-a,--args"` Init bool `docopt:"-i,--init"` Tasks bool `docopt:"-t,--tasks"` }
func NewCliOptions ¶
func NewCliOptions() Options
func (Options) Handlers ¶
func (opts Options) Handlers(p *Parseable) []OptionHandler
Handlers groups the handlers into a slice so that we can run them all at once when used.
type Parseable ¶
type ShellProcess ¶
type ShellProcess struct{}
func (*ShellProcess) Execute ¶
func (sp *ShellProcess) Execute(name string, args ...string) ([]byte, error)
func (*ShellProcess) Exit ¶
func (sp *ShellProcess) Exit(code int)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.