Documentation
¶
Overview ¶
Package schoolmeal gets menu of Korean schools schoolmeal 패키지는 대한민국의 유치원, 초중고 학교의 급식을 크롤링한 결과를 리턴하는 함수를 제공합니다. 예제를 보고 싶으시면 이 패키지의 Github의 README.md를 봐 주세요.
Index ¶
- Constants
- func Timestamp(date time.Time) (stamp string)
- type Meal
- type Schedule
- type School
- func (s School) GetDayMeal(date string, mealType int) (m Meal, err error)
- func (s School) GetMonthMeal(year, month int) (monthMeals [][]Meal, err error)
- func (s School) GetMonthSchedule(year, month int) (schedules []Schedule, err error)
- func (s School) GetWeekMeal(date string, mealType int) (meals []Meal, err error)
Constants ¶
View Source
const ( Breakfast = iota + 1 // 아침 Lunch // 점심 Dinner // 저녁 )
GetWeekMeal 함수의 mealType 인자에 사용하는 상수들입니다.
View Source
const ( Kindergarten = iota + 1 // 유치원 Elementary // 초등학교 Middle // 중학교 High // 고등학교 )
School 구조체의 Code 필드에 사용할 수 있습니다.
View Source
const ( Seoul = "sen" // 서울특별시교육청 Busan = "pen" // 부산광역시교육청 Daegu = "dge" // 대구광역시교육청 Incheon = "ice" // 인천광역시교육청 Gwangju = "gen" // 광주광역시교육청 Daejeon = "dje" // 대전광역시교육청 Ulsan = "use" // 울산광역시교육청 Sejong = "sje" // 세종특별자치시교육청 Gyeonggi = "goe" // 경기도교육청 Gangwon = "gwe" // 강원도교육청 Chungbuk = "cbe" // 충청북도교육청 Chungnam = "cne" // 충남북도교육청 Jeonbuk = "jbe" // 전라북도교육청 Jeonnam = "jne" // 전라남도교육청 Gyeongbuk = "kbe" // 경상북도교육청 Geyongnam = "gne" // 경상남도교육청 Jeju = "jje" // 제주특별자치도교육청 )
School 구조체의 Zone 필드에 사용 가능합니다. 학교를 관할하는 교육청에 맞게 사용하면 됩니다.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Meal ¶
type Meal struct {
DateString string // 2018.11.30 형태의 타임스탬프
Date time.Time // parsed DateString
Type int // 급식 종류
People int // 몇 명이나 먹나요?
Content string // 메뉴
}
Meal 구조체는 급식 정보를 저장합니다.
type School ¶
type School struct {
Name string // 학교 이름; GetWeekMeals()를 사용하기 위한 필수 필드는 아닙니다. Find() 사용 시 자동으로 채워집니다.
Zone string // 학교를 관할하는 교육청
Code string // 학교 코드
Kind int // 학교의 타입(유, 초, 중, 고)
// contains filtered or unexported fields
}
School 구조체는 급식 정보를 얻어오기 위해 필요한 학교 정보들을 필드로 가집니다.
func (School) GetDayMeal ¶ added in v0.1.5
GetDayMeal 함수는 하루의 급식을 가져옵니다.
func (School) GetMonthMeal ¶ added in v0.1.9
GetMonthMeal 함수는 인자로 받은 연도와 달의 전체 급식을 리턴합니다. Meal[날짜-1][타입-1]
func (School) GetMonthSchedule ¶ added in v0.1.12
GetMonthSchedule 함수는 월별 일정을 가져옵니다.
Click to show internal directories.
Click to hide internal directories.