Documentation ¶
Index ¶
- Constants
- Variables
- func IsLocked(path string) error
- func LoadYaml[T any](path string) (*T, error)
- func LoadYamlFS[T any](fileSys fs.FS, path string) (*T, error)
- func LockProject(path string) error
- func ReadYaml[T any](r io.Reader) (*T, error)
- func UnlockProject(path string) (err error)
- func WriteYaml(data interface{}, path string) error
- type ErrorStr
- type Project
- func (p *Project) Command(name string, context map[string]any) (*ProjectCommand, error)
- func (p *Project) ExecCommand(commandName string, env map[string]any) error
- func (p *Project) IsExcluded(fl quickfs.FileLike) bool
- func (p *Project) Load(projectDirectory string) error
- func (p *Project) Validate() error
- type ProjectCommand
- type ProjectCommandMap
- type QuickGo
- type Validator
Constants ¶
View Source
const ( QUICKGO_DIR = ".quickgo" // The directory for QuickGo files, resides in the executable directory. QUICKGO_LOG_NAME = "quickgo.log" // The log file name. QUICKGO_CONFIG_NAME = "quickgo.yaml" // Config file for QuickGo, resides in the executable directory. PROJECT_CONFIG_NAME = "quickgo.yaml" // Config file for the project, resides in the project (working) directory. PROJECT_ZIP_NAME = "project.zip" // The name of the project zip file. PROJECTS_DIR = "projects" // The directory for project files, resides in the executable directory. COMMANDS_DIR = "commands" // The directory for command javscript files, resides in the executable directory. LOCKFILE_NAME = "quickgo.lock" // The lock file name. // Error messages. ErrCommandMissing = ErrorStr("command not found") ErrProjectMissing = ErrorStr("project config not found") ErrProjectExists = ErrorStr("project config already exists") ErrProjectInvalid = ErrorStr("project config is invalid") )
Variables ¶
View Source
var ( ErrProjectName = errors.Wrap( ErrProjectInvalid, "project name cannot be a blank string, period or filepath", ) )
Functions ¶
func UnlockProject ¶ added in v2.4.2
Unlock unlocks the project.
Types ¶
type Project ¶
type Project struct { // The name of the project. Name string `yaml:"name" json:"name"` // Optional context for project templates. Context map[string]any `yaml:"context" json:"context"` // List of commands to run BeforeCopy *command.StepList `yaml:"beforeCopy" json:"beforeCopy"` AfterCopy *command.StepList `yaml:"afterCopy" json:"afterCopy"` Commands ProjectCommandMap `yaml:"commands" json:"commands"` // [name] => [steps] // Variable delimiters for the project templates. DelimLeft string `yaml:"delimLeft" json:"delimLeft"` DelimRight string `yaml:"delimRight" json:"delimRight"` // A list of files to exclude from the project in glob format. Exclude []string `yaml:"exclude" json:"exclude"` // (NYI) // The root directory. Root *quickfs.FSDirectory `yaml:"-"` }
Project represents the configuration for an individual project.
func ExampleProjectConfig ¶
func ExampleProjectConfig() *Project
ExampleProjectConfig returns an example project configuration.
func (*Project) ExecCommand ¶
Execute executes the project commands.
type ProjectCommand ¶
type ProjectCommand struct { // The name of the command. // Only used internally for logging purposes. Name string `yaml:"-" json:"-"` Description string `yaml:"description" json:"description"` // Args are the arguments to pass to the command. // These will be asked via stdin if not provided. Args map[string]any `yaml:"args" json:"args"` // The steps to run for the command. Steps *command.StepList `yaml:",inline" json:",inline"` }
ProjectCommand represents a command for a project.
type ProjectCommandMap ¶ added in v2.3.3
type ProjectCommandMap map[string]*ProjectCommand
func (*ProjectCommandMap) UnmarshalYAML ¶ added in v2.3.3
func (p *ProjectCommandMap) UnmarshalYAML(value *yaml.Node) error
type QuickGo ¶
type QuickGo struct { Host string `yaml:"host"` // The host to run the server on. Port string `yaml:"port"` // The port to run the server on. TLSKey string `yaml:"privateKey"` // The path to the TLS key. TLSCert string `yaml:"certificate"` // The path to the TLS certificate. }
Config represents the configuration for QuickGo.
Click to show internal directories.
Click to hide internal directories.