This repository has been archived on 2025-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
bactdb/payloads/species.go
Matthew Dillon efb0cc13fa Golint
2015-10-05 10:34:21 -07:00

33 lines
841 B
Go

package payloads
import (
"encoding/json"
"github.com/thermokarst/bactdb/models"
)
// Species is a payload that sideloads all of the necessary entities for a
// particular species.
type Species struct {
Species *models.Species `json:"species"`
Strains *models.Strains `json:"strains"`
Meta *models.SpeciesMeta `json:"meta"`
}
// ManySpecies is a payload that sideloads all of the necessary entities for
// multiple species.
type ManySpecies struct {
Species *models.ManySpecies `json:"species"`
Strains *models.Strains `json:"strains"`
Meta *models.SpeciesMeta `json:"meta"`
}
// Marshal satisfies the CRUD interfaces.
func (s *Species) Marshal() ([]byte, error) {
return json.Marshal(s)
}
// Marshal satisfies the CRUD interfaces.
func (s *ManySpecies) Marshal() ([]byte, error) {
return json.Marshal(s)
}