📋
Eather
  • Eather
  • Module Development
    • Create new Module
    • Empty Module
    • Installable
    • Upgradable
    • Routable
    • Eventable
    • Cronable
    • Callable
Powered by GitBook
On this page

Was this helpful?

  1. Module Development

Empty Module

Create etc directory with module.xml

<?xml version="1.0" encoding="UTF-8"?>
<module>
    <name>Empty</name>
    <version>1.0.0</version>
</module>

Name is used for defining a name for module and version for versioning.

Create ./config/modules.xml and set module to enabled.

<?xml version="1.0" encoding="UTF-8"?>
<modules>
    <module>
        <name>Empty</name>
        <enabled>true</enabled>
    </module>
</modules>

Create main.go with function called same as name of module which should return module itself and error.

package main

import (
	"github.com/EatherGo/eather"
)

type module struct{}

// Empty to export in plugin
func Empty() (f eather.Module, err error) {
	f = module{}
	return
}

Run your application and you should see this output.

Module Empty is not builded. Building...
Module Empty was builded
Module Empty is running 

Now your Empty module is running!

PreviousCreate new ModuleNextInstallable

Last updated 5 years ago

Was this helpful?