base

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadYaml

func ReadYaml(path string, object interface{}) error

ReadYaml reads a yaml file into a structure

Types

type FileGenerator

type FileGenerator struct {
	*Generator
	Config *config.Config
	Name   string
	Data   map[string]string
}

FileGenerator manages generic or simple file generation

func NewFileGenerator

func NewFileGenerator(cfg *config.Config, name string, path string, data map[string]string) *FileGenerator

NewFileGenerator creates and returns a FileGenerator

func (*FileGenerator) Execute

func (f *FileGenerator) Execute() error

Execute configures and generates a file

type Generator

type Generator struct {
	Filename string
	Buffer   *bytes.Buffer
}

Generator is the base generate for all other generators

func (*Generator) Format

func (g *Generator) Format() error

Format the file using goimports

func (*Generator) Write

func (g *Generator) Write() error

Write the output of the generator to a file

Jump to

Keyboard shortcuts

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