Browse Source

Modules template

Vova Tkach 6 years ago
parent
commit
4e1db2aa05
1 changed files with 17 additions and 2 deletions
  1. 17 2
      modules/modules.go

+ 17 - 2
modules/modules.go

@@ -1,20 +1,35 @@
 package modules
 package modules
 
 
 import (
 import (
+	"fmt"
+
 	"golang-fave/engine/wrapper"
 	"golang-fave/engine/wrapper"
 )
 )
 
 
+type FuncFrontEnd func(wrap *wrapper.Wrapper)
+type FuncBackEnd func(wrap *wrapper.Wrapper)
+
+type Module struct {
+	Id       string
+	Name     string
+	FrontEnd FuncFrontEnd
+	BackEnd  FuncBackEnd
+}
+
 type Modules struct {
 type Modules struct {
-	//
+	list map[string]Module
 }
 }
 
 
 func New() *Modules {
 func New() *Modules {
-	m := Modules{}
+	m := Modules{
+		list: map[string]Module{},
+	}
 	return &m
 	return &m
 }
 }
 
 
 func (this *Modules) Load() {
 func (this *Modules) Load() {
 	// Called before server starts
 	// Called before server starts
+	fmt.Println("Load modules")
 }
 }
 
 
 // All actions here...
 // All actions here...