Documentation ¶
Index ¶
- Variables
- func InitLogger(cfg *Config) io.Writer
- func InitMiddlewares(cfg *Config, writer io.Writer) []gin.HandlerFunc
- func NewGinEngine(ctgHdr *ctgHandler.CategoryHandler, cmtHdr *commentHandler.CommentHandler, ...) (*gin.Engine, error)
- func NewMongoDB(cfg *Config) *mongo.Database
- type Config
- type GinConfig
- type LoggerConfig
- type MongodbConfig
- type SystemConfig
- type Validators
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CategoryProviders = wire.NewSet(handler.NewCategoryHandler, service.NewCategoryService, repository.NewCategoryRepository, dao.NewCategoryDao, wire.Bind(new(service.ICategoryService), new(*service.CategoryService)), wire.Bind(new(repository.ICategoryRepository), new(*repository.CategoryRepository)), wire.Bind(new(dao.ICategoryDao), new(*dao.CategoryDao)), ) CommentProviders = wire.NewSet(handler2.NewCommentHandler, service2.NewCommentService, repository2.NewCommentRepository, dao2.NewCommentDao, wire.Bind(new(service2.ICommentService), new(*service2.CommentService)), wire.Bind(new(repository2.ICommentRepository), new(*repository2.CommentRepository)), wire.Bind(new(dao2.ICommentDao), new(*dao2.CommentDao))) ConfigProviders = wire.NewSet(handler3.NewConfigHandler, service3.NewConfigService, repository3.NewConfigRepository, dao3.NewConfigDao, wire.Bind(new(service3.IConfigService), new(*service3.ConfigService)), wire.Bind(new(repository3.IConfigRepository), new(*repository3.ConfigRepository)), wire.Bind(new(dao3.IConfigDao), new(*dao3.ConfigDao))) FriendProviders = wire.NewSet(handler4.NewFriendHandler, service4.NewFriendService, repository4.NewFriendRepository, dao4.NewFriendDao, wire.Bind(new(service4.IFriendService), new(*service4.FriendService)), wire.Bind(new(repository4.IFriendRepository), new(*repository4.FriendRepository)), wire.Bind(new(dao4.IFriendDao), new(*dao4.FriendDao))) PostProviders = wire.NewSet(handler5.NewPostHandler, service5.NewPostService, repository5.NewPostRepository, dao5.NewPostDao, wire.Bind(new(service5.IPostService), new(*service5.PostService)), wire.Bind(new(repository5.IPostRepository), new(*repository5.PostRepository)), wire.Bind(new(dao5.IPostDao), new(*dao5.PostDao))) VlProviders = wire.NewSet(handler6.NewVisitLogHandler, service6.NewVisitLogService, repository6.NewVisitLogRepository, dao6.NewVisitLogDao, wire.Bind(new(service6.IVisitLogService), new(*service6.VisitLogService)), wire.Bind(new(repository6.IVisitLogRepository), new(*repository6.VisitLogRepository)), wire.Bind(new(dao6.IVisitLogDao), new(*dao6.VisitLogDao))) EmailProviders = wire.NewSet(service7.NewEmailService, wire.Bind(new(service7.IEmailService), new(*service7.EmailService))) MsgProviders = wire.NewSet(service8.NewMessageService, wire.Bind(new(service8.IMessageService), new(*service8.MessageService))) MsgTplProviders = wire.NewSet(handler7.NewMsgTplHandler, service9.NewMsgTplService, repository7.NewMsgTplRepository, dao7.NewMsgTplDao, wire.Bind(new(service9.IMsgTplService), new(*service9.MsgTplService)), wire.Bind(new(repository7.IMsgTplRepository), new(*repository7.MsgTplRepository)), wire.Bind(new(dao7.IMsgTplDao), new(*dao7.MsgTplDao))) )
Functions ¶
func InitLogger ¶
func InitMiddlewares ¶
func InitMiddlewares(cfg *Config, writer io.Writer) []gin.HandlerFunc
func NewGinEngine ¶
func NewGinEngine(ctgHdr *ctgHandler.CategoryHandler, cmtHdr *commentHandler.CommentHandler, cfgHdr *cfgHandler.ConfigHandler, frdHdr *friendHanlder.FriendHandler, postHdr *postHanlder.PostHandler, vlHdr *vlHandler.VisitLogHandler, msgTplHandler *handler.MsgTplHandler, middleware []gin.HandlerFunc, validators Validators) (*gin.Engine, error)
func NewMongoDB ¶
Types ¶
type Config ¶
type Config struct { System SystemConfig `json:"system" yaml:"system"` Gin GinConfig `json:"gin" yaml:"gin"` Logger LoggerConfig `json:"logger" yaml:"logger"` MongoDb MongodbConfig `json:"mongo_db" yaml:"mongo_db"` }
func InitConfig ¶
type LoggerConfig ¶
type LoggerConfig struct { Filename string `json:"file_name" yaml:"file_name"` MaxSize int `json:"max_size" yaml:"max_size"` MaxAge int `json:"max_age" yaml:"max_age"` MaxBackups int `json:"max_backups" yaml:"max_backups"` LocalTime bool `json:"local_time" yaml:"local_time"` Compress bool `json:"compress" yaml:"compress"` Level string `json:"level" yaml:"level"` TimeFormat string `json:"time_format" yaml:"time_format"` }
type MongodbConfig ¶
type SystemConfig ¶
type SystemConfig struct {
StaticPath string `json:"static_path" yaml:"static_path"`
}
type Validators ¶
func InitGinValidators ¶
func InitGinValidators() Validators
Click to show internal directories.
Click to hide internal directories.