Documentation ¶
Index ¶
- Variables
- func BuildTemplate(text string, sharedTemplateBuffers []*bytes.Buffer) (*template.Template, error)
- func CheckIfDir(path string) (*bool, error)
- func GetDataFromPath(source, arg string) (*bytes.Buffer, error)
- func GetDataFromReadCloser(f io.ReadCloser) (*bytes.Buffer, error)
- func GetVersion() string
- func InitLogger(levelOverride string)
- func IsArchive(filePath string) bool
- func LoadSharedTemplates(templates []string) []*bytes.Buffer
- func LoadTemplates(templateFiles []string, sharedTemplateBuffers []*bytes.Buffer) ([]*template.Template, error)
- func MergeData(dataFiles []string) (map[string]any, error)
- func ParseFileStringFlag(v string) (string, error)
- func PrintVersion()
- func ReadTar(filePath string) ([]filePathMap, error)
- func ValidateArguments(settings *CLISettings) int64
- func WalkDir(rootPath string, p fs.FS, match []string) []string
- type CLISettings
Constants ¶
This section is empty.
Variables ¶
View Source
var RunSettings = &CLISettings{}
View Source
var YutcLog zerolog.Logger
Functions ¶
func BuildTemplate ¶
func CheckIfDir ¶ added in v0.0.5
CheckIfDir checks if a path is a directory, returns a bool pointer and an error if doesn't exist
func GetDataFromPath ¶
GetDataFromPath reads from a file, URL, or stdin and returns a buffer with the contents
func GetDataFromReadCloser ¶
func GetDataFromReadCloser(f io.ReadCloser) (*bytes.Buffer, error)
GetDataFromReadCloser reads from a ReadCloser and returns a buffer with the contents
func GetVersion ¶ added in v0.0.5
func GetVersion() string
func InitLogger ¶ added in v0.0.3
func InitLogger(levelOverride string)
func LoadSharedTemplates ¶
func LoadTemplates ¶
func ParseFileStringFlag ¶
func PrintVersion ¶
func PrintVersion()
func ValidateArguments ¶
func ValidateArguments( settings *CLISettings, ) int64
ValidateArguments checks the arguments for the CLI and returns a code for the error
Types ¶
type CLISettings ¶ added in v0.0.5
type CLISettings struct { DataFiles []string `json:"data-files"` DataMatch []string `json:"data-match"` CommonTemplateFiles []string `json:"common-templates"` CommonTemplateMatch []string `json:"common-templates-match"` TemplatePaths []string `json:"template-files"` TemplateMatch []string `json:"template-match"` Output string `json:"output"` Overwrite bool `json:"overwrite"` Version bool `json:"version"` Verbose bool `json:"verbose"` BearerToken string `json:"bearer-auth"` BasicAuth string `json:"basic-auth"` }
CLISettings is a struct to hold all the settings from the CLI
Click to show internal directories.
Click to hide internal directories.