Documentation
¶
Overview ¶
Package validate is the validate command: the repo's AML, checked.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Validate = command.Define(command.Def[ValidateInput, aml.RepoValidation]{ Name: "validate", Short: "Validate the AML repo, optionally scoped to file globs", ReadOnly: true, Timeout: 5 * time.Minute, Needs: func(ValidateInput) command.Sidecars { return command.Sidecars{Node: true} }, Run: func(ctx context.Context, cc command.CommandContext, in ValidateInput) (aml.RepoValidation, error) { if err := command.RequireSidecars(cc, command.Sidecars{Node: true}); err != nil { return aml.RepoValidation{}, err } res, err := aml.Validate(ctx, cc.Clients.Node, cc.Repo, in.Globs) if v, ok := refused(err); ok { return aml.RepoValidation{}, apperr.EncapsulateWith(err, apperr.ValidationFailed, v.Message, apperr.Violate(v)) } if err != nil { return res, err } local, isLocal := cc.Repo.Local() var apps []string if isLocal { apps = dataApps(local.Dir) res.Reports = append(res.Reports, appReports(local.Dir, apps, in.Globs)...) } if err := unmatched(in.Globs, res.Unmatched, apps, isLocal); err != nil { return aml.RepoValidation{}, err } return res, nil }, Valid: func(r aml.RepoValidation) bool { return r.Valid }, })
Validate checks the AML repo, optionally scoped to file globs.
Functions ¶
This section is empty.
Types ¶
type ValidateInput ¶
type ValidateInput struct {
Globs []string `` /* 137-byte string literal not displayed */
}
ValidateInput is validate's input.
func (ValidateInput) TransformSchema ¶
Click to show internal directories.
Click to hide internal directories.