github.com/zly-app/zapp@v1.3.3/core/service.go (about)

     1  /*
     2  -------------------------------------------------
     3     Author :       zlyuancn
     4     date:         2020/7/21
     5     Description :
     6  -------------------------------------------------
     7  */
     8  
     9  package core
    10  
    11  // 服务
    12  type IService interface {
    13  	// 注入, 根据服务不同具有不同作用, 具体参考服务实现说明
    14  	Inject(a ...interface{})
    15  	// 开始服务
    16  	Start() error
    17  	// 关闭服务
    18  	Close() error
    19  }
    20  
    21  // 服务建造者
    22  type IServiceCreator interface {
    23  	// 创建服务
    24  	Create(app IApp) IService
    25  }
    26  
    27  // 服务类型
    28  type ServiceType string