Documentation ¶
Index ¶
- Constants
- func AssureClotasDir(folder string)
- func GenerateName(scriptName string, t time.Time, n int) string
- func GetFiles(folder string) []string
- type ClotaFile
- func (cf *ClotaFile) CreateFile()
- func (ClotaFile) GetNext(file ClotaFile, scriptName string) *ClotaFile
- func (ClotaFile) GetNextFromList(files []ClotaFile, scriptName string) *ClotaFile
- func (ClotaFile) New(scriptName string, n int, t *time.Time) *ClotaFile
- func (ClotaFile) NewFromFile(file string) *ClotaFile
- func (ClotaFile) NewFromFileInfo(file os.FileInfo) *ClotaFile
Constants ¶
const DefaultDateLayout = "20060102"
const DefaultFileMode = 0755
const DefaultFileType = "sh"
const DefaultScriptName = "script"
const DefaultSeparator = "-"
const DefaultTargetFolder = "clotas"
const DefaultTemplate = `` /* 249-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func AssureClotasDir ¶
func AssureClotasDir(folder string)
AssureClotasDir Make sure Clotas folder exists.
Types ¶
type ClotaFile ¶
type ClotaFile struct { Name string // filename // contains filtered or unexported fields }
func (*ClotaFile) CreateFile ¶
func (cf *ClotaFile) CreateFile()
CreateFile /** Create actual file on the file system and update the object with information.
func (ClotaFile) GetNext ¶
GetNext /** Generate new ClotaFile object, with incremented serial number from an existing provided file.
func (ClotaFile) GetNextFromList ¶
GetNextFromList /** Generate new ClotaFile object from provided list of ClotaFile-s with incremented serial.
func (ClotaFile) New ¶
New Create new ClotaFile object from basic provided info. No actual file is created. @param scriptName string (Optional) If empty, defaults to DefaultScriptName. @param n int (Optional) If negative number is provided defaults to 1. @param t *time.Time (Optional) If empty, set to Now; used for the date in the file name.