package langpuppet

import "github.com/purpleidea/mgmt/puppet/langpuppet"

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

Index

Constants

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_"
)
const (
	// Name is the name of this frontend.
	Name = "langpuppet"
)

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(info *gapi.Info) (*gapi.Deploy, error)

Cli takes an *Info struct, and returns our deploy if activated, and if there are any validation problems, you should return an error. If there is no deploy, then you should return a nil deploy and a nil error.

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) Info

func (obj *GAPI) Info() *gapi.InfoResult

Info returns some data about the GAPI implementation.

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.

Source Files

gapi.go merge.go

Version
v0.0.0-20250322185616-c50a578426f1 (latest)
Published
Mar 22, 2025
Platform
linux/amd64
Imports
10 packages
Last checked
4 days ago

Tools for package owners.