Documentation ¶
Index ¶
- Variables
- func ServiceDefinition(p *project.Project) util.ValueMap
- type Build
- type Builds
- type Params
- type PrjAndMods
- type Result
- func (r *Result) AddDebug(msg string, args ...any)
- func (r *Result) AddLog(msg string, args ...any)
- func (r *Result) AddWarn(msg string, args ...any)
- func (r *Result) HasErrors() bool
- func (r *Result) Merge(tgt *Result) *Result
- func (r *Result) StatusLog() string
- func (r *Result) Title() string
- func (r *Result) WithError(err error) *Result
- type ResultContext
- type ResultContexts
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TypeAudit = Type{Key: "audit", Title: "Audit", Icon: "scale", Description: "Audits the project files, detecting invalid files and empty folders"} TypeBuild = Type{Key: "build", Title: "Build", Icon: "hammer", Description: "Builds the project, many options available"} TypeCreate = Type{Key: "create", Title: "Create", Icon: "folder-plus", Description: "Creates a new project"} TypeDebug = Type{Key: "debug", Title: "Debug", Icon: "bug", Description: "Dumps a ton of information about the project"} TypeDoctor = Type{Key: "doctor", Title: "Doctor", Icon: "first-aid", Description: "Makes sure your machine has the required dependencies"} TypeGenerate = Type{Key: "generate", Title: "Generate", Icon: "forward", Description: "Applies pending changes to files as required"} TypePreview = Type{Key: "preview", Title: "Preview", Icon: "play", Description: "Show what would happen if you generate"} TypeSVG = Type{Key: "svg", Title: "SVG", Icon: "icons", Description: "Builds the project's SVG files"} TypeTest = Type{Key: "test", Title: "Test", Icon: "wrench", Description: "Runs internal tests, you probably don't want this", Hidden: true} )
View Source
var ( AllTypes = []Type{TypeAudit, TypeBuild, TypeCreate, TypeDebug, TypeDoctor, TypeGenerate, TypePreview, TypeSVG, TypeTest} ProjectTypes = []Type{TypePreview, TypeGenerate, TypeAudit, TypeBuild} )
View Source
var AllBuilds = Builds{ {Key: "start", Title: "Start", Description: "Starts the prebuilt project binary", Run: onStart}, {Key: "deps", Title: "Dependencies", Description: "Manages Go dependencies", Run: onDeps}, {Key: "imports", Title: "Imports", Description: "Reorders the imports", Run: onImports}, {Key: "ignored", Title: "Ignored", Description: "Shows files that are ignored by code generation", Run: onIgnored}, {Key: "packages", Title: "Packages", Description: "Visualize your application's packages", Run: onPackages}, {Key: "cleanup", Title: "Cleanup", Description: "Cleans up file permissions", Run: onCleanup}, simpleBuild("build", "Build", "make build"), simpleBuild("clean", "Clean", "make clean"), simpleBuild("tidy", "Tidy", "go mod tidy"), simpleBuild("format", "Format", "bin/format.sh"), simpleBuild("lint", "Lint", "bin/check.sh"), {Key: "clientInstall", Title: "Client Install", Description: ciDesc, Run: func(ctx context.Context, pm *PrjAndMods, ret *Result) *Result { return simpleProc(ctx, "npm install", filepath.Join(pm.Prj.Path, "client"), ret, pm.Logger) }}, simpleBuild("clientBuild", "Client Build", "bin/build/client.sh"), {Key: "deployments", Title: "Deployments", Description: "Manages deployments", Run: onDeployments}, {Key: "test", Title: "Test", Description: "Does a test", Run: func(ctx context.Context, pm *PrjAndMods, ret *Result) *Result { return simpleProc(ctx, "bin/test.sh", pm.Prj.Path, ret, pm.Logger) }}, }
Functions ¶
Types ¶
type PrjAndMods ¶
type Result ¶
type Result struct { Project *project.Project `json:"project"` Action Type `json:"action"` Status string `json:"status"` Args util.ValueMap `json:"args,omitempty"` Data any `json:"data,omitempty"` Modules module.Results `json:"modules,omitempty"` Logs []string `json:"logs,omitempty"` Errors []string `json:"errors,omitempty"` Duration int `json:"duration,omitempty"` // contains filtered or unexported fields }
type ResultContext ¶
type ResultContext struct { Prj *project.Project `json:"prj,omitempty"` Cfg util.ValueMap `json:"cfg,omitempty"` Res *Result `json:"res,omitempty"` }
func (*ResultContext) Status ¶
func (c *ResultContext) Status() string
func (*ResultContext) Title ¶
func (c *ResultContext) Title() string
type ResultContexts ¶
type ResultContexts []*ResultContext
func (ResultContexts) Errors ¶
func (x ResultContexts) Errors() []string
func (ResultContexts) Title ¶
func (x ResultContexts) Title() string
Click to show internal directories.
Click to hide internal directories.