model

package
v0.0.0-...-3ec3138 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MINIMUM_LAT   = -90
	MAXIMUM_LAT   = 90
	MINIMUM_LON   = -180
	MAXIMUM_LON   = 180
	S3_KEY_PREFIX = "touring-log/photo"
)

Variables

This section is empty.

Functions

func ExtractMetadata

func ExtractMetadata(r io.Reader) (lat, lon float64, time time.Time, err error)

Types

type Email

type Email string

type LogDate

type LogDate struct {
	Year  int `json:"year"`
	Month int `json:"month"`
	Day   int `json:"day"`
}

type Photo

type Photo struct {
	ID          PhotoID   `json:"id"`
	Year        int       `json:"year"`
	Month       int       `json:"month"`
	Day         int       `json:"day"`
	Lat         float64   `json:"lat"`
	Lon         float64   `json:"lon"`
	Timestamp   time.Time `json:"timestamp"`
	S3ObjectKey string    `json:"s3_object_key"`
	UserID      UserID    `json:"user_id"`
}

func NewPhoto

func NewPhoto(id PhotoID, time time.Time, lat, lon float64, user_id UserID, unit string) (*Photo, error)

type PhotoID

type PhotoID string

type TouringLog

type TouringLog struct {
	Trip   []*WebClientTrip
	Photo  []*WebClientPhoto
	Center *WebClientTrip
}

type Trip

type Trip struct {
	ID    TripID `json:"id"`
	Year  int    `json:"year"`
	Month int    `json:"month"`
	Day   int    `json:"day"`
	Unit  string `json:"unit"`
}

func NewTrip

func NewTrip(id TripID, year, month, day int, unit string) *Trip

type TripID

type TripID string

type UUID

type UUID string

func CreateUUID

func CreateUUID() UUID

type User

type User struct {
	ID       UserID
	Email    Email
	Password string
	Unit     string
}

func NewUser

func NewUser(id UserID, email Email, pw, unit string) (*User, error)

func (*User) ValidatePassword

func (u *User) ValidatePassword(password string) error

type UserID

type UserID string

type WebClientPhoto

type WebClientPhoto struct {
	Id  string  `json:"id"`
	Lat float64 `json:"lat"`
	Lng float64 `json:"lng"`
}

type WebClientTrip

type WebClientTrip struct {
	Lat float64 `json:"lat"`
	Lng float64 `json:"lng"`
}

Jump to

Keyboard shortcuts

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