Documentation ¶
Overview ¶
Package client implements API access to EDGAR data. It's rate limited, as required by 1, and uses User-Agent. Don't forget set correct User-Agent using WithUserAgent().
Also see 2 for details.
Index ¶
- Variables
- type ArchiveIndex
- type ArchiveItem
- type CIK
- type Client
- func (self *Client) ArchivesBaseURL() string
- func (self *Client) CompanyFacts(ctx context.Context, cik uint32) (facts CompanyFacts, err error)
- func (self *Client) CompanyTickers(ctx context.Context) ([]CompanyTicker, error)
- func (self *Client) Get(ctx context.Context, url string) (*http.Response, error)
- func (self *Client) GetArchiveFile(ctx context.Context, path string) (*http.Response, error)
- func (self *Client) GetJSON(ctx context.Context, url string, value any) error
- func (self *Client) IndexArchive(ctx context.Context, path string) (index ArchiveIndex, err error)
- func (self *Client) WithApiBaseURL(u string) *Client
- func (self *Client) WithArchivesBaseURL(url string) *Client
- func (self *Client) WithUserAgent(ua string) *Client
- type ClientOption
- type CompanyFact
- type CompanyFacts
- type CompanyTicker
- type FactUnit
- type HttpRequestDoer
- type Limiter
- type Qtr
- type UnexpectedStatusError
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnexpectedStatus = &UnexpectedStatusError{}
Functions ¶
This section is empty.
Types ¶
type ArchiveIndex ¶
type ArchiveIndex struct { Directory struct { Item []ArchiveItem `json:"item"` Name string `json:"name"` ParentDir string `json:"parent-dir"` } `json:"directory"` }
func (*ArchiveIndex) Items ¶
func (self *ArchiveIndex) Items() []ArchiveItem
func (*ArchiveIndex) Name ¶
func (self *ArchiveIndex) Name() string
func (*ArchiveIndex) Parent ¶
func (self *ArchiveIndex) Parent() string
type ArchiveItem ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...ClientOption) *Client
func (*Client) ArchivesBaseURL ¶
func (*Client) CompanyFacts ¶
func (*Client) CompanyTickers ¶
func (self *Client) CompanyTickers(ctx context.Context) ([]CompanyTicker, error)
func (*Client) GetArchiveFile ¶
func (*Client) IndexArchive ¶
func (*Client) WithApiBaseURL ¶
func (*Client) WithArchivesBaseURL ¶
func (*Client) WithUserAgent ¶
type ClientOption ¶
type ClientOption func(c *Client)
func WithHttpClient ¶
func WithHttpClient(client HttpRequestDoer) ClientOption
func WithRateLimiter ¶
func WithRateLimiter(l Limiter) ClientOption
type CompanyFact ¶
type CompanyFacts ¶
type CompanyFacts struct { CIK CIK `json:"cik"` EntityName string `json:"entityName"` Facts map[string]map[string]CompanyFact `json:"facts"` }
func (*CompanyFacts) Id ¶
func (self *CompanyFacts) Id() uint32
type CompanyTicker ¶
type CompanyTicker struct { CIK uint32 `json:"cik_str"` Ticker string `json:"ticker"` Title string `json:"title"` }
func (*CompanyTicker) URI ¶
func (self *CompanyTicker) URI() string
type FactUnit ¶
type FactUnit struct { Start string `json:"start"` End string `json:"end"` Val float64 `json:"val"` Accn string `json:"accn"` FY uint `json:"fy"` FP string `json:"fp"` Form string `json:"form"` Filed string `json:"filed"` Frame string `json:"frame"` }
func (*FactUnit) ParseTimes ¶
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type UnexpectedStatusError ¶
type UnexpectedStatusError struct {
// contains filtered or unexported fields
}
func (*UnexpectedStatusError) Error ¶
func (self *UnexpectedStatusError) Error() string
func (*UnexpectedStatusError) Is ¶
func (self *UnexpectedStatusError) Is(target error) bool
func (*UnexpectedStatusError) Status ¶
func (self *UnexpectedStatusError) Status() string
func (*UnexpectedStatusError) StatusCode ¶
func (self *UnexpectedStatusError) StatusCode() int
Click to show internal directories.
Click to hide internal directories.