plouf

package module
v0.0.0-...-cd205bd Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: MIT Imports: 6 Imported by: 0

README

Plouf

Plouf is a simple, fast, and powerful API framework for Go. Its design is based on NestJS with features like dependency injection, modules, controllers, services, and more.

The framework is powered by the most popular Go libraries to let you use already existing middlewares, documentation and support.

Major libraries used by Plouf:

Some of these libraries are abstracted by Plouf to make it easier to use.

Example file architecture

.
├── modules/
│   └── user/
│       ├── user_controller.go
│       ├── user_module.go
│       └── user_service.go
├── main_module.go
└── main.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReflectTypeName

func ReflectTypeName(i interface{}) string

func ReflectValue

func ReflectValue(i interface{}) reflect.Value

func ValidateAndBind

func ValidateAndBind(c echo.Context, value interface{}) error

Types

type Controller

type Controller struct {
	Injectable
}

func (Controller) Init

func (c Controller) Init(self IInjectable) error

func (Controller) ShouldLogInjection

func (c Controller) ShouldLogInjection(self IInjectable) bool

type DTOValidator

type DTOValidator struct {
	// contains filtered or unexported fields
}

func NewDTOValidator

func NewDTOValidator() *DTOValidator

func (*DTOValidator) Validate

func (cv *DTOValidator) Validate(i interface{}) error

type IController

type IController interface {
	IInjectable

	InitRoutes(e *echo.Echo)
}

type IInjectable

type IInjectable interface {
	Init(self IInjectable) error

	ShouldLogInjection(self IInjectable) bool
	IsInitialized() bool
}

type IModule

type IModule interface {
	IInjectable

	InitControllersRoutes(self IInjectable, e *echo.Echo) error
}

type IService

type IService interface {
	IInjectable
}

type Injectable

type Injectable struct {
	// contains filtered or unexported fields
}

func (*Injectable) Init

func (i *Injectable) Init(self IInjectable) error

func (*Injectable) IsInitialized

func (i *Injectable) IsInitialized() bool

func (*Injectable) ShouldLogInjection

func (i *Injectable) ShouldLogInjection(self IInjectable) bool

type Module

type Module struct {
	Injectable
}

func (Module) Init

func (m Module) Init(self IInjectable) error

func (Module) InitControllersRoutes

func (m Module) InitControllersRoutes(self IInjectable, e *echo.Echo) error

func (Module) ShouldLogInjection

func (m Module) ShouldLogInjection(self IInjectable) bool

type Service

type Service struct {
	Injectable
}

func (Service) Init

func (s Service) Init(self IInjectable) error

func (Service) ShouldLogInjection

func (s Service) ShouldLogInjection(self IInjectable) bool

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(mainModule IModule) (*Worker, error)

func (*Worker) Inject

func (w *Worker) Inject(injectable IInjectable) error

func (*Worker) Start

func (w *Worker) Start(address string) error

type WorkerMock

type WorkerMock struct {
	*Worker
}

func NewWorkerMock

func NewWorkerMock(mainModule IModule) (*WorkerMock, error)

func (*WorkerMock) NewContext

func (w *WorkerMock) NewContext(req *http.Request, res http.ResponseWriter) echo.Context

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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