Documentation ¶
Index ¶
- Constants
- type FileTemplateTicket
- type TemplateError
- type TemplateVarDictionary
- func (dict *TemplateVarDictionary) Add(key string, value string)
- func (dict *TemplateVarDictionary) AddArch(key string, value string)
- func (dict *TemplateVarDictionary) AddTaggedStruct(strct interface{}) (numadded int, err error)
- func (dict *TemplateVarDictionary) AddTaggedStructArch(strct interface{}) (numadded int, err error)
- func (dict *TemplateVarDictionary) Del(key string)
- func (this *TemplateVarDictionary) DumpAsString() (output string)
- func (this *TemplateVarDictionary) Get(key string) (ret string, ok bool)
- func (this *TemplateVarDictionary) Render(input string) (output string)
Constants ¶
View Source
const ( TEMPLATEERROR_UNKNOWN = iota TEMPLATEERROR_BAD_FILE = iota TEMPLATEERROR_PERMISSIONS = iota TEMPLATEERROR_NO_TEMPLATE = iota )
View Source
const ARCH_PREFIX = "ARCH_"
View Source
const DEFAULT_OUTPUT_FILE_PERMS = 0664
View Source
const MAX_FILE_SIZE = 1024 * 1024 // one 1MB - if a config file is bigger than that then its rediculous
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileTemplateTicket ¶
our work ticket
func NewFileOp ¶
func NewFileOp(name string, sourcepath string, sourcestring string, targetpath string, dict *TemplateVarDictionary) (ret *FileTemplateTicket)
func (*FileTemplateTicket) GetOpName ¶
func (this *FileTemplateTicket) GetOpName() string
func (*FileTemplateTicket) MaybeGenerateFile ¶
func (this *FileTemplateTicket) MaybeGenerateFile() (err error, wrotefile bool, current string)
func (*FileTemplateTicket) ProcessTemplateFile ¶
func (this *FileTemplateTicket) ProcessTemplateFile() (err error)
type TemplateError ¶
func (*TemplateError) Error ¶
func (this *TemplateError) Error() string
type TemplateVarDictionary ¶
func NewTemplateVarDictionary ¶
func NewTemplateVarDictionary() (ret *TemplateVarDictionary)
func (*TemplateVarDictionary) Add ¶
func (dict *TemplateVarDictionary) Add(key string, value string)
func (*TemplateVarDictionary) AddArch ¶
func (dict *TemplateVarDictionary) AddArch(key string, value string)
func (*TemplateVarDictionary) AddTaggedStruct ¶
func (dict *TemplateVarDictionary) AddTaggedStruct(strct interface{}) (numadded int, err error)
AddTaggedStruct adds a structure of tagged items in a struct. Only string fields are added, and only public fields. An example would be:
type Example struct { Stuff string `dict:"STUFF"` }
In this case the tag "STUFF" would be added, with whatever value it's assigned.
func (*TemplateVarDictionary) AddTaggedStructArch ¶
func (dict *TemplateVarDictionary) AddTaggedStructArch(strct interface{}) (numadded int, err error)
AddTaggedStructArch adds a structure of tagged items in a struct. Only string fields are added, and only public fields. An example would be:
type Example struct { Stuff string `dict:"STUFF"` }
In this case the tag "ARCH_STUFF" would be added, with whatever value it's assigned.
func (*TemplateVarDictionary) Del ¶
func (dict *TemplateVarDictionary) Del(key string)
func (*TemplateVarDictionary) DumpAsString ¶
func (this *TemplateVarDictionary) DumpAsString() (output string)
func (*TemplateVarDictionary) Get ¶
func (this *TemplateVarDictionary) Get(key string) (ret string, ok bool)
func (*TemplateVarDictionary) Render ¶
func (this *TemplateVarDictionary) Render(input string) (output string)
Click to show internal directories.
Click to hide internal directories.