dto

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DTO

type DTO interface {
	Validate() (bool, []error)
}

DTO - Defines an interface for DTOs

type Mappable

type Mappable interface {
	Map() DTO
}

Mappable - Defines an interface for a model that want translate himself to a dto

type UserDTO

type UserDTO struct {
	ID       int64       `json:"id"`
	Name     null.String `json:"name"`
	Lastname null.String `json:"lastname"`
	Gender   null.String `json:"gender"`
}

UserDTO - Defines user dto

func MapUserDTO

func MapUserDTO(m Mappable) UserDTO

MapUserDTO - Maps dto from a Mappable interface

func (UserDTO) Validate

func (u UserDTO) Validate() (bool, []error)

Validate - Valididates the user dto

Jump to

Keyboard shortcuts

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