factory

package
v0.6.15 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilService    = errors.New("route service cannot be nil")
	ErrNilValidator  = errors.New("route validator cannot be nil")
	ErrNilController = errors.New("route controller cannot be nil")
)

Functions

This section is empty.

Types

type Controller added in v0.6.11

type Controller struct {
	gonethttproute.RouterWrapper
}

Controller is the struct for the route controller

func (*Controller) CreateRouter added in v0.6.11

func (c *Controller) CreateRouter(
	baseRouter gonethttproute.RouterWrapper,
	path string,
) error

CreateRouter creates the controller

func (*Controller) GetRouter added in v0.6.11

func (c *Controller) GetRouter() gonethttproute.RouterWrapper

GetRouter returns the router

func (*Controller) RegisterGroups added in v0.6.11

func (c *Controller) RegisterGroups() error

RegisterGroups registers the groups

func (*Controller) RegisterRoutes added in v0.6.11

func (c *Controller) RegisterRoutes()

RegisterRoutes registers the routes

type ControllerWrapper

type ControllerWrapper interface {
	CreateRouter(baseRouter gonethttproute.RouterWrapper, path string) error
	GetRouter() gonethttproute.RouterWrapper
	RegisterRoutes()
	RegisterGroups() error
	gonethttproute.RouterWrapper
}

ControllerWrapper is the interface for the route controller

type Module

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

Module is the struct for the route module

func (*Module) Create

func (m *Module) Create(
	baseRouter gonethttproute.RouterWrapper,
) error

Create is a function that creates the router for the controller and its submodules

func (*Module) GetController added in v0.6.13

func (m *Module) GetController() ControllerWrapper

GetController is a function that returns the controller

func (*Module) GetPath added in v0.6.13

func (m *Module) GetPath() string

GetPath is a function that returns the path

func (*Module) GetRouter added in v0.6.12

func (m *Module) GetRouter() gonethttproute.RouterWrapper

GetRouter is a function that returns the router

func (*Module) GetService added in v0.6.13

func (m *Module) GetService() ServiceWrapper

GetService is a function that returns the service

func (*Module) GetSubmodules added in v0.6.15

func (m *Module) GetSubmodules() *[]ModuleWrapper

GetSubmodules is a function that returns the submodules

func (*Module) GetValidator added in v0.6.13

func (m *Module) GetValidator() ValidatorWrapper

GetValidator is a function that returns the validator

func (*Module) Handler added in v0.6.12

func (m *Module) Handler() http.Handler

Handler is a function that returns the handler

type ModuleWrapper

type ModuleWrapper interface {
	Create(baseRouter gonethttproute.RouterWrapper) error
	GetRouter() gonethttproute.RouterWrapper
	Handler() http.Handler
	GetService() ServiceWrapper
	GetValidator() ValidatorWrapper
	GetController() ControllerWrapper
	GetPath() string
	GetSubmodules() *[]ModuleWrapper
}

ModuleWrapper is the interface for the route module

func NewModule added in v0.6.11

func NewModule(
	path string,
	service ServiceWrapper,
	validator ValidatorWrapper,
	controller ControllerWrapper,
	submodules ...ModuleWrapper,
) ModuleWrapper

NewModule is a function that creates a new instance of the Module struct

type ServiceWrapper

type ServiceWrapper interface{}

ServiceWrapper is the interface for the route service

type ValidatorWrapper

type ValidatorWrapper interface {
	govalidatormappervalidator.Service
}

ValidatorWrapper is the interface for the route validator

Jump to

Keyboard shortcuts

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