About postkr
์ธํฐ๋ท ์ฐ์ฒด๊ตญ ์คํAPI๋ฅผ ์ํ Go์ธ์ด ํจํค์ง ์
๋๋ค.
ํ์ฌ, ์ฐํธ๋ฒํธ, ์ข
์ถ์ ์กฐํ, EMS ์ค ์ฐํธ๋ฒํธ ๊ธฐ๋ฅ ๋ง ๊ตฌํ๋์ด ์์ต๋๋ค.
Documentation
Prerequisites
Install Go
Installation
$ go get github.com/suapapa/go_postkr
General Documentation
godoc.org ๋งํฌ์์ ์จ๋ผ์ธ ๋ฌธ์๋ฅผ ๋ณด๊ฑฐ๋,
๋ค์ ๋ช
๋ น์ผ๋ก ๋ก์ปฌ์์ ๋ฌธ์๋ฅผ ๋ณผ ์ ์์ต๋๋ค.
go doc github.com/suapapa/go_postkr
Example
postkr์ ์ฌ์ฉํ๋ ค๋ฉด, ์ธํฐ๋ท ์ฐ์ฒด๊ตญ์ ์คํAPI์ฌ์ฉ์ ์ฒญ์ ํตํด ํค๋ฅผ
๋ฐ๊ธ ๋ฐ์์ผ ํฉ๋๋ค. ๋ฐ๊ธ๋ฐ์ ํค๋ฅผ ์๋ ์ฝ๋์ yourKey
๋ณ์์ ํ ๋นํ์ธ์.
package main
import (
"fmt"
"github.com/suapapa/go_postkr"
)
func main() {
// ๋ฐ๊ธ๋ฐ์ ์คํAPI ํค๋ก ๋ฐ๊พธ์ธ์
yourKey := "abcedfghijklmnopqrstuvwxyz1234"
s := postkr.NewService(yourKey)
l, err := s.SerchZipCode("๋ด๊ณก๋")
if err != nil {
fmt.Println(err)
return
}
for _, p := range l {
fmt.Printf("(%s) %s\n", p.Code, p.Address)
}
}
์คํ ๊ฒฐ๊ณผ
$ go run postkr.go
(137180) ์์ธ ์์ด๊ตฌ ๋ด๊ณก๋
(412260) ๊ฒฝ๊ธฐ ๊ณ ์์ ๋์๊ตฌ ๋ด๊ณก๋
(210160) ๊ฐ์ ๊ฐ๋ฆ์ ๋ด๊ณก๋
(210701) ๊ฐ์ ๊ฐ๋ฆ์ ๋ด๊ณก๋ ๊ด๋๋
...
Author
Homin Lee <homin.lee@suapapa.net>
Copyright & License
Copyright (c) 2012, Homin Lee.
All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.