models

package
v0.0.0-...-eed3b6a Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accelero

type Accelero struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
	Z float64 `json:"z"`
}

type Alarm

type Alarm struct {
	AlarmRecord
	Zone        Zone         `json:"zone" doc:"The zone for which this alarm is."`
	Interaction *Interaction `json:"interaction,omitempty" doc:"The optional interaction that initiated the creation of this alarm."`
	Detection   *Detection   `json:"detection,omitempty" doc:"The optional detection that initiated the creation of this alarm."`
	Animal      *Animal      `json:"animal,omitempty" doc:"The optional animal that initiated the creation of this alarm."`
	Conveyances []Conveyance `json:"conveyances" doc:"The conveyances that were created for this alarm."`
}

type AlarmRecord

type AlarmRecord struct {
	ID            string    `json:"ID" format:"uuid" doc:"The ID of this alarm."`
	Timestamp     time.Time `json:"timestamp" format:"date-time" doc:"The moment this alarm was created."`
	ZoneID        string    `json:"-"`
	InteractionID *string   `json:"-"`
	DetectionID   *string   `json:"-"`
	AnimalID      *string   `json:"-"`
}

type Animal

type Animal struct {
	AnimalRecord
	Species           Species    `json:"species" doc:"The species of this animal"`
	Location          *Point     `json:"location,omitempty" readOnly:"true" doc:"The location of this animal"`
	LocationTimestamp *time.Time `` /* 132-byte string literal not displayed */
}

type AnimalRecord

type AnimalRecord struct {
	ID        string `json:"ID" format:"uuid" readOnly:"true" doc:"The ID of this animal."`
	Name      string `json:"name" doc:"The name of this animal."`
	SpeciesID string `json:"speciesID,omitempty" format:"uuid" writeOnly:"true" required:"true" doc:"The ID of the species of this animal."`
}

type Answer

type Answer struct {
	AnswerRecord
}

type AnswerRecord

type AnswerRecord struct {
	ID             string  `json:"ID" format:"uuid" readOnly:"true" doc:"The ID of this answer."`
	Text           string  `json:"text" doc:"The text of this answer."`
	Index          int     `` /* 205-byte string literal not displayed */
	QuestionID     string  `` /* 127-byte string literal not displayed */
	NextQuestionID *string `` /* 165-byte string literal not displayed */
}

type BorneSensorDeployment

type BorneSensorDeployment struct {
	BorneSensorDeploymentRecord
	Animal Animal `json:"animal" doc:"The animal that bears this sensor."`
}

type BorneSensorDeploymentRecord

type BorneSensorDeploymentRecord struct {
	AnimalID string     `json:"animalID,omitempty" format:"uuid" writeOnly:"true" required:"true" doc:"The ID of the animal that bears this sensor."`
	SensorID string     `json:"sensorID" doc:"The ID of the borne sensor."`
	Start    time.Time  `json:"start" format:"date-time" doc:"The moment this deployment started."`
	End      *time.Time `json:"end" format:"date-time" required:"false" readOnly:"true" doc:"The moment this deployment finished."`
}

type BorneSensorReading

type BorneSensorReading struct {
	BorneSensorReadingRecord
	UserID string `json:"userID" doc:"The ID of the data system that provided this reading."`
}

type BorneSensorReadingRecord

type BorneSensorReadingRecord struct {
	SensorID    string    `json:"sensorID" doc:"The ID of the borne sensor."`
	Timestamp   time.Time `json:"timestamp" format:"date-time" doc:"The moment that this reading was done."`
	Location    *Point    `json:"location,omitempty" doc:"The value read by the location sensor."`
	Altitude    *float64  `json:"altitude,omitempty" doc:"The value read by the altitude sensor."`
	Temperature *float64  `json:"temperature,omitempty" doc:"The value read by the temperature sensor in degrees Celsius."`
	Accelero    *Accelero `json:"accelero,omitempty" doc:"The values read by the accelerometer."`
}

type Circle

type Circle struct {
	Location Point   `json:"location"`
	Radius   float64 `json:"radius" minimum:"1" doc:"The radius in meters."`
}

func (*Circle) Scan

func (c *Circle) Scan(value interface{}) error

func (Circle) Value

func (c Circle) Value() (driver.Value, error)

type Conveyance

type Conveyance struct {
	ID        string    `json:"ID" format:"uuid" readOnly:"true" doc:"The ID of this conveyance."`
	Timestamp time.Time `json:"timestamp" format:"date-time" doc:"The moment this conveyance was created."`
	User      User      `json:"user" doc:"The user this conveyance is for."`
	Message   Message   `json:"message" doc:"The message associated with this conveyance."`
	Animal    *Animal   `json:"animal,omitempty" doc:"The encountered animal, in case this conveyance was created for an encounter."`
	Response  *Response `json:"response,omitempty" doc:"The given response, in case this conveyance was created for a response."`
	Alarm     *Alarm    `json:"alarm,omitempty" doc:"The alarm, in case this conveyance was created for an alarm."`
}

type Credential

type Credential struct {
	UserID    string    `json:"userID" format:"uuid" doc:"The ID of the user this credential belongs to."`
	Email     string    `json:"email" format:"email" doc:"The email address associated with this credential."`
	Token     string    `json:"token" format:"uuid" doc:"The bearer token associated with this credential."`
	Scopes    []string  `json:"scopes" doc:"The scopes that can be used with this credential."`
	LastLogon time.Time `json:"lastLogon" format:"date-time" doc:"The last time this credential was used to log on."`
}

type Detection

type Detection struct {
	DetectionRecord
	Species Species `json:"species" doc:"The species of the detected animal."`
}

type DetectionRecord

type DetectionRecord struct {
	ID        int       `json:"-"`
	SensorID  string    `json:"sensorID" doc:"The identification for the sensor that detected the animal."`
	Location  Point     `json:"location" doc:"The location that the animal was detected at."`
	Timestamp time.Time `json:"timestamp" format:"date-time" doc:"The moment the animal was detected."`
	SpeciesID string    `json:"speciesID" format:"uuid" writeOnly:"true" required:"true" doc:"The ID of the species of the detected animal."`
}

type Experiment

type Experiment struct {
	ExperimentRecord
	User                   User       `json:"user" doc:"The User that created this experiment."`
	LivingLab              *LivingLab `json:"livingLab,omitempty" doc:"The livingLab this experiment is bound to."`
	NumberOfQuestionnaires *int       `json:"numberOfQuestionnaires,omitempty" doc:"The number of questionnaires associated with this experiment."`
	NumberOfMessages       *int       `json:"numberOfMessages,omitempty" doc:"The number of messages associated with this experiment."`
	QuestionnaireActivity  *int       `json:"questionnaireActivity,omitempty" doc:"The number of questionnaires with at least one response."`
	MessageActivity        *int       `json:"messageActivity,omitempty" doc:"The number of conveyances."`
}

type ExperimentRecord

type ExperimentRecord struct {
	ID          string     `json:"ID" format:"uuid" readOnly:"true" doc:"The ID of this experiment."`
	Name        string     `json:"name" doc:"The name of this experiment."`
	Description string     `json:"description" doc:"The description of this experiment."`
	Start       time.Time  `json:"start" format:"date-time" doc:"The moment this experiment started."`
	End         *time.Time `json:"end,omitempty" format:"date-time" doc:"The moment this experiment ended."`
	LivingLabID *string    `` /* 128-byte string literal not displayed */
}

type Interaction

type Interaction struct {
	InteractionRecord
	Species       Species         `json:"species" doc:"The species of the animal that this interaction was with."`
	User          User            `json:"user" doc:"The User that reported this interaction."`
	Type          InteractionType `json:"type" doc:"The type of the interaction."`
	Questionnaire *Questionnaire  `json:"questionnaire,omitempty" doc:"The questionnaire the user should fill-out after having added the interaction."`
}

type InteractionRecord

type InteractionRecord struct {
	ID          string    `json:"ID" format:"uuid" readOnly:"true" doc:"The ID of this interaction."`
	Timestamp   time.Time `json:"timestamp" format:"date-time" doc:"The moment this interaction was reported."`
	Description string    `json:"description" doc:"The description of this interaction."`
	SpeciesID   string    `` /* 131-byte string literal not displayed */
	Location    Point     `json:"location" doc:"The place where the interaction was reported."`
	TypeID      int       `` /* 127-byte string literal not displayed */
}

type InteractionType

type InteractionType struct {
	ID          int    `json:"ID" readOnly:"true" minimum:"1" doc:"The ID of this interaction type."`
	Name        string `json:"name" doc:"The name of this interaction type."`
	Description string `json:"description" doc:"The description of this interaction type."`
}

type LivingLab

type LivingLab struct {
	ID         string  `json:"ID" format:"uuid" readOnly:"true" doc:"The ID of this living lab."`
	Name       string  `json:"name" doc:"The name of this living lab."`
	Definition Polygon `json:"definition" doc:"The polygon describing the area of this living lab."`
}

type Message

type Message struct {
	MessageRecord
	Experiment Experiment `json:"experiment" doc:"The experiment that this questionnaire belongs to."`
	Species    *Species   `json:"species,omitempty" doc:"The optional species this message is associated with."`
	Answer     *Answer    `json:"answer,omitempty" doc:"The optional answer this message is associated with."`
	Activity   *int       `json:"activity,omitempty" doc:"The number of conveyances."`
}

type MessageRecord

type MessageRecord struct {
	ID               string  `json:"ID" format:"uuid" readOnly:"true" doc:"The ID for this message."`
	Name             string  `json:"name" doc:"The name of this message."`
	Severity         int     `` /* 128-byte string literal not displayed */
	Text             string  `json:"text" doc:"The text of this message."`
	ExperimentID     string  `` /* 132-byte string literal not displayed */
	Trigger          string  `json:"trigger" enum:"encounter,answer,alarm" doc:"The trigger type for this message."`
	SpeciesID        *string `` /* 127-byte string literal not displayed */
	AnswerID         *string `json:"answerID,omitempty" format:"uuid" writeOnly:"true" doc:"The optional ID of the answer this message is associated with."`
	EncounterMeters  *int    `` /* 205-byte string literal not displayed */
	EncounterMinutes *int    `` /* 183-byte string literal not displayed */
}

type Point

type Point struct {
	Latitude  float64 `json:"latitude" minimum:"-90" maximum:"90"`
	Longitude float64 `json:"longitude" minimum:"-180" maximum:"180"`
}

func (*Point) Scan

func (p *Point) Scan(value interface{}) error

func (Point) Value

func (p Point) Value() (driver.Value, error)

type Polygon

type Polygon []Point

func (*Polygon) Scan

func (p *Polygon) Scan(value interface{}) error

func (Polygon) Value

func (p Polygon) Value() (driver.Value, error)

type Profile

type Profile struct {
	ProfileRecord
	Roles             []Role     `json:"roles,omitempty" doc:"The additional roles this user has."`
	Location          *Point     `json:"location,omitempty" readOnly:"true" doc:"The location of this user."`
	LocationTimestamp *time.Time `` /* 130-byte string literal not displayed */
}

type ProfileRecord

type ProfileRecord struct {
	User
	Email       string  `json:"email" format:"email" readOnly:"true" doc:"The email address of this user."`
	DateOfBirth *string `json:"dateOfBirth,omitempty" format:"date" doc:"The date of birth of this user."`
	Gender      *string `json:"gender,omitempty" enum:"female,male,other" doc:"The gender of this user."`
	Postcode    *string `json:"postcode,omitempty" doc:"The postcode of this user."`
	Description *string `json:"description,omitempty" doc:"The description of this user."`
}

type Question

type Question struct {
	QuestionRecord
	Answers []Answer `json:"answers,omitempty" doc:"The selectable answers for this questions."`
}

type QuestionRecord

type QuestionRecord struct {
	ID                    string  `json:"ID" format:"uuid" readOnly:"true" doc:"The ID of this question."`
	Text                  string  `json:"text" doc:"The text of this question."`
	Description           string  `json:"description" doc:"The further explanation for this questions."`
	Index                 int     `` /* 215-byte string literal not displayed */
	AllowMultipleResponse bool    `json:"allowMultipleResponse" doc:"Whether or not this questions allows for multiple reponses."`
	AllowOpenResponse     bool    `json:"allowOpenResponse" doc:"Whether or not this question allows for a response to contain a free format text."`
	OpenResponseFormat    *string `` /* 186-byte string literal not displayed */
	QuestionnaireID       string  `` /* 140-byte string literal not displayed */
}

type Questionnaire

type Questionnaire struct {
	QuestionnaireRecord
	Experiment      Experiment      `json:"experiment" doc:"The experiment that this questionnaire belongs to."`
	InteractionType InteractionType `json:"interactionType" doc:"The type of interactions that this questionnaire is created for."`
	Questions       []Question      `json:"questions,omitempty" doc:"The questions of this questionnaire"`
}

type QuestionnaireRecord

type QuestionnaireRecord struct {
	ID                string  `json:"ID" format:"uuid" readOnly:"true" doc:"The ID of this questionnaire."`
	Name              string  `json:"name" doc:"The name of this questionnaire."`
	Identifier        *string `json:"identifier,omitempty" doc:"An optional questionnaire identifier for internal use."`
	ExperimentID      string  `` /* 145-byte string literal not displayed */
	InteractionTypeID int     `` /* 154-byte string literal not displayed */
}

type Response

type Response struct {
	ResponseRecord
	Question    Question    `json:"question" doc:"The question this response is for."`
	Interaction Interaction `json:"interaction" doc:"The interaction this response belongs to."`
	Answer      *Answer     `json:"answer" doc:"The answer that was selected for this response."`
	Conveyance  *Conveyance `json:"conveyance,omitempty" doc:"The optional conveyance of a message that should be displayed to the user."`
}

type ResponseRecord

type ResponseRecord struct {
	ID            string  `json:"ID" format:"uuid" readOnly:"true" doc:"The ID of this response."`
	Text          *string `json:"text,omitempty" doc:"The free format text that the user added to this response."`
	QuestionID    string  `json:"questionID,omitempty" format:"uuid" writeOnly:"true" required:"true" doc:"The ID of the question this response is for."`
	InteractionID string  `` /* 135-byte string literal not displayed */
	AnswerID      *string `json:"answerID,omitempty" format:"uuid" writeOnly:"true" doc:"The ID of the answer that was selected for this response."`
}

type Role

type Role struct {
	ID   int    `json:"ID" minimum:"1" doc:"The ID of this role."`
	Name string `json:"name" doc:"The name of this role"`
}

type Species

type Species struct {
	ID         string  `json:"ID" format:"uuid" readOnly:"true" doc:"The ID of this species."`
	Name       string  `json:"name" doc:"The Latin binomen of this species."`
	CommonName string  `json:"commonName" doc:"The common name of this species."`
	Category   *string `json:"category,omitempty" doc:"The animal category for this species."`
	Advice     *string `json:"advice,omitempty" doc:"The advice on how to interact with this species."`
	DidYouKnow *string `json:"didYouKnow,omitempty" doc:"A nice info text on this species."`
}

type TrackingReading

type TrackingReading struct {
	TrackingReadingRecord
	Conveyance *Conveyance `json:"conveyance,omitempty" doc:"The optional conveyance of a message that should be displayed to the user."`
}

type TrackingReadingRecord

type TrackingReadingRecord struct {
	UserID    string    `json:"userID" format:"uuid" readOnly:"true" doc:"The ID of the user this reading belongs to."`
	Timestamp time.Time `json:"timestamp" format:"date-time" doc:"The moment that this reading was done."`
	Location  Point     `json:"location" doc:"The value read by the location sensor."`
}

type User

type User struct {
	ID   string `json:"ID" format:"uuid" readOnly:"true" doc:"The ID of this user."`
	Name string `json:"name" doc:"The display name of this user."`
}

type Zone

type Zone struct {
	ZoneRecord
	Deactivated *time.Time `json:"deactivated,omitempty" doc:"The moment this zone record was deactivated."`
	User        User       `json:"user" doc:"The user that added this Zone."`
	Species     []Species  `json:"species,omitempty" doc:"The species for which this zone creates alarms."`
}

type ZoneRecord

type ZoneRecord struct {
	ID          string    `json:"ID" format:"uuid" readOnly:"true" doc:"The ID of this Zone."`
	Created     time.Time `json:"created" readOnly:"true" doc:"The moment this zone was created."`
	Name        string    `json:"name" doc:"The name of this Zone."`
	Description string    `json:"description" doc:"A description for this Zone."`
	Area        Circle    `json:"area" doc:"The geographic circle that defines this Zone."`
}

Jump to

Keyboard shortcuts

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