Documentation ¶
Index ¶
- Variables
- func ExportRegistered()
- func Load(path string) (a NFObjects.AssetProperties, err error)
- func ParseAndRun(window fyne.Window, function string, args *NFData.NFInterfaceMap) (*NFData.NFInterfaceMap, error)
- type Function
- func (f *Function) CheckArgs() error
- func (f *Function) Export() error
- func (f *Function) FetchIDs() []uuid.UUID
- func (f *Function) GetArgs() *NFData.NFInterfaceMap
- func (f *Function) GetID() uuid.UUID
- func (f *Function) GetName() string
- func (f *Function) GetType() string
- func (f *Function) MakeId()
- func (f *Function) Register(handler functionHandler)
- func (f *Function) Run(window fyne.Window, newValues *NFData.NFInterfaceMap) (*NFData.NFInterfaceMap, error)
- func (f *Function) SetAndCheckArgs(args *NFData.NFInterfaceMap) error
- func (f *Function) SetArgs(args *NFData.NFInterfaceMap)
- func (f *Function) SetName(newName string)
- func (f *Function) SetType(t string)
- func (f *Function) Validate() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ExportPath = "exports/functions"
ExportPath is the path where the function will be exported
Functions ¶
func ExportRegistered ¶
func ExportRegistered()
ExportRegistered exports all registered functions to json files
func Load ¶
func Load(path string) (a NFObjects.AssetProperties, err error)
Load is a function that is used to load a function from a .NFFunction file
func ParseAndRun ¶
func ParseAndRun(window fyne.Window, function string, args *NFData.NFInterfaceMap) (*NFData.NFInterfaceMap, error)
ParseAndRun parses a function from its string name runs it and returns the results
Types ¶
type Function ¶
type Function struct { // Name is the name of the function for later reference in editing Name string `json:"Name"` // UUID is the Universally Unique Identifier of the function UUID uuid.UUID `json:"UUID"` // Action is the action that the function will be called on(OnTapped, OnHover, etc) Action string `json:"Action"` //Priority is the order in which the function will be called in relation to other action based functions Priority int `json:"Priority"` //Type is the type of function that is used to parse the function this should be Globally Unique, so when making //custom ones prefix it with your package name like "MyPackage.MyFunction" Type string `json:"Type"` //RequiredArgs is a list of arguments that are required for the function to run RequiredArgs *NFData.NFInterfaceMap `json:"-"` //This is not exported to json //OptionalArgs is a list of arguments that are optional for the function to run OptionalArgs *NFData.NFInterfaceMap `json:"-"` //This is not exported to json //Args is a list of arguments that are passed to the function through the scene Args *NFData.NFInterfaceMap `json:"Args"` }
func GetFunctionInfo ¶
func (*Function) Export ¶
Export is a function that is used to export the function to a json file These files are used in the main editor to determine inputs needed to call a function in a scene
func (*Function) GetArgs ¶
func (f *Function) GetArgs() *NFData.NFInterfaceMap
func (*Function) Register ¶
func (f *Function) Register(handler functionHandler)
Register adds a custom function to the Functions map
func (*Function) Run ¶
func (f *Function) Run(window fyne.Window, newValues *NFData.NFInterfaceMap) (*NFData.NFInterfaceMap, error)
func (*Function) SetAndCheckArgs ¶
func (f *Function) SetAndCheckArgs(args *NFData.NFInterfaceMap) error
SetAndCheckArgs sets the arguments and checks if the function has all the required arguments
func (*Function) SetArgs ¶
func (f *Function) SetArgs(args *NFData.NFInterfaceMap)
Click to show internal directories.
Click to hide internal directories.