eew

package
v0.0.0-...-98d5c61 Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultZmqEndpoint = "tcp://127.0.0.1:5563"
)

Variables

This section is empty.

Functions

func Run

func Run(apiKey, zmqEndpoint string) error

Types

type Content

type Content struct {
	EventId   string
	Time      *ReportTime
	AreaName  string
	LatLng    *LatLng
	Depth     *Depth
	Magnitude Magnitude
	Intensity *Intensity
	Serial    Serial
	IsLast    IsLast
	Url       string
}

func NewContent

func NewContent(r io.Reader) (*Content, error)

func (*Content) ParseCoordinate

func (c *Content) ParseCoordinate(coordinate string) error

func (Content) String

func (c Content) String() string

type Depth

type Depth float64

func (*Depth) String

func (d *Depth) String() string

https://www.data.jma.go.jp/suishin/jyouhou/pdf/566.pdf > ・震源の深さがごく浅い場合(0km) > (※「緊急地震速報(警報)」、「緊急地震速報(予報)」の場合、現行の運用では、震源の深さを「ごく浅い」とせずに、本要素の内容、属性「@description」において、震源の深さを 10km として扱い発表する。)

type Intensity

type Intensity struct {
	From string
	To   string
}

func (*Intensity) String

func (i *Intensity) String() string

type IsLast

type IsLast bool

func (IsLast) String

func (l IsLast) String() string

type LatLng

type LatLng struct {
	Lat float64
	Lng float64
}

func (*LatLng) String

func (l *LatLng) String() string

type Magnitude

type Magnitude string

func (Magnitude) String

func (m Magnitude) String() string

type ReportTime

type ReportTime time.Time

func (*ReportTime) String

func (t *ReportTime) String() string

type Serial

type Serial int

func (Serial) String

func (s Serial) String() string

type SocketRequest

type SocketRequest struct {
	Classifications []string `json:"classifications"`
	Types           []string `json:"types,omitempty"`
	Test            string   `json:"test,omitempty"`
	AppName         string   `json:"appName,omitempty"`
	FormatMode      string   `json:"formatMode,omitempty"`
}

type SocketResponse

type SocketResponse struct {
	SocketResponseStatus
	Ticket    string `json:"ticket"`
	Websocket struct {
		Id         int      `json:"id"`
		Url        string   `json:"url"`
		Protocol   []string `json:"protocol"`
		Expiration int      `json:"expiration"`
	} `json:"websocket"`
	Classifications []string `json:"classifications"`
	Test            string   `json:"test"`
	Types           []string `json:"types"`
	Formats         []string `json:"formats"`
	AppName         *string  `json:"appName"`
}

func ParseSocketResponse

func ParseSocketResponse(resp io.Reader) (*SocketResponse, error)

type SocketResponseError

type SocketResponseError struct {
	SocketResponseStatus
	Error struct {
		Message string `json:"message"`
		Code    int    `json:"code"`
	} `json:"error"`
}

type SocketResponseStatus

type SocketResponseStatus struct {
	ResponseId   string    `json:"responseId"`
	ResponseTime time.Time `json:"responseTime"`
	Status       string    `json:"status"`
}

type WebsocketData

type WebsocketData struct {
	WebsocketType
	Version        string `json:"version"`
	Id             string `json:"id"`
	Classification string `json:"classification"`
	Passing        []struct {
		Name string    `json:"name"`
		Time time.Time `json:"time"`
	} `json:"passing"`
	Head struct {
		Type        string    `json:"type"`
		Author      string    `json:"author"`
		Target      string    `json:"target"`
		Time        time.Time `json:"time"`
		Designation *string   `json:"designation"`
		Test        bool      `json:"test"`
		Xml         bool      `json:"xml"`
	} `json:"head"`
	XmlReport   any     `json:"xmlReport"`
	Format      *string `json:"format"`
	Compression *string `json:"compression"`
	Encoding    *string `json:"encoding"`
	Body        string  `json:"body"`
}

type WebsocketError

type WebsocketError struct {
	WebsocketType
	Error string `json:"error"`
	Code  int    `json:"code"`
	Close bool   `json:"close"`
}

type WebsocketPing

type WebsocketPing struct {
	WebsocketType
	PingId string `json:"pingId"`
}

type WebsocketStart

type WebsocketStart struct {
	WebsocketType
	SocketId        int       `json:"socketId"`
	Classifications []string  `json:"Classifications"`
	Types           []string  `json:"types"`
	Test            string    `json:"test"`
	Formats         []string  `json:"formats"`
	AppName         *string   `json:"appName"`
	Time            time.Time `json:"time"`
}

type WebsocketType

type WebsocketType struct {
	Type string `json:"type"`
}

Jump to

Keyboard shortcuts

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