Documentation
¶
Overview ¶
Package opendart 는 DART 전자공시 OpenAPI 의 Go 클라이언트다.
Index ¶
- Variables
- type APIError
- type Client
- func (c *Client) CorpCodes(ctx context.Context) ([]CorpCodeEntry, error)
- func (c *Client) LookupCorpCode(ctx context.Context, corpCode string) (CorpCodeEntry, error)
- func (c *Client) RefreshCorpCodes(ctx context.Context) error
- func (c *Client) ResolveCorpCode(ctx context.Context, stockCode string) (string, error)
- type CorpCodeEntry
- type Option
Constants ¶
This section is empty.
Variables ¶
var ErrCorpCodeNotFound = errors.New("opendart: corp_code not found")
ErrCorpCodeNotFound 는 종목코드/고유번호 매핑 실패.
var ErrNoData = httpclient.ErrNoData
ErrNoData 는 status 013 (조회된 데이터 없음).
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError = httpclient.APIError
APIError 는 OpenDART status != "000" 응답. errors.As 로 Status/Message 접근.
type Client ¶
type Client struct {
Disclosure *disclosure.Client // DS001 공시정보
Report *report.Client // DS002 정기보고서 주요정보
Ownership *ownership.Client // DS004 지분공시 종합정보
Material *material.Client // DS005 주요사항보고서 주요정보
Registration *registration.Client // DS006 증권신고서 주요정보
// contains filtered or unexported fields
}
Client 는 opendart 라이브러리의 단일 진입점.
func NewClientFromEnv ¶
NewClientFromEnv 는 OPENDART_API_KEY 환경변수로 Client 를 만든다.
func (*Client) CorpCodes ¶
func (c *Client) CorpCodes(ctx context.Context) ([]CorpCodeEntry, error)
CorpCodes 는 전체 회사 엔트리를 반환한다 (사용자 직접 필터용).
func (*Client) LookupCorpCode ¶
LookupCorpCode 는 corp_code(8자리)로 회사 엔트리를 조회한다.
func (*Client) RefreshCorpCodes ¶
RefreshCorpCodes 는 TTL 을 무시하고 corp_code 매핑을 강제 재다운로드한다.
type CorpCodeEntry ¶
CorpCodeEntry 는 corp_code 매핑의 한 회사. (internal 타입 별칭 — 외부에서 opendart.CorpCodeEntry 로 사용)
type Option ¶
type Option func(*clientOptions)
Option 은 functional option.
func WithCorpCodeCacheDir ¶
WithCorpCodeCacheDir 는 corp_code 캐시 디렉토리를 지정한다.
func WithCorpCodeCacheTTL ¶
WithCorpCodeCacheTTL 은 corp_code 재다운로드 주기를 지정한다 (기본 24h).
func WithHTTPClient ¶
WithHTTPClient 는 사용자 정의 *http.Client 를 주입한다 (기본: TLS RSA cipher 내장).
Directories
¶
| Path | Synopsis |
|---|---|
|
Package disclosure 는 OpenDART DS001 공시정보 API sub-client 다.
|
Package disclosure 는 OpenDART DS001 공시정보 API sub-client 다. |
|
examples
|
|
|
disclosure
command
examples/disclosure — DS001 공시정보 사용 예제.
|
examples/disclosure — DS001 공시정보 사용 예제. |
|
report
command
examples/report — DS002 정기보고서 주요정보(지분·주식·배당) 사용 예제.
|
examples/report — DS002 정기보고서 주요정보(지분·주식·배당) 사용 예제. |
|
internal
|
|
|
corpcode
Package corpcode 는 OpenDART 고유번호(corpCode.xml) 의 디스크 캐시 + 인덱스다.
|
Package corpcode 는 OpenDART 고유번호(corpCode.xml) 의 디스크 캐시 + 인덱스다. |
|
httpclient
Package httpclient 는 OpenDART REST 호출의 단일 GET 통로다.
|
Package httpclient 는 OpenDART REST 호출의 단일 GET 통로다. |
|
Package material 는 OpenDART DS005 주요사항보고서 주요정보 API sub-client 다.
|
Package material 는 OpenDART DS005 주요사항보고서 주요정보 API sub-client 다. |
|
Package ownership 는 OpenDART DS004 지분공시 종합정보 API sub-client 다.
|
Package ownership 는 OpenDART DS004 지분공시 종합정보 API sub-client 다. |
|
Package report 는 OpenDART DS002 정기보고서 주요정보 API sub-client 다.
|
Package report 는 OpenDART DS002 정기보고서 주요정보 API sub-client 다. |
|
scripts
|
|
|
crawl
command
|