model

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const REGEX = `\_{\s*(\S+)\s*\}_` // "_\\{\\s*(.*?)\\s*\\}\\_"

Variables

This section is empty.

Functions

func GetValue

func GetValue[T Template | FlagsAction](s T, field string) (string, error)

Get a field value from a struct

func SetValue

func SetValue(s *Template, field string, value string)

Set a field value for a struct

Types

type FlagsAction

type FlagsAction struct {
	IsForce bool
	IsYes   bool
}

type Props

type Props struct {
	JsonData string
	PathYml  *viper.Viper
}

type Template

type Template struct {
	From        string
	To          string
	Filename    string
	Prefix      string
	Suffix      string
	Extension   string
	Props       Props
	FlagsAction FlagsAction
}

func (Template) CreateFile

func (template Template) CreateFile() error

Jump to

Keyboard shortcuts

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