Documentation ¶
Index ¶
- type FactLabels
- type FactUnit
- type Postgreser
- type Repo
- func (self *Repo) AddCompany(ctx context.Context, cik uint32, name string) (bool, error)
- func (self *Repo) AddFact(ctx context.Context, tax, name string) (uint32, error)
- func (self *Repo) AddFactUnit(ctx context.Context, fact FactUnit) error
- func (self *Repo) AddLabel(ctx context.Context, factId uint32, label, descr string, ...) error
- func (self *Repo) AddLastUpdate(ctx context.Context, at time.Time) error
- func (self *Repo) AddUnit(ctx context.Context, name string) (uint32, error)
- func (self *Repo) CopyFactUnits(ctx context.Context, length int, next func(i int) (FactUnit, error)) error
- func (self *Repo) FactLabels(ctx context.Context) ([]FactLabels, error)
- func (self *Repo) FiledCounts(ctx context.Context, cik uint32) (map[time.Time]uint32, error)
- func (self *Repo) LastFiled(ctx context.Context) (map[uint32]time.Time, error)
- func (self *Repo) LastUpdated(ctx context.Context) (lastUpdated time.Time, err error)
- func (self *Repo) ReplaceFactUnits(ctx context.Context, cik uint32, lastFiled time.Time, length int, ...) error
- func (self *Repo) Units(ctx context.Context) (map[uint32]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FactLabels ¶
type FactUnit ¶
type FactUnit struct { CIK uint32 `db:"company_cik"` FactId uint32 `db:"fact_id"` UnitId uint32 `db:"unit_id"` Start pgtype.Date `db:"fact_start"` End time.Time `db:"fact_end"` Val float64 `db:"val"` Accn string `db:"accn"` FY uint `db:"fy"` FP string `db:"fp"` Form string `db:"form"` Filed time.Time `db:"filed"` Frame pgtype.Text `db:"frame"` }
type Postgreser ¶
type Postgreser interface { Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error) Begin(ctx context.Context) (pgx.Tx, error) }
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func New ¶
func New(db Postgreser) *Repo
func (*Repo) AddCompany ¶
func (*Repo) AddLastUpdate ¶
func (*Repo) CopyFactUnits ¶
func (*Repo) FactLabels ¶
func (self *Repo) FactLabels(ctx context.Context) ([]FactLabels, error)
func (*Repo) FiledCounts ¶
func (*Repo) LastUpdated ¶
func (*Repo) ReplaceFactUnits ¶
Click to show internal directories.
Click to hide internal directories.