Skip to content
Snippets Groups Projects
Select Git revision
  • 1613e3ea5bd2dae11ab03ccf6d1d5ab853f8bf7d
  • master default protected
2 results

struct.go

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    struct.go 1.24 KiB
    package assignment1
    
    // Country struct: json values for a country and its species
    type Country struct {
    	Code        string   `json:"alpha2Code"`
    	Countryname string   `json:"name"`
    	Countryflag string   `json:"flag"`
    	Species     []string `json:"species"`
    	SpeciesKey  []int    `json:"speciesKey"`
    }
    
    // Both struct: json values for species and speciesKey
    type Both struct {
    	Species    string `json:"species"`
    	SpeciesKey int    `json:"speciesKey"`
    }
    
    // Results struct: json value for result and contains both species and speciesKey
    type Results struct {
    	Result []Both `json:"results"`
    }
    
    // Species struct: json values for one specific species
    type Species struct {
    	Key            int    `json:"key"`
    	Kingdom        string `json:"kingdom"`
    	Phylum         string `json:"phylum"`
    	Order          string `json:"order"`
    	Family         string `json:"family"`
    	Genus          string `json:"genus"`
    	ScientificName string `json:"scientificName"`
    	CanonicalName  string `json:"canonicalName"`
    	Year           string `json:"year"`
    }
    
    // Year struct: json value for a species discovery year
    type Year struct {
    	Year string `json:"bracketYear"`
    }
    
    // Diag struct:
    type Diag struct {
    	Gbif          int
    	Restcountries int
    	Version       string
    	Uptime        float64
    }