github.com/abolfazlbeh/zhycan@v0.0.0-20230819144214-24cf38237387/cmd/cmd_main/commands/templates/app.app.gotmpl (about)

     1  /*
     2  Create By Zhycan Framework
     3  
     4  Copyright © {{.Year}}
     5  Project: {{.ProjectName}}
     6  File: `app/app.go` --> {{ .Time.Format .TimeFormat }} by {{.CreatorUserName}}
     7  ------------------------------
     8  */
     9  
    10  package app
    11  
    12  import (
    13      "github.com/abolfazlbeh/zhycan/pkg/engine"
    14  )
    15  
    16  // MARK: App Engine
    17  
    18  // App - application engine structure that must satisfy one of the engine interface such as 'engine.RestfulApp', ...
    19  type App struct {}
    20  
    21  // Init - initialize the app
    22  func (app *App) Init() {
    23      err := engine.RegisterRestfulController(&SampleController{Name: "sample"})
    24      if err != nil {
    25          logger.Log(logger.NewLogObject(
    26              logger.ERROR, "App.Init", logger.FuncMaintenanceType, time.Now().UTC(), "Cannot Register Restful Controller", err))
    27      }
    28  }