Skip to content
/ digi Public

A personal framework to kickstart the creation of services big and small.

Notifications You must be signed in to change notification settings

zphia/digi

Repository files navigation

Digi

This is my personal framework to be used to kickstart the creation of services with a few minimum niceties.

Example

package main

import (
	"net/http"

	"github.com/coldfgirl/digi"
	"github.com/labstack/echo/v4"
)

type example struct{}

func (e *example) Name() string {
    return "example"
}

func (e *example) Start(logger digi.Logger, i *digi.Injector) error {
	logger.Info("Inside the example!")

	web, err := i.GetWeb()
	if err != nil {
		return err
	}

	web.GET("/example", func(c echo.Context) error {
		return c.String(http.StatusOK, "Inside the handler!")
	})

	return nil
}

func (e *example) Stop() error {
	return nil
}

func main() {
	digi.NewServer().Start(&example{}).Wait()
}

About

A personal framework to kickstart the creation of services big and small.

Resources

Stars

Watchers

Forks

Releases

No releases published