tfgen

package
v0.0.0-...-db8a2f5 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAgentHCL

func GenerateAgentHCL(
	cfg *config.Config,
	topology *infra.Topology,
	node *infra.Node,
) (string, error)

func StringTemplate

func StringTemplate(t *template.Template, data any) (string, error)

Types

type FileResource

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

func File

func File(name string, res Resource) *FileResource

func GeneratePrometheusConfigFile

func GeneratePrometheusConfigFile(cfg *config.Config, topology *infra.Topology) *FileResource

func GrafanaINI

func GrafanaINI() *FileResource

func GrafanaPrometheus

func GrafanaPrometheus() *FileResource

func VaultConfig

func VaultConfig() *FileResource

func (*FileResource) Commit

func (r *FileResource) Commit(logger hclog.Logger) error

func (*FileResource) Name

func (r *FileResource) Name() string

type HCLBuilder

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

func (*HCLBuilder) String

func (b *HCLBuilder) String() string

type Resource

type Resource interface {
	Render() (string, error)
}

func DockerImage

func DockerImage(name, image string) Resource

func DockerNetwork

func DockerNetwork(name, cidr string) Resource

func DockerVolume

func DockerVolume(name string) Resource

func Embed

func Embed(name string) Resource

func Eval

func Eval(t *template.Template, data any) Resource

func GenerateInfraContainers

func GenerateInfraContainers(
	config *config.Config,
	topology *infra.Topology,
	cache *cachestore.Store,
	podName string,
	node *infra.Node,
) ([]Resource, error)

func GenerateMeshGatewayContainer

func GenerateMeshGatewayContainer(
	config *config.Config,
	topology *infra.Topology,
	podName string,
	node *infra.Node,
) Resource

func GenerateNodeContainers

func GenerateNodeContainers(
	cfg *config.Config,
	topology *infra.Topology,
	cache *cachestore.Store,
	node *infra.Node,
	podContents bool,
) ([]Resource, error)

func GeneratePingPongContainers

func GeneratePingPongContainers(
	config *config.Config,
	topology *infra.Topology,
	podName string,
	node *infra.Node,
) []Resource

func GrafanaContainer

func GrafanaContainer() Resource

func HCL

func HCL(t *template.Template, data any) Resource

func PrometheusContainer

func PrometheusContainer() Resource

func Text

func Text(s string) Resource

func VaultContainer

func VaultContainer() Resource

type UpdateResult

type UpdateResult int
const (
	UpdateResultNone UpdateResult = iota
	UpdateResultCreated
	UpdateResultModified
)

func UpdateFileIfDifferent

func UpdateFileIfDifferent(
	logger hclog.Logger,
	body []byte,
	path string,
	perm os.FileMode,
) (UpdateResult, error)

func WriteHCLResourceFile

func WriteHCLResourceFile(
	logger hclog.Logger,
	res []Resource,
	path string,
	perm os.FileMode,
) (UpdateResult, error)

Jump to

Keyboard shortcuts

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