yamlcreator

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetailConfig

type DetailConfig struct {
	Name string `yaml:"name"`
}

DetailConfig sets the default properties to be set replace in each json file

type YamlConfig

type YamlConfig struct {
	Config []map[string]string
	Detail map[string][]DetailConfig `yaml:",inline"`
}

YamlConfig defines the structure for the config file for each API

func NewYamlConfig

func NewYamlConfig() *YamlConfig

NewYamlConfig return a new yaml struct with Config and Detail as fields

func (*YamlConfig) AddConfig

func (yc *YamlConfig) AddConfig(name string, rawName string)

AddConfig allows to add new configs to the yaml file

func (*YamlConfig) CreateYamlFile

func (yc *YamlConfig) CreateYamlFile(fs afero.Fs, path string, name string) error

CreateYamlFile transforms the struct into a physical file on disk

type YamlCreator

type YamlCreator interface {
	CreateYamlFile(fs afero.Fs, path string, name string) error
	AddConfig(name string, rawName string)
}

YamlCreator implements method to create the yaml configuration file

Jump to

Keyboard shortcuts

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