Documentation ¶
Index ¶
- Constants
- type Binding
- type CEA_DASE
- func (c *CEA_DASE) Fetch() ([]byte, error)
- func (c *CEA_DASE) Format(latitude, longitude float64, data map[string]any) ([]Event, error)
- func (c *CEA_DASE) List(latitude, longitude float64) ([]Event, error)
- func (c *CEA_DASE) Parse(data []byte) (map[string]any, error)
- func (c *CEA_DASE) Property() string
- type CEIC
- type CWA
- type DataSource
- type DataSourceCache
- type Event
- type HKO
- type INGV
- type JMA
- type KMA
- type SCEA_B
- type SCEA_E
- type Trace
- type USGS
Constants ¶
const EXPIRATION = time.Minute // Cache expiration duration for calling external API response
const HOST_IP_TO_BYPASS_GFW = "168.95.246.1:443"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binding ¶
type Binding struct {
Source string `form:"source" json:"source" xml:"source" binding:"required"`
}
type DataSource ¶
type DataSourceCache ¶
type Event ¶
type Event struct { Verfied bool `json:"verfied"` Timestamp int64 `json:"timestamp"` Event string `json:"event"` Region string `json:"region"` Depth float64 `json:"depth"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Distance float64 `json:"distance"` Magnitude float64 `json:"magnitude"` Estimation estimation `json:"estimation"` }
type Trace ¶
type Trace struct{}
func (*Trace) RegisterModule ¶
func (t *Trace) RegisterModule(rg *gin.RouterGroup, options *app.ServerOptions)
@Summary AnyShake Observer event trace @Description Get list of earthquake events data source and earthquake events from specified data source @Router /trace [post] @Accept application/x-www-form-urlencoded @Produce application/json @Param source formData string true "Use `show` to get available sources first, then choose one and request again to get events" @Failure 400 {object} response.HttpResponse "Failed to read earthquake event list due to invalid data source" @Failure 500 {object} response.HttpResponse "Failed to read earthquake event list due to failed to read data source" @Success 200 {object} response.HttpResponse{data=[]Event} "Successfully read the list of earthquake events"