Documentation ¶
Index ¶
- Constants
- func CompleteUrl(partial string) string
- func StandardSecDateFormatParse(date string) (time.Time, error)
- func StandardSecDateFormatParseSwallowError(date string) time.Time
- type Client
- func (client *Client) GetAllFactsForTicker(ticker Ticker) (CompanyFacts, error)
- func (client *Client) GetAllTickers() ([]Ticker, error)
- func (client *Client) GetBulk() (chan *TickerWithFacts, error)
- func (client *Client) GetTickerForCIK(cik uint64) (Ticker, error)
- func (client *Client) GetTickerForSymbol(symbol string) (Ticker, error)
- type CompanyFacts
- type Fact
- type Facts
- type PersistenceLayer
- type Ticker
- type TickerWithFacts
- type Unit
- func (unit *Unit) EndAsTime() time.Time
- func (unit *Unit) FiledOnAsTime() time.Time
- func (unit *Unit) IsInstant() bool
- func (unit *Unit) IsPeriod() bool
- func (unit *Unit) IsQuarterRange() bool
- func (unit *Unit) IsYearRange() bool
- func (v Unit) MarshalEasyJSON(w *jwriter.Writer)
- func (v Unit) MarshalJSON() ([]byte, error)
- func (unit *Unit) StartAsTime() time.Time
- func (v *Unit) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *Unit) UnmarshalJSON(data []byte) error
Constants ¶
const SECDateFormat = "2006-01-02"
Variables ¶
This section is empty.
Functions ¶
func CompleteUrl ¶
func StandardSecDateFormatParseSwallowError ¶ added in v0.3.1
Types ¶
type Client ¶ added in v0.4.0
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶ added in v0.4.0
func NewClient() *Client
NewClient creates a new client pointer without any persistence layer, meaning that all requests will go directly to sec.gov and will have to be rate limited.
func NewClientWithPersistence ¶ added in v0.4.0
func NewClientWithPersistence(persistenceLayer PersistenceLayer) *Client
NewClientWithPersistence creates a new client pointer with given persistence layer implementation
func (*Client) GetAllFactsForTicker ¶ added in v0.4.0
func (client *Client) GetAllFactsForTicker(ticker Ticker) (CompanyFacts, error)
func (*Client) GetAllTickers ¶ added in v0.4.0
GetAllTickers Fetches all current tickers from the sec.gov api, uses caching for speed
func (*Client) GetBulk ¶ added in v0.4.0
func (client *Client) GetBulk() (chan *TickerWithFacts, error)
GetBulk fetches ALL company facts, and provides them on the returned channel. This is highly dependent on your connection speed and your computational resources. Typically, it takes a minute or so before the first facts start appearing on the channel. Errors related to parsing of individual facts will be sent in the channel and will not be returned in this function call
func (*Client) GetTickerForCIK ¶ added in v0.4.0
GetTickerForCIK returns the ticker with the given cik
type CompanyFacts ¶
type CompanyFacts struct { CIK uint64 `json:"cik"` EntityName string `json:"entityName"` Facts Facts `json:"facts"` }
func (CompanyFacts) MarshalEasyJSON ¶ added in v0.4.0
func (v CompanyFacts) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CompanyFacts) MarshalJSON ¶ added in v0.4.0
func (v CompanyFacts) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CompanyFacts) UnmarshalEasyJSON ¶ added in v0.4.0
func (v *CompanyFacts) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CompanyFacts) UnmarshalJSON ¶ added in v0.4.0
func (v *CompanyFacts) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Fact ¶
type Fact struct { Label string `json:"label"` Description string `json:"description"` Units map[string][]Unit `json:"units"` }
func (Fact) MarshalEasyJSON ¶ added in v0.4.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Fact) MarshalJSON ¶ added in v0.4.0
MarshalJSON supports json.Marshaler interface
func (*Fact) UnmarshalEasyJSON ¶ added in v0.4.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Fact) UnmarshalJSON ¶ added in v0.4.0
UnmarshalJSON supports json.Unmarshaler interface
type Facts ¶
Facts A representation of a
func (Facts) MarshalEasyJSON ¶ added in v0.4.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Facts) MarshalJSON ¶ added in v0.4.0
MarshalJSON supports json.Marshaler interface
func (*Facts) UnmarshalEasyJSON ¶ added in v0.4.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Facts) UnmarshalJSON ¶ added in v0.4.0
UnmarshalJSON supports json.Unmarshaler interface
type PersistenceLayer ¶ added in v0.1.0
type PersistenceLayer interface { SaveFacts(Ticker, *CompanyFacts) error LoadFacts(Ticker) (*CompanyFacts, error) }
PersistenceLayer is an interface that you can use to create custom persistence layers for the sec client The client makes no assumption about thread safety, that has to be handled by the implementation if required
type Ticker ¶
type Ticker struct { // Central Index Key (CIK) is used on the SEC's computer systems to identify corporations // and individual people who have filed disclosure with the SEC CIK uint64 `json:"cik_str"` // The symbol of the company for example NDAQ Symbol string `json:"ticker"` // The name of the company Name string `json:"title"` }
Ticker Represents a ticker in the given SEC format
type TickerWithFacts ¶ added in v0.4.0
type TickerWithFacts struct { Ticker Ticker CompanyFacts CompanyFacts Error error }
type Unit ¶
type Unit struct { Value float64 `json:"val"` Start string `json:"start"` End string `json:"end"` FiscalYear uint16 `json:"fy"` FiscalPeriod string `json:"fp"` Account string `json:"accn"` Form string `json:"form"` FiledOn string `json:"filed"` }
func (*Unit) FiledOnAsTime ¶ added in v0.3.1
func (*Unit) IsQuarterRange ¶ added in v0.3.1
func (*Unit) IsYearRange ¶ added in v0.3.1
func (Unit) MarshalEasyJSON ¶ added in v0.4.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Unit) MarshalJSON ¶ added in v0.4.0
MarshalJSON supports json.Marshaler interface
func (*Unit) StartAsTime ¶ added in v0.3.1
func (*Unit) UnmarshalEasyJSON ¶ added in v0.4.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Unit) UnmarshalJSON ¶ added in v0.4.0
UnmarshalJSON supports json.Unmarshaler interface