package
module
Version:
v0.0.0-...-24f41c0
Opens a new window with list of versions in this module.
Published: Dec 13, 2021
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
View Source
var (
MgoDb = "zerohero"
CollHeros = "heros"
)
DeleteOne responsavel por deletar nosso do heros
FindOne responsavel por buscar nosso do heros
type Appearance struct {
Gender string `json:"gender"`
Race string `json:"race"`
Height []string `json:"height"`
Weight []string `json:"weight"`
EyeColor string `json:"eye-color"`
HairColor string `json:"hair-color"`
}
type Biography struct {
FullName string `json:"full-name"`
AlterEgos string `json:"alter-egos"`
Aliases []string `json:"aliases"`
PlaceOfBirth string `json:"place-of-birth"`
FirstAppearance string `json:"first-appearance"`
Publisher string `json:"publisher"`
Alignment string `json:"alignment"`
}
type Connections struct {
GroupAffiliation string `json:"group-affiliation"`
Relatives string `json:"relatives"`
}
type Image struct {
URL string `json:"url"`
}
type Powerstats struct {
Intelligence string `json:"intelligence"`
Strength string `json:"strength"`
Speed string `json:"speed"`
Durability string `json:"durability"`
Power string `json:"power"`
Combat string `json:"combat"`
}
type Work struct {
Occupation string `json:"occupation"`
Base string `json:"base"`
}
type ZeroHero struct {
Response string `json:"response"`
ID string `json:"id"`
UUID string `json:"uuid,omitempty" bson:"_id"`
Name string `json:"name"`
Powerstats Powerstats `json:"powerstats"`
Biography Biography `json:"biography"`
Appearance Appearance `json:"appearance"`
Work Work `json:"work"`
Connections Connections `json:"connections"`
Image Image `json:"image"`
}
InsertOne criar doc em mongodb
criar o index para deixar unique o campo no banco
db.heros.createIndex( { "name": 1 }, { unique: true } )
UpdateOne responsavel por atualizar nosso do heros
Source Files
¶
Click to show internal directories.
Click to hide internal directories.