| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- package config
- /**
- * structs
- **/
- const (
- LOCAL = "local"
- DEV = "dev"
- // JSON 설정 파일
- ENV_PATH = "./env.json"
- CONFIG_PATH_DATABASE = "./config/database.json"
- CONFIG_PATH_MOVIE = "./config/movie.json"
- CONFIG_PATH_G2A = "./config/g2a.json"
- // 로그 파일 경로
- ERROR_LOG_PATH_KOBIS = "./log/kobis/error.txt"
- ERROR_LOG_PATH_G2A = "./log/g2a/error.txt"
- LAST_PAGE_PATH_KOBIS = "./log/kobis/page.txt"
- // DB 목록
- DB_MOVIEW = "movie"
- DB_CRAWLER = "crawler"
- DB_PLAYR = "playr"
- // 데이터 단위
- BYTE = 1.0
- KILOBYTE = 1024 * BYTE
- MEGABYTE = 1024 * KILOBYTE
- GIGABYTE = 1024 * MEGABYTE
- TERABYTE = 1024 * GIGABYTE
- // GeneralLog Action 구분값
- GL_ACTION_WRITE = 1
- GL_ACTION_MODIFY = 2
- GL_ACTION_DELETE = 3
- GL_ACTION_SELECT = 4
- // 영화진흥윈원회
- KOBIS_DOMAIN = "www.kobis.or.kr"
- KOBIS_HOST = "https://www.kobis.or.kr"
- // 영화 목록 API
- MOVIE_LIST = "http://www.kobis.or.kr/kobisopenapi/webservice/rest/movie/searchMovieList.json"
- // 영화 상세 정보 API
- MOVIE_INFO = "http://www.kobis.or.kr/kobisopenapi/webservice/rest/movie/searchMovieInfo.json"
- // 영화 상세 정보 Page
- MOVIE_DETAIL = "https://www.kobis.or.kr/kobis/business/mast/mvie/searchMovieDtl.do"
- // 영화 일별 박스오피스
- MOVIE_DAILY_BOX_OFFICE_LIST = "http://www.kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchDailyBoxOfficeList.json"
- // 영화 주간/주말 박스오피스
- MOVIE_WEEK_BOX_OFFICE_LIST = "http://www.kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchWeeklyBoxOfficeList.json"
- // 영화 박스오피스 (통계)
- MOVIE_BOX_OFFICE_STATS = "http://api.kcisa.kr/openapi/service/rest/meta5/getKFCC0502"
- // 암호화, 복호화 Key, IV
- ENCRYPT_KEY = "@@20120726CHrong"
- ENCRYPT_IV = "6c2df00f75470f67"
- )
- // 환경설정값
- var (
- EnvKey = "DEVELOPER_ENV" // 윈도우, 리눅스에 선언된 환경변수 이름
- Env *Environment
- DB *DBConfig
- Movie *MovieConfig
- G2A *G2AConfig
- )
- type Environment struct {
- DeveloperEnv string `json:"developerEnv"`
- IdentityKey string `json:"identityKey"`
- IsDebug bool `json:"isDebug"`
- IsLive bool `json:"isLive"`
- APP struct {
- Port string `json:"port"`
- SecretKey string `json:"secretKey"`
- ReadTimeout int `json:"readTimeout"`
- WriteTimeout int `json:"writeTimeout"`
- MaxHeaderBytes int `json:"maxHeaderBytes"`
- } `json:"app"`
- }
- type DBConfig struct {
- MaxLifetime int `json:"maxLifetime"`
- MaxIdleTime int `json:"maxIdleTime"`
- MaxIdleConn int `json:"maxIdleConn"`
- MaxOpenConn int `json:"maxOpenConn"`
- DBServer
- }
- type DBServer struct {
- Local DBAccount `json:"local"`
- Dev DBAccount `json:"dev"`
- }
- type DBAccount struct {
- Driver string `json:"driver"`
- User string `json:"user"`
- Password string `json:"password"`
- Address string `json:"address"`
- Name string `json:"name"`
- }
- // 영화진흥위원회 API
- type MovieConfig struct {
- Kobis struct {
- ApiKey_1 string `json:"apiKey_1"`
- ApiKey_2 string `json:"apiKey_2"`
- ApiKey_3 string `json:"apiKey_3"`
- } `json:"kobis"`
- }
- // G2A.com API
- type G2AConfig struct {
- Import G2ACredential `json:"import"`
- Export G2ACredential `json:"export"`
- Sandbox G2ACredential `json:"sandbox"`
- }
- type G2ACredential struct {
- API string `json:"api"`
- Email string `json:"email"`
- Client struct {
- ID string `json:"id"`
- Secret string `json:"secret"`
- } `json:"client"`
- Hash string `json:"hash"`
- IsTest int `json:"isTest"`
- }
|