model

package
v0.0.0-...-37d92c4 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Paciente

type Paciente struct {
	ID             primitive.ObjectID     `json:"_id,omitempty" bson:"_id,omitempty"`
	Nombre         string                 `json:"nombre,omitempty" bson:"nombre,omitempty"`
	Apellido       string                 `json:"apellido,omitempty" bson:"apellido,omitempty"`
	Identificacion string                 `json:"identificacion,omitempty" bson:"identificacion,omitempty"`
	Prestador      string                 `json:"prestador,omitempty" bson:"prestador,omitempty"`
	Afiliado       string                 `json:"afiliado,omitempty" bson:"afiliado,omitempty"`
	Data           map[string]interface{} `json:"data,omitempty" bson:"data,omitempty"` // data opcional cualquier key:value

}

func NewPaciente

func NewPaciente(nombre, apellido, prestador, afiliado string, data map[string]interface{}) *Paciente

type PaginatedResponse

type PaginatedResponse struct {
	Count    int         `json:"count"`
	Next     string      `json:"next"`
	Previous string      `json:"previous"`
	Results  interface{} `json:"results"`
}

PaginatedResponse is the paginated response json schema we not use it yet

type Person

type Person struct {
	ID        primitive.ObjectID     `json:"_id,omitempty" bson:"_id,omitempty"`
	FirstName string                 `json:"first_name,omitempty" bson:"first_name,omitempty"`
	LastName  string                 `json:"last_name,omitempty" bson:"last_name,omitempty"`
	Username  string                 `json:"username,omitempty" bson:"username,omitempty"`
	Email     string                 `json:"email,omitempty" bson:"email,omitempty"`
	Data      map[string]interface{} `json:"data,omitempty" bson:"data,omitempty"` // data is a optional fields that can hold anything in key:value format.
}

Person is the data structure that we will save and receive.

func NewPerson

func NewPerson(firstName, lastName, userName, email string, data map[string]interface{}) *Person

NewPerson will return a Person{} instance, Person structure factory function

type Response

type Response struct {
	Status  int         `json:"status"`
	Message string      `json:"message"`
	Content interface{} `json:"content"`
}

Response is the http json response schema

func NewPaginatedResponse

func NewPaginatedResponse(status, count int, message, next, prev string, results interface{}) *Response

NewPaginatedResponse will created http paginated response

func NewResponse

func NewResponse(status int, message string, content interface{}) *Response

NewResponse is the Response struct factory function.

Jump to

Keyboard shortcuts

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