config

package
v0.0.0-...-15a8384 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFilename string = ".template.cfg"

Variables

This section is empty.

Functions

func TargetExists

func TargetExists(targetpath string) bool

TargetExists return true if target exists

func UserHomeDir

func UserHomeDir() string

func UserName

func UserName() string

Types

type TemplateConfig

type TemplateConfig struct {
	Filepath    string
	MailAddress string
	Company     string
	Copyright   string
	License     string
	User        string
	UserName    string
	Lang        string
	Homedir     string

	//
	ScriptName  string
	FullPath    string
	Verbose     bool
	Stdout      bool
	Title       string
	Description string

	// time strings
	Date string
	Year string

	Object *ini.File
	Items  []*TemplateItem
}

func NewTemplateConfig

func NewTemplateConfig(lang string) *TemplateConfig

func (TemplateConfig) GetItem

func (tc TemplateConfig) GetItem(name string) *TemplateItem

func (TemplateConfig) GetKeyAsInt

func (tc TemplateConfig) GetKeyAsInt(keyname string) int

func (TemplateConfig) GetKeyAsString

func (tc TemplateConfig) GetKeyAsString(keyname string) string

func (*TemplateConfig) Load

func (tc *TemplateConfig) Load()

func (TemplateConfig) LoadFile

func (tc TemplateConfig) LoadFile() *ini.File

func (TemplateConfig) SaveTo

func (tc TemplateConfig) SaveTo(filename string) error

type TemplateItem

type TemplateItem struct {
	Name        string
	Description string
	Mode        int
	Extension   string
}

Jump to

Keyboard shortcuts

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