objects

package
v0.0.0-...-c739cb8 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	Type        string    `json:"type" bson:"type"`
	Coordinates []float64 `json:"coordinates" bson:"coordinates"`
}

Location is a GeoJSON type.

func NewLocation

func NewLocation(long, lat float64) Location

NewLocation returns a GeoJSON Point with longitude and latitude.

func (*Location) Validate

func (l *Location) Validate() error

Validate validates a location

type Tree

type Tree struct {
	ID       primitive.ObjectID `json:"id,omitempty" bson:"_id"`
	TaggedBy string             `json:"tagged_by,omitempty" bson:"tagged_by"`
	TaggedAt *time.Time         `json:"tagged_at,omitempty" bson:"tagged_at"`
	Species  string             `json:"species" bson:"species"`
	Location *Location          `json:"location" bson:"location"`
}

Tree represents the attributes of a tree

func (*Tree) Validate

func (t *Tree) Validate(checkID bool) error

Validate validates a tree has all mandatory fields populated

Jump to

Keyboard shortcuts

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