skeleton

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitSuccess = 0
	ExitError   = 1
)

Variables

View Source
var DefaultFuncMap = skeletonkit.DefaultFuncMap

DefaultFuncMap is default FuncMap for a template. Deprecated: should use skeletonkit.TemplateWithFuncs

View Source
var DefaultPrompt = &Prompt{
	Input:     os.Stdin,
	Output:    os.Stdout,
	ErrOutput: os.Stderr,
}

DefaultPrompt is default Prompt.

View Source
var DefaultTemplate *template.Template

DefaultTemplate is default template for skeleton. Deprecated: should use skeletonkit.

Functions

func Main

func Main(version string, args []string) int

Types

type Checker

type Checker string
const (
	CheckerUnit   Checker = "unit"
	CheckerSingle Checker = "single"
	CheckerMulti  Checker = "multi"
)

func (*Checker) Set

func (ch *Checker) Set(s string) error

func (Checker) String

func (ch Checker) String() string

String returns "single", "multi" or "unit".

type Generator

type Generator struct {
	Template *template.Template
}

func (*Generator) Run

func (g *Generator) Run(info *Info) (fs.FS, error)

type Info

type Info struct {
	Kind      Kind
	Checker   Checker
	Pkg       string
	Path      string
	Cmd       bool
	Plugin    bool
	GoMod     bool
	GoVersion string
}

type Kind

type Kind string

Kind represents kind of skeleton codes. Kind implements flag.Value.

const (
	KindInspect  Kind = "inspect"
	KindSSA      Kind = "ssa"
	KindCodegen  Kind = "codegen"
	KindPackages Kind = "packages"
)

func (*Kind) Set

func (k *Kind) Set(s string) error

"ssa" -> KindSSA, "codegen" -> KindCodegen, "packages" -> KindPackages otherwise KindInspect.

func (Kind) String

func (k Kind) String() string

type Prompt

type Prompt = skeletonkit.Prompt

Prompt receive input from a user.

type Skeleton

type Skeleton struct {
	Dir       string
	Output    io.Writer
	ErrOutput io.Writer
	Input     io.Reader
	GoVersion string
}

func (*Skeleton) Run

func (s *Skeleton) Run(version string, args []string) int

Directories

Path Synopsis
_template
internal

Jump to

Keyboard shortcuts

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