package
0.2.5
Repository: https://github.com/slalombuild/fusion.git
Documentation: pkg.go.dev

# README

generate

import "github.com/slalombuild/fusion/internal/generate"

Index

Constants

const (
    MODULE_FUSION    = "github.com/slalombuild/fusion/"
    MODULE_ZEROLOG   = "github.com/rs/zerolog/log"
    MODULE_ERRORS    = "github.com/pkg/errors"
    MODULE_TEMPLATES = MODULE_FUSION + "templates"
    MODULE_COMMANDS  = MODULE_FUSION + "internal/commands"
)

Variables

var (
    ErrWriteFile  = "failed to write file %s"
    ErrReadFile   = "failed to read file"
    ErrCreateDirs = "failed to recursively create directories"
)

func Command

func Command(provider, resource string) string

Command generates source code for a new resource command

func CommandName

func CommandName(name string) string

CommandName properly formats the name of the go command from the provided resource

func CommandRunFunc

func CommandRunFunc(resource string) jen.Code

func OutputPath

func OutputPath(destination Destination, provider, resource string) string

func Save

func Save(path string, content []byte) error

Save saves a file and directory path if it does not exist

func Template

func Template(fields map[string]string, sourceFile string) []byte

func TemplateData

func TemplateData(fields map[string]string, provider, resource string) string

TemplateData generates source code for rendering template data

type Destination

type Destination int
const (
    DESTINATION_COMMAND Destination = iota
    DESTINATION_TEMPLATE
    DESTINATION_TEMPLATE_DATA
)

Generated by gomarkdoc

# Functions

Command generates source code for a new resource command.
CommandName properly formats the name of the go command from the provided resource.
No description provided by the author
No description provided by the author
Save saves a file and directory path if it does not exist.
No description provided by the author
TemplateData generates source code for rendering template data.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author