dtos

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CharacterToResponse

func CharacterToResponse(in *Character, out *mongo.InsertOneResult, now time.Time) *models.Character

func CharacterToSave

func CharacterToSave(in *Character) *models.NewCharacter

func CharacterToUpdate

func CharacterToUpdate(in *CharacterUpdate) *models.UpdateCharacter

Types

type Character

type Character struct {
	Name    string  `json:"name"`
	Status  *string `json:"status,omitempty"`
	Species *string `json:"species,omitempty"`
	Type    *string `json:"type,omitempty"`
	Gender  *string `json:"gender,omitempty"`
}

type CharacterPaginationResponse

type CharacterPaginationResponse struct {
	Info   PaginationInfo      `json:"info"`
	Result []*models.Character `json:"result,omitempty"`
}

func CharacterToPagination

func CharacterToPagination(characters []*models.Character, info, page, limit int64, url, search string) *CharacterPaginationResponse

type CharacterUpdate

type CharacterUpdate struct {
	Name    *string `json:"name,omitempty"`
	Status  *string `json:"status,omitempty"`
	Species *string `json:"species,omitempty"`
	Type    *string `json:"type,omitempty"`
	Gender  *string `json:"gender,omitempty"`
}

type PaginationInfo

type PaginationInfo struct {
	Count int64  `json:"count"`
	Pages int64  `json:"pages"`
	Next  string `json:"next"`
	Prev  string `json:"prev"`
}

type Response

type Response struct {
	Message   *string           `json:"message,omitempty"`
	Character *models.Character `json:"character,omitempty"`
}

type TeamRequest

type TeamRequest struct {
	Name  string `json:"name"`
	Pages int64  `json:"pages"`
	Limit *int64 `json:"limit,omitempty"`
}

Jump to

Keyboard shortcuts

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