gosod

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: MIT Imports: 1 Imported by: 105

README

gosod

An application scaffold library.

Installation

go get github.com/leaanthony/gosod

Usage

  1. Define a template directory
  2. Define some data
  3. Extract to a target directory
package main

import (
	"log"

	"github.com/leaanthony/gosod"
)

type config struct {
	Name string
}

func main() {

	// Define a new Template directory
	basic, err := gosod.TemplateDir("./myTemplate")
	if err != nil {
		log.Fatal(err)
	}

	// Make some config data
	myConfig := &config{
		Name: "Mat",
	}

	// Create a new directory using the template and config
	err = basic.Extract("./generated", myConfig)
	if err != nil {
		log.Fatal(err)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TemplateDir

func TemplateDir(directoryPath string) (*templatedir.TemplateDir, error)

TemplateDir creates a new TemplateDir structure for the given directoryPath

Types

This section is empty.

Directories

Path Synopsis
examples
basic command
ignore command
internal

Jump to

Keyboard shortcuts

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