core
core for go services
simple
config.yaml
env: dev
log: /tmp/log
debug:
addr: localhost:8888
main.go
package main
import (
"github.com/deweppro/core/application"
"github.com/deweppro/core/providers/debug"
"github.com/deweppro/core/providers/logger"
"github.com/sirupsen/logrus"
)
type Simple struct{}
func NewSimple(_ *logger.Logger) *Simple {
logrus.Info("Init Simple")
return &Simple{}
}
func (s *Simple) Start() error {
logrus.Info("Start Simple")
return nil
}
func (s *Simple) Stop() error {
logrus.Info("Stop Simple")
return nil
}
func main() {
application.New(
"config.yaml",
application.NewInterfaces().Add(
&logger.ConfigLog{},
&debug.ConfigDebug{},
),
application.NewInterfaces().Add(
NewSimple,
logger.MustNew,
debug.New,
),
).Run()
}