app

package
v0.0.0-...-7223067 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootDomain = "covid-19.unko.in"

	DataRepoURL = "https://github.com/CSSEGISandData/COVID-19"

	GitPath            = "./data/git/COVID-19"
	RepoDataPath       = "./data/git/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports"
	PublicPath         = "./www"
	ConvertDataPath    = "./www/data/daily_reports/json"
	SummaryDataPath    = "./www/data/daily_reports/summary.json"
	AccessLogPath      = "./log"
	NowJSONDefaultName = "2020-01-22.json"

	GitTimeoutDuration  = 3 * time.Minute
	UpdateCycleDuration = 1 * time.Hour
)

Variables

This section is empty.

Functions

func MonitoringHandler

func MonitoringHandler(h http.Handler, rich chan<- responseInfo) http.Handler

MonitoringHandler モニタリング用ハンドラ生成

func New

func New() *application

Types

type CountrySummary

type CountrySummary struct {
	Daily []DatasetSimple `json:"daily"`
	CDR   [3]uint64       `json:"cdr"`
}

type Dataset

type Dataset struct {
	Confirmed  uint64              `json:"confirmed"`
	Deaths     uint64              `json:"deaths"`
	Recovered  uint64              `json:"recovered"`
	LastUpdate *Unixtime           `json:"last_update,omitempty"`
	Latitude   float64             `json:"latitude,omitempty"`
	Longitude  float64             `json:"longitude,omitempty"`
	Children   map[string]*Dataset `json:"children,omitempty"`
}

type DatasetSimple

type DatasetSimple struct {
	Date TimeDaily `json:"date"`
	CDR  [3]uint64 `json:"cdr"`
}

type GetMonitoringHandler

type GetMonitoringHandler struct {
	// contains filtered or unexported fields
}

func (*GetMonitoringHandler) ServeHTTP

func (h *GetMonitoringHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type MonitoringResponseWriter

type MonitoringResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func (*MonitoringResponseWriter) Close

func (mrw *MonitoringResponseWriter) Close() error

Close io.Closerのような感じにしたけど特に意味は無い

func (*MonitoringResponseWriter) Flush

func (mrw *MonitoringResponseWriter) Flush()

Flush http.Flusher interface

func (*MonitoringResponseWriter) Hijack

Hijack implements http.Hijacker. If the underlying ResponseWriter is a Hijacker, its Hijack method is returned. Otherwise an error is returned.

func (*MonitoringResponseWriter) Push

func (mrw *MonitoringResponseWriter) Push(target string, opts *http.PushOptions) error

Push http.Pusher interface go1.8以上が必要

func (*MonitoringResponseWriter) Write

func (mrw *MonitoringResponseWriter) Write(buf []byte) (int, error)

Write メソッドをオーバーライド

func (*MonitoringResponseWriter) WriteHeader

func (mrw *MonitoringResponseWriter) WriteHeader(statusCode int)

WriteHeader メソッドをオーバーライド

type TimeDaily

type TimeDaily time.Time

func (TimeDaily) MarshalJSON

func (t TimeDaily) MarshalJSON() ([]byte, error)

type Unixtime

type Unixtime time.Time

func (Unixtime) MarshalBinary

func (ts Unixtime) MarshalBinary() ([]byte, error)

func (Unixtime) MarshalJSON

func (ts Unixtime) MarshalJSON() ([]byte, error)

func (*Unixtime) UnmarshalBinary

func (ts *Unixtime) UnmarshalBinary(data []byte) error

func (*Unixtime) UnmarshalJSON

func (ts *Unixtime) UnmarshalJSON(data []byte) error

type WorldSummary

type WorldSummary struct {
	Countrys map[string]CountrySummary `json:"countrys"`
	CDR      [3]uint64                 `json:"cdr"`
}

Jump to

Keyboard shortcuts

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