controller

package
v0.0.0-...-116c032 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func BindAdminRoutes

func BindAdminRoutes(_ config.Type, e *echo.Echo, c *UserController)

func BindHelloRoutes

func BindHelloRoutes(e *echo.Echo, c *HelloController)

func BindValidateRoutes

func BindValidateRoutes(e *echo.Echo, c *ValidateController)

Types

type Address

type Address struct {
	Street string `validate:"required"`
	City   string `validate:"required"`
	Planet string `validate:"required"`
	Phone  string `validate:"required"`
}

Address houses a users address information

type HelloController

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

func NewHelloController

func NewHelloController(logger *zap.Logger, helloService *service.HelloService) *HelloController

func (HelloController) Ent

func (controller HelloController) Ent(c echo.Context) error

func (HelloController) Hello

func (controller HelloController) Hello(c echo.Context) error

ShowAccount godoc

@Summary		Show an account
@Description	get string by ID
@Tags			accounts
@Accept			json
@Produce		json
@Param			id	path		int	true	"Account ID"
@Success		200	{object}	types.FileDef
@Router			/hello/{id} [get]

type User

type User struct {
	FirstName      string     `validate:"required"`
	LastName       string     `validate:"required"`
	Age            uint8      `validate:"gte=0,lte=130"`
	Email          string     `validate:"required,email"`
	Gender         string     `validate:"oneof=male female prefer_not_to"`
	FavouriteColor string     `validate:"iscolor"`                // alias for 'hexcolor|rgb|rgba|hsl|hsla'
	Addresses      []*Address `validate:"required,dive,required"` // a person can have a home and cottage...
}

User contains user information

type UserController

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

func NewUserController

func NewUserController(logger *zap.Logger, userService *service.UserService) *UserController

func (UserController) Info

func (controller UserController) Info(c echo.Context) error

Info godoc

@Summary		User info
@Description	User info
@Tags			user
@Accept			json
@Produce		json
@Success		200	{object}	protocol.Response{data=types.KV}
@Router			/user/info [get]

func (UserController) Login

func (controller UserController) Login(c echo.Context) error

Login godoc

@Summary		User login
@Description	User login with username and password
@Tags			user
@Accept			json
@Produce		json
@Param			body	body		types.UserLoginRequest	true	"Login credentials"
@Success		200		{object}	protocol.Response{data=types.UserLoginResponse}
@Router			/user/login [post]

type ValidateController

type ValidateController struct {
}

func NewValidateController

func NewValidateController() *ValidateController

func (ValidateController) Validate

func (controller ValidateController) Validate(c echo.Context) error

Jump to

Keyboard shortcuts

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