parser

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List() []string

List returns the list of parsers.

func Pin

func Pin(ctx context.Context, res resolver.Resolver, parser Parser, m *yaml.Node) error

Pin extracts all references from the given YAML document and resolves them using the given resolver, updating the associated YAML nodes.

func Unpin

func Unpin(m *yaml.Node) error

Unpin removes any pinned references and updates the actual YAML to be the original reference, leaving any other comment intact. This effectively replaces the YAML with the cached comment, which could result in losing the current pin.

This function does not make any outbound network calls and relies solely on information in the document.

Types

type Actions

type Actions struct{}

func (*Actions) Parse

func (a *Actions) Parse(m *yaml.Node) (*RefsList, error)

Parse pulls the GitHub Actions refs from the document.

type CloudBuild

type CloudBuild struct{}

func (*CloudBuild) Parse

func (c *CloudBuild) Parse(m *yaml.Node) (*RefsList, error)

Parse pulls the Google Cloud Buidl refs from the document.

type Parser

type Parser interface {
	Parse(m *yaml.Node) (*RefsList, error)
}

Parser defines an interface which parses references out of the given yaml node.

func For

func For(ctx context.Context, name string) (Parser, error)

For returns the parser that corresponds to the given name.

type RefsList

type RefsList struct {
	// contains filtered or unexported fields
}

func (*RefsList) Add

func (l *RefsList) Add(ref string, m *yaml.Node)

func (*RefsList) All

func (l *RefsList) All() map[string][]*yaml.Node

func (*RefsList) Refs

func (l *RefsList) Refs() []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL