core

module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2020 License: GPL-3.0

README

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()
}

Directories

Path Synopsis
providers
utils
ssh

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL