Documentation
¶
Index ¶
Constants ¶
View Source
const ( DeviceTemplateName = "devices" ValueTemplateName = "values" KeysTemplateName = "keys" )
View Source
const ( LibraryName = "confMQTT" ConfFolder = "" EntriesFolder = "confEntry" DevicesFolder = "confDevice" KeysFileName = "keys_gen.go" ValuesFileName = "values_gen.go" DevicesFileName = "devices_gen.go" )
Variables ¶
View Source
var ( //go:embed templates/keys.go.tmpl KeyTemplate string //go:embed templates/devices.go.tmpl DeviceTemplate string //go:embed templates/values.go.tmpl ValueTemplate string //go:embed templates/header.go.tmpl HeaderTemplate string //go:embed templates/object.go.tmpl ObjectTemplate string //go:embed definitions/devices.json DeviceList []byte //go:embed definitions/keys.json KeyList []byte //go:embed definitions/values.json ValueList []byte )
View Source
var ( BasePackage = path.Join(LibraryName, "pkg") InternalPackage = path.Join(LibraryName, "internal", "pkg") JsonHelpersPackage = path.Join(InternalPackage, "tools") EntriesPackage = path.Join(BasePackage, ConfFolder, EntriesFolder) DevicesPackage = path.Join(BasePackage, ConfFolder, DevicesFolder) KeysPath = filepath.Join("pkg", EntriesFolder, KeysFileName) ValuesPath = filepath.Join("pkg", EntriesFolder, ValuesFileName) DevicesPath = filepath.Join("pkg", DevicesFolder, DevicesFileName) )
View Source
var ( Devices = Data[ObjectOptions]{ PackageName: DevicesFolder, Imports: []string{ EntriesPackage, JsonHelpersPackage, }, } )
View Source
var ( Keys = Data[KeyOptions]{ PackageName: EntriesFolder, Imports: []string{ JsonHelpersPackage, }, } )
View Source
var (
Template *template.Template
)
View Source
var ( Values = Data[ObjectOptions]{ PackageName: EntriesFolder, Imports: []string{ JsonHelpersPackage, }, } )
Functions ¶
func RecreateDir ¶
func RecreateDir(dirname string)
func WriteTemplate ¶
Types ¶
type KeyOptions ¶
type ObjectOptions ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.