csar

package
v0.0.0-...-f1610be Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	SpecNfd = "NFD.yaml"
)

Variables

This section is empty.

Functions

func ApplyTransformation

func ApplyTransformation(zipFile string, fileName string,
	parser YamlParser, substitution map[string]string) (string, error)

ApplyTransformation adjusts yaml file based on substitution map It unzip csar file, find target yaml file and apply transformation function Compress csar back as new csar file.

func NfdYamlPropertyTransformer

func NfdYamlPropertyTransformer(file string, substitution map[string]string) error

NfdYamlPropertyTransformer - substitution callback

func Reader

func Reader(fileName string, targetFile string, topology interface{}) (interface{}, error)

Reader read file

 Example:
		var topology models.CSAR
 	find inside a zip NFD parse it and return
		t, err := csar.Reader("/tests/smokeping-cnf.csar", "NFD.yaml", topology)
		b, err := yaml.Marshal(&t)
		fmt.Println(string(b))

Types

type YamlParser

type YamlParser func(path string, substitution map[string]string) error

YamlParser - parser callback

Directories

Path Synopsis
Package main Copyright 2020-2021 Author.
Package main Copyright 2020-2021 Author.

Jump to

Keyboard shortcuts

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