Documentation ¶
Index ¶
- Variables
- func AddOrbToCacheWithContent(orb ast.Orb, uri protocol.URI, content []byte, context *utils.LsContext, ...) error
- func ExecQuery(node *sitter.Node, query string, fn func(match *sitter.QueryMatch)) error
- func FindDeepestNode(rootNode *sitter.Node, content []byte, toFind []string) (*sitter.Node, error)
- func GetBlockMappingNode(streamNode *sitter.Node) *sitter.Node
- func GetChildMapping(node *sitter.Node) *sitter.Node
- func GetChildOfType(node *sitter.Node, typeName string) *sitter.Node
- func GetChildSequence(node *sitter.Node) *sitter.Node
- func GetFirstChild(node *sitter.Node) *sitter.Node
- func GetOrbInfo(orbVersionCode string, cache *utils.Cache, context *utils.LsContext) (*ast.OrbInfo, error)
- func GetOrbParameters(orb *ast.OrbInfo, position protocol.Position) map[string]ast.Parameter
- func GetOrbVersions(orbId string, token string, hostUrl, userId string) ([]struct{ ... }, error)
- func GetRootNode(content []byte) *sitter.Node
- func GetVersionInfo(versions []struct{ ... }, initialVersion string) (string, string, string)
- func ParseDockerImageValue(value string) ast.DockerImageInfo
- func ParseRemoteOrbs(orbs map[string]ast.Orb, cache *utils.Cache, context *utils.LsContext)
- func ParseYamlAnchors(doc *YamlDocument) map[string]YamlAnchor
- type JSONSchemaValidator
- type LocalOrb
- type ModifiedYamlDocument
- type OrbByNameResponse
- type OrbGQLData
- type OrbQuery
- type OrbResponse
- type YamlAnchor
- type YamlDocument
- func ParseFile(content []byte, context *utils.LsContext) YamlDocument
- func ParseFromContent(content []byte, context *utils.LsContext, URI protocol.URI, ...) (YamlDocument, error)
- func ParseFromURI(URI protocol.URI, context *utils.LsContext) (YamlDocument, error)
- func ParseFromUriWithCache(URI protocol.URI, cache *utils.Cache, context *utils.LsContext) (YamlDocument, error)
- func (doc *YamlDocument) CouldBeOrbReference(orbReference string) (string, bool)
- func (doc *YamlDocument) DoesCommandExist(commandName string) bool
- func (doc *YamlDocument) DoesCommandOrJobOrExecutorExist(name string, includeCommands bool) bool
- func (doc *YamlDocument) DoesExecutorExist(executorName string) bool
- func (doc *YamlDocument) DoesJobExist(jobName string) bool
- func (doc *YamlDocument) DoesOrbExist(orb ast.Orb, cache *utils.Cache) bool
- func (doc *YamlDocument) DoesWorkflowExist(workflowName string) bool
- func (doc *YamlDocument) FromOrbParsedAttributesToYamlDocument(orb ast.OrbParsedAttributes) YamlDocument
- func (doc *YamlDocument) GetDefinedParams(entityName string, cache *utils.Cache) map[string]ast.Parameter
- func (doc *YamlDocument) GetExecutorDefinedAtPosition(position protocol.Position) ast.Executor
- func (doc *YamlDocument) GetKeyValueNodes(node *sitter.Node) (keyNode *sitter.Node, valueNode *sitter.Node)
- func (doc *YamlDocument) GetNodeText(node *sitter.Node) string
- func (doc *YamlDocument) GetNodeTextWithRange(node *sitter.Node) ast.TextAndRange
- func (doc *YamlDocument) GetOrFetchOrbInfo(orb ast.Orb, cache *utils.Cache) (*ast.OrbInfo, error)
- func (doc *YamlDocument) GetOrbDefinedParams(entityName string, cache *utils.Cache) map[string]ast.Parameter
- func (doc *YamlDocument) GetOrbInfoFromName(name string, cache *utils.Cache) (*ast.OrbInfo, error)
- func (doc *YamlDocument) GetOrbURLDefinition(node *sitter.Node) ast.OrbURLDefinition
- func (doc *YamlDocument) GetParameterType(paramNode *sitter.Node) (paramType string, paramTypeRange protocol.Range)
- func (doc *YamlDocument) GetParamsWithPosition(position protocol.Position) map[string]ast.Parameter
- func (doc *YamlDocument) GetRawNodeText(node *sitter.Node) string
- func (doc *YamlDocument) GetWorkflows() []ast.TextAndRange
- func (doc *YamlDocument) GetYamlAnchorAtPosition(pos protocol.Position) (YamlAnchor, bool)
- func (doc *YamlDocument) InsertText(pos protocol.Position, text string) (YamlDocument, error)
- func (doc *YamlDocument) IsAlias(commandName string) bool
- func (doc *YamlDocument) IsBuiltIn(commandName string) bool
- func (doc *YamlDocument) IsFromUnfetchableOrb(name string) bool
- func (doc *YamlDocument) IsGivenOrb(commandName string, orbName string) bool
- func (doc *YamlDocument) IsOrbCommand(orbCommand string, cache *utils.Cache) bool
- func (doc *YamlDocument) IsOrbJob(orbCommand string, cache *utils.Cache) bool
- func (doc *YamlDocument) IsOrbReference(orbReference string) bool
- func (doc *YamlDocument) IsSelfHostedRunner(resourceClass string) bool
- func (doc *YamlDocument) IsYamlAliasPosition(pos protocol.Position) bool
- func (doc *YamlDocument) ModifyTextForAutocomplete(pos protocol.Position) []ModifiedYamlDocument
- func (doc *YamlDocument) NodeToRange(node *sitter.Node) protocol.Range
- func (doc *YamlDocument) ParseYAML(context *utils.LsContext, offset protocol.Position)
- func (doc *YamlDocument) ToOrbParsedAttributes() ast.OrbParsedAttributes
- func (doc *YamlDocument) ValidateYAML()
Constants ¶
This section is empty.
Variables ¶
View Source
var PARAMS_KEYS = []string{
"when",
}
Keys that can have only a parameter inside it, and therefore the JSON Schema validation is not necessary for these keys.
Example:
`when: << parameters.my_param >>` But in the JSON Schema, the `when` key is defined as an object, so the validation will fail if we don't ignore it.
Functions ¶
func FindDeepestNode ¶
func GetOrbInfo ¶
func GetOrbParameters ¶
func GetOrbVersions ¶
func GetRootNode ¶
func GetVersionInfo ¶
func GetVersionInfo( versions []struct{ Version string }, initialVersion string, ) (string, string, string)
*
- List all versions provided and return the latest minor, patch and major corresponding
- to the current version. *
- Notice: all versions number should have the format "v1.2.3" *
- Return format: latest, latestMinor, latestMajor *
- Where:
- - latest: Latest version published
- - latestMinor: Latest minor version published with the same major version
- - latestPatch: Latest patch published with the same major.minor version
func ParseDockerImageValue ¶
func ParseDockerImageValue(value string) ast.DockerImageInfo
func ParseRemoteOrbs ¶
func ParseYamlAnchors ¶
func ParseYamlAnchors(doc *YamlDocument) map[string]YamlAnchor
Types ¶
type JSONSchemaValidator ¶
type JSONSchemaValidator struct { Doc YamlDocument // contains filtered or unexported fields }
func (*JSONSchemaValidator) LoadJsonSchema ¶
func (validator *JSONSchemaValidator) LoadJsonSchema(schemaLocation string) error
func (*JSONSchemaValidator) ValidateWithJSONSchema ¶
func (validator *JSONSchemaValidator) ValidateWithJSONSchema(rootNode *sitter.Node, content []byte) []protocol.Diagnostic
Validates a config YML against a JSON Shema Returns a list of diagnostics and a boolean that suggest whether to continue diagnostic or not
type ModifiedYamlDocument ¶
type ModifiedYamlDocument struct { // The modified YAML Document Document YamlDocument // A short slug-like description of the way the document was modifier Tag string // Content added to the document Diff string }
type OrbByNameResponse ¶
type OrbByNameResponse struct {
Orb OrbGQLData
}
type OrbGQLData ¶
func GetOrbByName ¶
func GetOrbByName(orbName string, context *utils.LsContext) (OrbGQLData, error)
type OrbQuery ¶
type OrbResponse ¶
type OrbResponse struct {
OrbVersion OrbQuery
}
type YamlAnchor ¶
type YamlDocument ¶
type YamlDocument struct { Content []byte RootNode *sitter.Node Version float32 Description string URI protocol.URI Diagnostics *[]protocol.Diagnostic Context *utils.LsContext SchemaLocation string Orbs map[string]ast.Orb LocalOrbs []LocalOrb Executors map[string]ast.Executor Commands map[string]ast.Command Jobs map[string]ast.Job Workflows map[string]ast.Workflow PipelineParameters map[string]ast.Parameter YamlAnchors map[string]YamlAnchor OrbsRange protocol.Range ExecutorsRange protocol.Range CommandsRange protocol.Range JobsRange protocol.Range WorkflowRange protocol.Range PipelineParametersRange protocol.Range VersionRange protocol.Range LocalOrbInfo map[string]*ast.OrbInfo LocalOrbName string Offset protocol.Position }
func ParseFromContent ¶
func ParseFromURI ¶
func ParseFromUriWithCache ¶
func (*YamlDocument) CouldBeOrbReference ¶
func (doc *YamlDocument) CouldBeOrbReference(orbReference string) (string, bool)
func (*YamlDocument) DoesCommandExist ¶
func (doc *YamlDocument) DoesCommandExist(commandName string) bool
func (*YamlDocument) DoesCommandOrJobOrExecutorExist ¶
func (doc *YamlDocument) DoesCommandOrJobOrExecutorExist(name string, includeCommands bool) bool
func (*YamlDocument) DoesExecutorExist ¶
func (doc *YamlDocument) DoesExecutorExist(executorName string) bool
func (*YamlDocument) DoesJobExist ¶
func (doc *YamlDocument) DoesJobExist(jobName string) bool
func (*YamlDocument) DoesOrbExist ¶
func (*YamlDocument) DoesWorkflowExist ¶
func (doc *YamlDocument) DoesWorkflowExist(workflowName string) bool
func (*YamlDocument) FromOrbParsedAttributesToYamlDocument ¶
func (doc *YamlDocument) FromOrbParsedAttributesToYamlDocument(orb ast.OrbParsedAttributes) YamlDocument
func (*YamlDocument) GetDefinedParams ¶
func (*YamlDocument) GetExecutorDefinedAtPosition ¶
func (doc *YamlDocument) GetExecutorDefinedAtPosition(position protocol.Position) ast.Executor
func (*YamlDocument) GetKeyValueNodes ¶
func (*YamlDocument) GetNodeText ¶
func (doc *YamlDocument) GetNodeText(node *sitter.Node) string
func (*YamlDocument) GetNodeTextWithRange ¶
func (doc *YamlDocument) GetNodeTextWithRange(node *sitter.Node) ast.TextAndRange
func (*YamlDocument) GetOrFetchOrbInfo ¶
func (*YamlDocument) GetOrbDefinedParams ¶
func (*YamlDocument) GetOrbInfoFromName ¶
func (*YamlDocument) GetOrbURLDefinition ¶
func (doc *YamlDocument) GetOrbURLDefinition(node *sitter.Node) ast.OrbURLDefinition
func (*YamlDocument) GetParameterType ¶
func (*YamlDocument) GetParamsWithPosition ¶
func (*YamlDocument) GetRawNodeText ¶
func (doc *YamlDocument) GetRawNodeText(node *sitter.Node) string
func (*YamlDocument) GetWorkflows ¶
func (doc *YamlDocument) GetWorkflows() []ast.TextAndRange
func (*YamlDocument) GetYamlAnchorAtPosition ¶
func (doc *YamlDocument) GetYamlAnchorAtPosition(pos protocol.Position) (YamlAnchor, bool)
func (*YamlDocument) InsertText ¶
func (doc *YamlDocument) InsertText(pos protocol.Position, text string) (YamlDocument, error)
func (*YamlDocument) IsAlias ¶
func (doc *YamlDocument) IsAlias(commandName string) bool
func (*YamlDocument) IsBuiltIn ¶
func (doc *YamlDocument) IsBuiltIn(commandName string) bool
func (*YamlDocument) IsFromUnfetchableOrb ¶
func (doc *YamlDocument) IsFromUnfetchableOrb(name string) bool
Takes the name of anything that may be in an orb and returns if it is inside an orb that we can not use
func (*YamlDocument) IsGivenOrb ¶
func (doc *YamlDocument) IsGivenOrb(commandName string, orbName string) bool
func (*YamlDocument) IsOrbCommand ¶
func (doc *YamlDocument) IsOrbCommand(orbCommand string, cache *utils.Cache) bool
func (*YamlDocument) IsOrbJob ¶
func (doc *YamlDocument) IsOrbJob(orbCommand string, cache *utils.Cache) bool
func (*YamlDocument) IsOrbReference ¶
func (doc *YamlDocument) IsOrbReference(orbReference string) bool
func (*YamlDocument) IsSelfHostedRunner ¶
func (doc *YamlDocument) IsSelfHostedRunner(resourceClass string) bool
func (*YamlDocument) IsYamlAliasPosition ¶
func (doc *YamlDocument) IsYamlAliasPosition(pos protocol.Position) bool
func (*YamlDocument) ModifyTextForAutocomplete ¶
func (doc *YamlDocument) ModifyTextForAutocomplete(pos protocol.Position) []ModifiedYamlDocument
func (*YamlDocument) NodeToRange ¶
func (doc *YamlDocument) NodeToRange(node *sitter.Node) protocol.Range
func (*YamlDocument) ParseYAML ¶
func (doc *YamlDocument) ParseYAML(context *utils.LsContext, offset protocol.Position)
func (*YamlDocument) ToOrbParsedAttributes ¶
func (doc *YamlDocument) ToOrbParsedAttributes() ast.OrbParsedAttributes
func (*YamlDocument) ValidateYAML ¶
func (doc *YamlDocument) ValidateYAML()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.