langpuppet

package
v0.0.0-...-c555478 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package langpuppet implements an integration entrypoint that combines lang and Puppet.

Index

Constants

View Source
const (
	// Name is the name of this frontend.
	Name = "langpuppet"
	// FlagPrefix gets prepended to each flag of both the puppet and lang GAPI.
	FlagPrefix = "lp-"
)
View Source
const (
	// MergePrefixLang is how a mergeable vertex name starts in mcl code.
	MergePrefixLang = "puppet_"
	// MergePrefixPuppet is how a mergeable Puppet class name starts.
	MergePrefixPuppet = "mgmt_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GAPI

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

GAPI implements the main langpuppet GAPI interface. It wraps the Puppet and Lang GAPIs and receives graphs from both. It then runs a merging algorithm that mainly just makes a union of both the sets of vertices and edges. Some vertices are merged using a naming convention. Details can be found in the langpuppet.mergeGraphs function.

func (*GAPI) Cli

func (obj *GAPI) Cli(cliInfo *gapi.CliInfo) (*gapi.Deploy, error)

Cli takes a cli.Context, and returns our GAPI if activated. All arguments should take the prefix of the registered name. On activation, if there are any validation problems, you should return an error. If this was not activated, then you should return a nil GAPI and a nil error.

func (*GAPI) CliFlags

func (obj *GAPI) CliFlags(command string) []cli.Flag

CliFlags returns a list of flags used by this deploy subcommand. It consists of all flags accepted by lang and puppet mode, with a respective "lp-" prefix.

func (*GAPI) Close

func (obj *GAPI) Close() error

Close shuts down the Puppet GAPI.

func (*GAPI) Graph

func (obj *GAPI) Graph() (*pgraph.Graph, error)

Graph returns a current Graph.

func (*GAPI) Init

func (obj *GAPI) Init(data *gapi.Data) error

Init initializes the langpuppet GAPI struct.

func (*GAPI) Next

func (obj *GAPI) Next() chan gapi.Next

Next returns nil errors every time there could be a new graph.

Jump to

Keyboard shortcuts

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