Whenever I need to have a set of functions specific to a module in the private table, I usually have a table specifically for the module and store it within the private table. This would produce something like the following.
Module1
Code:
local name,addon=...;
local module={};-- Create module table
addon.Module1=module;-- This stores our local module table as "Module1" of the addon table
module.Variable="Some value";
function module.Enable()
-- Enable module here
end
function module.Disable()
-- Disable module here (if you want to be able to)
end
function module.DoSomething()
-- Any other stuff you want to do
end
Core
Code:
local name,addon=...;
addon.Module1.Enable();-- Enable Module1
Note you can use the private table like any other table and being shared among all Lua files of your addon opens it up to easily be used to create an internal API in whatever structure you want.