config

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug          bool
	Dryrun         bool
	VersionFlagSet bool
	// ConfigFilePath is `.` if not set through the `-configFile` flag
	ConfigFilePath string
	// ProcWorkingDir is set through calling os.Getwd()
	ProcWorkingDir string
	ExePath        string
)

TODO: move these flags into the config and embed the config into the renderer/engine where needed in order to expose them.

View Source
var SemVer string

Functions

This section is empty.

Types

type Data added in v0.0.7

type Data struct {
	Template

	// left public due to it's need to be unmarshalled by Data.Load()
	TemplatesDir string `yaml:"templatesDir"`

	// OpenAPIFile represents the path to the yaml OpenAPI 3 file to render
	OpenAPIFile string

	OutputPath string
	// contains filtered or unexported fields
}

Data represents the config data used in the day-to-day running of can

TODO this may be vague in definition for the sake of its legibility in use

func (*Data) GetOpenAPIFilepath added in v0.0.7

func (d *Data) GetOpenAPIFilepath() (path string)

GetOpenAPIFilepath uses the current working directory, resolved config file and the openAPI file that was specified in the config file to determine the absolute path to an OpenAPI file. It takes into account that any of these, except the working directory could be relative. It returns the absolute value on every call by caching the result of it's first run and returning that on successive calls

func (*Data) GetOutputDir added in v0.0.7

func (d *Data) GetOutputDir() (path string)

GetOutputDir is used by the render engine to determine where rendered files will be written to

func (*Data) GetTemplateFilesDir added in v0.0.8

func (d *Data) GetTemplateFilesDir() string

func (*Data) Load added in v0.0.7

func (d *Data) Load() (err error)

type Template added in v0.0.7

type Template struct {
	Name       string
	ModuleName string
	Strategy   string
	// BasePackageName represents the
	BasePackageName string
	// contains filtered or unexported fields
}

Template's fields are dependant on there being a defined templated name in the CLI arguments or config file.

Jump to

Keyboard shortcuts

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