model

package
v0.0.0-...-88fc6bc Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(data bson.M) (interface{}, error)

Types

type Area

type Area struct {
	Name        string      `bson:"name"`
	Grade       string      `bson:"grade"`
	Immediate   bool        `bson:"immediate"`
	FirstHeight FirstHeight `bson:"firstHeight"`
	MaxHeight   MaxHeight   `bson:"maxHeight"`
}

type AreaByConfidence

type AreaByConfidence struct {
	Confidence string
	Areas      []string
}

type AreaByGrade

type AreaByGrade struct {
	Grade string
	Areas []ForecastArea
}

type AreaConfidence

type AreaConfidence struct {
	Confidence float64 `bson:"confidence"`
}

type EEW

type EEW struct {
	Code       int
	ObjectID   string
	Serial     string
	IssueTime  string
	ShortTime  string
	Cancelled  bool
	Hypocenter string
	Areas      []string
}

func ToEEW

func ToEEW(data primitive.M) (*EEW, error)

type EEWArea

type EEWArea struct {
	Pref string `bson:"pref"`
	Name string `bson:"name"`
}

type EEWRecord

type EEWRecord struct {
	ID         primitive.ObjectID `bson:"_id"`
	Earthquake struct {
		Hypocenter struct {
			Name string `bson:"name"`
		} `bson:"hypocenter"`
	} `bson:"earthquake"`
	Issue struct {
		Time   string `bson:"time"`
		Serial string `bson:"serial"`
	} `bson:"issue"`
	Cancelled bool      `bson:"cancelled"`
	Areas     []EEWArea `bson:"areas"`
}

type Earthquake

type Earthquake struct {
	Raw            string
	Code           int
	ObjectID       string
	MaxScale       string
	IssueTime      string
	IssueType      string
	OccurredTime   string
	ShortTime      string
	Hypocenter     string
	Tsunami        string
	ForeignTsunami string
	Points         []PointsByPref
	PointsByScale  []PointsByScale
}

func ToEarthquake

func ToEarthquake(data primitive.M) (*Earthquake, error)

type EarthquakeRecord

type EarthquakeRecord struct {
	ID         primitive.ObjectID `bson:"_id"`
	Earthquake struct {
		MaxScale        int        `bson:"maxScale"`
		Time            string     `bson:"time"`
		DomesticTsunami string     `bson:"domesticTsunami"`
		ForeignTsunami  string     `bson:"foreignTsunami"`
		Hypocenter      Hypocenter `bson:"hypocenter"`
	} `bson:"earthquake"`
	Issue struct {
		Type string `bson:"type"`
		Time string `bson:"time"`
	} `bson:"issue"`
	Points []Point `bson:"points"`
}

type FirstHeight

type FirstHeight struct {
	ArrivalTime string `bson:"arrivalTime"`
	Condition   string `bson:"condition"`
}

type ForecastArea

type ForecastArea struct {
	Name        string
	Immediate   bool
	ArrivalTime string
	MaxHeight   string
}

type Hypocenter

type Hypocenter struct {
	Name      string  `bson:"name"`
	Depth     int     `bson:"depth"`
	Latitude  float64 `bson:"latitude"`
	Longitude float64 `bson:"longitude"`
	Magnitude float64 `bson:"magnitude"`
}

type Issue

type Issue struct {
	Time string `bson:"time"`
	Type string `bson:"type"`
}

type MaxHeight

type MaxHeight struct {
	Description string  `bson:"description"`
	Value       float64 `bson:"value"`
}

type Point

type Point struct {
	Pref   string `bson:"pref"`
	Addr   string `bson:"addr"`
	IsArea bool   `bson:"isArea"`
	Scale  int    `bson:"scale"`
}

type PointsByPref

type PointsByPref struct {
	Pref   string
	Points []PointsByScale
}

type PointsByScale

type PointsByScale struct {
	Scale  string
	Points []string
}

func (PointsByScale) PointString

func (ps PointsByScale) PointString() string

type SortableArea

type SortableArea struct {
	Area       string
	Confidence float64
}

type Tsunami

type Tsunami struct {
	Code        int
	ObjectID    string
	Time        string
	IssueTime   string
	ShortTime   string
	Cancelled   bool
	MaxGrade    string
	AreaByGrade []AreaByGrade
}

func ToTsunami

func ToTsunami(data primitive.M) (*Tsunami, error)

type TsunamiRecord

type TsunamiRecord struct {
	ID        primitive.ObjectID `bson:"_id"`
	Time      string             `bson:"time"`
	Cancelled bool               `bson:"cancelled"`
	Issue     Issue              `bson:"issue"`
	Areas     []Area             `bson:"areas"`
}

type Userquake

type Userquake struct {
	Code             int
	ObjectID         string
	StartTime        string
	ShortTime        string
	EndTime          string
	AreaByConfidence []AreaByConfidence
}

func ToUserquake

func ToUserquake(data primitive.M) (*Userquake, error)

type UserquakeRecord

type UserquakeRecord struct {
	ID              primitive.ObjectID        `bson:"_id"`
	StartedAt       string                    `bson:"started_at"`
	UpdatedAt       string                    `bson:"updated_at"`
	AreaConfidences map[string]AreaConfidence `bson:"area_confidences"`
}

Jump to

Keyboard shortcuts

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