datasetgen

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: MIT Imports: 11 Imported by: 0

README

go-datasetgen

Generate json from AoiMori Open Data Catalog. https://opendata.pref.aomori.lg.jp/dataset/1531.html

Documentation

Index

Constants

View Source
const OpenDataSiteDomain string = "opendata.pref.aomori.lg.jp"
View Source
const OpenDataWebApiUrl string = "https://" + OpenDataSiteDomain + "/api/package_show?id=5e4612ce-1636-41d9-82a3-c5130a79ffe0"

Variables

This section is empty.

Functions

func ParseJapaneseDate

func ParseJapaneseDate(d string) (time.Time, error)

func Run

func Run(cmd *cobra.Command, args []string) error

func Transform0102

func Transform0102(d string) (string, error)

func Transform20060102

func Transform20060102(d string) (string, error)

func Transform200601021504

func Transform200601021504(t time.Time) string

func TransformRFC3339Z

func TransformRFC3339Z(d string) (string, error)

func TransformWeekday

func TransformWeekday(d string) (int, error)

Types

type ContactData

type ContactData struct {
	Day       *string `json:"日付"`
	DayOfWeek *int    `json:"曜日"`
	Nine13    *int    `json:"9-13時"`
	One317    *int    `json:"13-17時"`
	One721    *int    `json:"17-21時"`
	Date      *string `json:"date"`
	W         *int    `json:"w"`
	ShortDate *string `json:"short_date"`
	SubTotal  *int    `json:"小計"`
}

type Contacts

type Contacts struct {
	Date *string       `json:"date"`
	Data []ContactData `json:"data"`
}

type DataSet

type DataSet struct {
	Contacts                Contacts                `json:"contacts"`
	Querents                Querents                `json:"querents"`
	Patients                Patients                `json:"patients"`
	PatientsSummary         PatientsSummary         `json:"patients_summary"`
	DischargesSummary       DischargesSummary       `json:"discharges_summary"`
	InspectionsSummary      InspectionsSummary      `json:"inspections_summary"`
	InspectionPersons       InspectionPersons       `json:"inspection_persons"`
	InspectionStatusSummary InspectionStatusSummary `json:"inspection_status_summary"`
	LastUpdate              *string                 `json:"lastUpdate"`
}

func NewDataSet

func NewDataSet() *DataSet

func (*DataSet) GenerateJson

func (d *DataSet) GenerateJson() (string, error)

func (*DataSet) SetContacts

func (d *DataSet) SetContacts(webapi *WebApi) error

func (*DataSet) SetInspectionPersons

func (d *DataSet) SetInspectionPersons(webapi *WebApi) error

func (*DataSet) SetInspectionStatusSummary

func (d *DataSet) SetInspectionStatusSummary(webapi *WebApi) error

func (*DataSet) SetInspectionsSummary

func (d *DataSet) SetInspectionsSummary(webapi *WebApi) error

func (*DataSet) SetLastUpdateDate

func (d *DataSet) SetLastUpdateDate()

func (*DataSet) SetPatients

func (d *DataSet) SetPatients(webapi *WebApi) error

func (*DataSet) SetPatientsSummary

func (d *DataSet) SetPatientsSummary(webapi *WebApi) error

func (*DataSet) SetQuerents

func (d *DataSet) SetQuerents(webapi *WebApi) error

type DischargesSummary

type DischargesSummary struct {
	Date *string                 `json:"date"`
	Data []DischargesSummaryData `json:"data"`
}

type DischargesSummaryData

type DischargesSummaryData struct {
	Day      *string `json:"日付"`
	SubTotal *int    `json:"小計"`
}

type InspectionPersons

type InspectionPersons struct {
	Date     *string                    `json:"date"`
	Labels   []*string                  `json:"labels"`
	Datasets []InspectionPersonsDataset `json:"datasets"`
}

type InspectionPersonsDataset

type InspectionPersonsDataset struct {
	Label *string `json:"label"`
	Data  []*int  `json:"data"`
}

type InspectionStatus

type InspectionStatus struct {
	Date     string `csv:"検査日時"`
	Number   int    `csv:"実施数"`
	Positive int    `csv:"陽性数"`
	Negative int    `csv:"陰性数"`
}

type InspectionStatusSummary

type InspectionStatusSummary struct {
	Date     *string                           `json:"date"`
	Attr     *string                           `json:"attr"`
	Value    *int                              `json:"value"`
	Children []InspectionStatusSummaryChildren `json:"children"`
}

type InspectionStatusSummaryChildren

type InspectionStatusSummaryChildren struct {
	Attr     *string                                   `json:"attr"`
	Value    *int                                      `json:"value"`
	Children []InspectionStatusSummaryChildrenChildren `json:"children"`
}

type InspectionStatusSummaryChildrenChildren

type InspectionStatusSummaryChildrenChildren struct {
	Attr  *string `json:"attr"`
	Value *int    `json:"value"`
}

type InspectionsStatus

type InspectionsStatus []InspectionStatus

func NewInspectionsStatus

func NewInspectionsStatus() *InspectionsStatus

func (*InspectionsStatus) Get

func (i *InspectionsStatus) Get(url string) error

type InspectionsSummary

type InspectionsSummary struct {
	Date   *string                `json:"date"`
	Data   InspectionsSummaryData `json:"data"`
	Labels []*string              `json:"labels"`
}

type InspectionsSummaryData

type InspectionsSummaryData struct {
	InAomori []*int `json:"県内"`
	Others   []*int `json:"その他"`
}

type NumberOfInquiriesCallCenter

type NumberOfInquiriesCallCenter []NumberOfInquiryCallCenter

func NewNumberOfInquiriesCallCenter

func NewNumberOfInquiriesCallCenter() *NumberOfInquiriesCallCenter

func (*NumberOfInquiriesCallCenter) Get

type NumberOfInquiriesNearCorona

type NumberOfInquiriesNearCorona []NumberOfInquiryNearCorona

func NewNumberOfInquiriesNearCorona

func NewNumberOfInquiriesNearCorona() *NumberOfInquiriesNearCorona

func (*NumberOfInquiriesNearCorona) Get

type NumberOfInquiryCallCenter

type NumberOfInquiryCallCenter struct {
	Code       string `csv:"全国地方公共団体コード"`
	Prefecture string `csv:"都道府県名"`
	City       string `csv:"市区町村名"`
	Date       string `csv:"受付_年月日"`
	Count      int    `csv:"相談件数(対応)"`
}

type NumberOfInquiryNearCorona

type NumberOfInquiryNearCorona struct {
	Code       string `csv:"全国地方公共団体コード"`
	Prefecture string `csv:"都道府県名"`
	Date       string `csv:"受付_年月日"`
	Count      int    `csv:"相談件数"`
}

type PatientData

type PatientData struct {
	ReleaseDate *string `json:"リリース日"`
	Address     *string `json:"居住地"`
	Age         *string `json:"年代"`
	Sex         *string `json:"性別"`
	Leave       *string `json:"退院"`
	Date        *string `json:"date"`
}

type PatientStatus

type PatientStatus struct {
	Number       int    `csv:"NO"`
	Code         string `csv:"全国地方公共団体コード"`
	Prefecture   string `csv:"都道府県名"`
	HealthCenter string `csv:"保健所管内"`
	PublishDate  string `csv:"公表_年月日"`
	FixedDate    string `csv:"判明_年月日"`
	Address      string `csv:"居住地"`
	Age          string `csv:"年代"`
	Sex          string `csv:"性別"`
}

type Patients

type Patients struct {
	Date *string       `json:"date"`
	Data []PatientData `json:"data"`
}

type PatientsStatus

type PatientsStatus []PatientStatus

func NewPatientsStatus

func NewPatientsStatus() *PatientsStatus

func (*PatientsStatus) Get

func (p *PatientsStatus) Get(url string) error

type PatientsSummary

type PatientsSummary struct {
	Date *string               `json:"date"`
	Data []PatientsSummaryData `json:"data"`
}

type PatientsSummaryData

type PatientsSummaryData struct {
	Day      *string `json:"日付"`
	SubTotal *int    `json:"小計"`
}

type QuerentData

type QuerentData struct {
	Day       *string `json:"日付"`
	DayOfWeek *int    `json:"曜日"`
	Nine17    *int    `json:"9-17時"`
	One79     *int    `json:"17-翌9時"`
	Date      *string `json:"date"`
	W         *int    `json:"w"`
	ShortDate *string `json:"short_date"`
	SubTotal  *int    `json:"小計"`
}

type Querents

type Querents struct {
	Date *string       `json:"date"`
	Data []QuerentData `json:"data"`
}

type WebApi

type WebApi struct {
	Success bool `json:"success"`
	Result  struct {
		Type string `json:"type"`
		Site struct {
			ID      int       `json:"id"`
			Name    string    `json:"name"`
			URL     string    `json:"url"`
			Created time.Time `json:"created"`
			Updated time.Time `json:"updated"`
		} `json:"site"`
		User struct {
			ID      int       `json:"id"`
			Name    string    `json:"name"`
			UID     string    `json:"uid"`
			Email   string    `json:"email"`
			Created time.Time `json:"created"`
			Updated time.Time `json:"updated"`
		} `json:"user"`
		Author     string    `json:"author"`
		ID         int       `json:"id"`
		UUID       string    `json:"uuid"`
		Name       string    `json:"name"`
		Filename   string    `json:"filename"`
		URL        string    `json:"url"`
		Text       string    `json:"text"`
		State      string    `json:"state"`
		Released   time.Time `json:"released"`
		Created    time.Time `json:"created"`
		Updated    time.Time `json:"updated"`
		Categories []struct {
			ID       int       `json:"id"`
			Name     string    `json:"name"`
			Filename string    `json:"filename"`
			State    string    `json:"state"`
			Created  time.Time `json:"created"`
			Updated  time.Time `json:"updated"`
		} `json:"categories"`
		EstatCategories []interface{} `json:"estat_categories"`
		Areas           []struct {
			ID       int       `json:"id"`
			Name     string    `json:"name"`
			Filename string    `json:"filename"`
			State    string    `json:"state"`
			Created  time.Time `json:"created"`
			Updated  time.Time `json:"updated"`
		} `json:"areas"`
		Tags       []interface{} `json:"tags"`
		Point      int           `json:"point"`
		Downloaded int           `json:"downloaded"`
		Groups     []struct {
			ID           int       `json:"id"`
			Name         string    `json:"name"`
			TrailingName string    `json:"trailing_name"`
			Created      time.Time `json:"created"`
			Updated      time.Time `json:"updated"`
		} `json:"groups"`
		Resources []struct {
			ID         int         `json:"id"`
			UUID       string      `json:"uuid"`
			RevisionID string      `json:"revision_id"`
			Name       string      `json:"name"`
			Filename   string      `json:"filename"`
			Text       interface{} `json:"text"`
			License    struct {
				ID      int         `json:"id"`
				Name    string      `json:"name"`
				UID     interface{} `json:"uid"`
				State   string      `json:"state"`
				Created time.Time   `json:"created"`
				Updated time.Time   `json:"updated"`
			} `json:"license"`
			RdfIri      interface{} `json:"rdf_iri"`
			RdfError    interface{} `json:"rdf_error"`
			Created     time.Time   `json:"created"`
			Updated     time.Time   `json:"updated"`
			DownloadURL string      `json:"download_url"`
			URL         string      `json:"url"`
			Format      string      `json:"format"`
		} `json:"resources"`
		NumResources int `json:"num_resources"`
	} `json:"result"`
	Help string `json:"help"`
}

func NewWebApi

func NewWebApi() *WebApi

func (*WebApi) Get

func (w *WebApi) Get() error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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