Documentation
¶
Index ¶
- type CreateSnapshotPayload
- type DeleteSnapshotParams
- type GetSnapshotByIdParams
- type GetSnapshotByIdQuery
- type GetSnapshotsQuery
- type GroupByCategory
- type HandleGroupByResourceOptions
- type PostgresSnapshotStore
- func (s *PostgresSnapshotStore) CreateSnapshot(ctx context.Context, snapshot *types.Snapshot) (types.Snapshot, error)
- func (s *PostgresSnapshotStore) DeleteSnapshot(ctx context.Context, snapId, userId int) (types.Snapshot, error)
- func (s *PostgresSnapshotStore) GetSnapshotByDate(ctx context.Context, snapshotDate string, userId int) (types.Snapshot, error)
- func (s *PostgresSnapshotStore) GetSnapshotById(ctx context.Context, snapshotId, userId int) (types.Snapshot, []types.SnapshotValue, error)
- func (s *PostgresSnapshotStore) GetSnapshotTotal(ctx context.Context, userId, snapId int, ...) (total float64, e error)
- func (s *PostgresSnapshotStore) GetSnapshots(ctx context.Context, userId int, options *types.GetSnapshotsStoreOptions) ([]types.Snapshot, types.PaginationMetadata, error)
- func (s *PostgresSnapshotStore) GroupByAccount(ctx context.Context, snapId, userId int, ...) (types.ResourcesGrouped, error)
- func (s *PostgresSnapshotStore) GroupByHolding(ctx context.Context, userId, snapId int, ...) (types.ResourcesGrouped, error)
- func (s *PostgresSnapshotStore) GroupByLiquidity(ctx context.Context, userId, snapId int) ([]types.LiquidityResource, float64, error)
- func (s *PostgresSnapshotStore) GroupByMaturationDate(ctx context.Context, userId, snapId int, ...) ([]types.MaturationDateResource, error)
- func (s *PostgresSnapshotStore) RefreshSnapshotTotal(ctx context.Context, userId, snapshotId int) (float64, error)
- func (s *PostgresSnapshotStore) RefreshSnapshotWeightedER(ctx context.Context, userId, snapId int) (weightedER float64, e error)
- func (s *PostgresSnapshotStore) UpdateSnapshot(ctx context.Context, snap *types.Snapshot) (types.Snapshot, error)
- type SnapshotHandlerImpl
- func (h *SnapshotHandlerImpl) CreateSnapshot(c fiber.Ctx) error
- func (h *SnapshotHandlerImpl) DeleteSnapshot(c fiber.Ctx) error
- func (h *SnapshotHandlerImpl) GetSnapshotById(c fiber.Ctx) error
- func (h *SnapshotHandlerImpl) GetSnapshots(c fiber.Ctx) error
- func (h *SnapshotHandlerImpl) RebalanceSnapshot(c fiber.Ctx) error
- func (h *SnapshotHandlerImpl) UpdateSnapshot(c fiber.Ctx) error
- type UpdateSnapshotParams
- type UpdateSnapshotPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateSnapshotPayload ¶
type CreateSnapshotPayload struct { Snap_date string `json:"snap_date"` Description string `json:"description"` Snapshot_values []snapshotvalue.CreateSnapshotValuePayload `json:"snapshot_values"` Benchmark_id int `json:"benchmark_id"` }
func (CreateSnapshotPayload) Validate ¶
func (p CreateSnapshotPayload) Validate() error
type DeleteSnapshotParams ¶
type DeleteSnapshotParams struct {
Id int `json:"id"`
}
func (DeleteSnapshotParams) Validate ¶
func (p DeleteSnapshotParams) Validate() error
type GetSnapshotByIdParams ¶
type GetSnapshotByIdParams struct {
Id int `json:"id"`
}
func (GetSnapshotByIdParams) Validate ¶
func (p GetSnapshotByIdParams) Validate() error
type GetSnapshotByIdQuery ¶
type GetSnapshotByIdQuery struct { Group_by string `json:"group_by"` // Easier to analyze this as a string so we don't have to worry about setting up a reflection case for this as an enum Maturation_start string `json:"maturation_start"` Maturation_end string `json:"maturation_end"` }
func (GetSnapshotByIdQuery) Validate ¶
func (q GetSnapshotByIdQuery) Validate() error
type GetSnapshotsQuery ¶
type GetSnapshotsQuery struct { Snap_ids []int `json:"snap_ids"` Snap_date_lower string `json:"snap_date_lower"` // mm/dd/yyyy Snap_date_upper string `json:"snap_date_upper"` // mm/dd/yyyy Order_date_by string `json:"order_date_by"` // ASC or DESC types.PaginationQuery }
func (GetSnapshotsQuery) Validate ¶
func (q GetSnapshotsQuery) Validate() error
type GroupByCategory ¶
type GroupByCategory string
const ( BY_ACCOUNT_NAME GroupByCategory = "ACCOUNT_NAME" BY_ACCOUNT_INSTITUTION GroupByCategory = "ACCOUNT_INSTITUTION" BY_TAX_SHELTER GroupByCategory = "TAX_SHELTER" BY_ASSET_CATEGORY GroupByCategory = "ASSET_CATEGORY" BY_MATURATION_DATE GroupByCategory = "MATURATION_DATE" BY_LIQUIDITY GroupByCategory = "LIQUIDITY" )
type PostgresSnapshotStore ¶
type PostgresSnapshotStore struct {
// contains filtered or unexported fields
}
func NewPostgresSnapshotStore ¶
func NewPostgresSnapshotStore(db *pgxpool.Pool, logger *slog.Logger) *PostgresSnapshotStore
func (*PostgresSnapshotStore) CreateSnapshot ¶
func (*PostgresSnapshotStore) DeleteSnapshot ¶
func (*PostgresSnapshotStore) GetSnapshotByDate ¶
func (*PostgresSnapshotStore) GetSnapshotById ¶
func (s *PostgresSnapshotStore) GetSnapshotById(ctx context.Context, snapshotId, userId int) (types.Snapshot, []types.SnapshotValue, error)
func (*PostgresSnapshotStore) GetSnapshotTotal ¶
func (s *PostgresSnapshotStore) GetSnapshotTotal(ctx context.Context, userId, snapId int, options *types.GetSnapshotTotalStoreOptions) (total float64, e error)
func (*PostgresSnapshotStore) GetSnapshots ¶
func (s *PostgresSnapshotStore) GetSnapshots(ctx context.Context, userId int, options *types.GetSnapshotsStoreOptions) ([]types.Snapshot, types.PaginationMetadata, error)
func (*PostgresSnapshotStore) GroupByAccount ¶
func (s *PostgresSnapshotStore) GroupByAccount(ctx context.Context, snapId, userId int, options *types.GetGroupByAccountStoreOptions) (types.ResourcesGrouped, error)
func (*PostgresSnapshotStore) GroupByHolding ¶
func (s *PostgresSnapshotStore) GroupByHolding(ctx context.Context, userId, snapId int, options *types.GetGroupByHoldingStoreOptions) (types.ResourcesGrouped, error)
func (*PostgresSnapshotStore) GroupByLiquidity ¶
func (s *PostgresSnapshotStore) GroupByLiquidity(ctx context.Context, userId, snapId int) ([]types.LiquidityResource, float64, error)
func (*PostgresSnapshotStore) GroupByMaturationDate ¶
func (s *PostgresSnapshotStore) GroupByMaturationDate(ctx context.Context, userId, snapId int, options *types.GetGroupByMaturationDateStoreOptions) ([]types.MaturationDateResource, error)
func (*PostgresSnapshotStore) RefreshSnapshotTotal ¶
func (*PostgresSnapshotStore) RefreshSnapshotWeightedER ¶
func (*PostgresSnapshotStore) UpdateSnapshot ¶
type SnapshotHandlerImpl ¶
type SnapshotHandlerImpl struct {
// contains filtered or unexported fields
}
func NewSnapshotHandler ¶
func NewSnapshotHandler( userStore types.UserStore, benchmarkStore types.BenchmarkStore, accountStore types.AccountStore, holdingStore types.HoldingStore, snapshotStore types.SnapshotStore, snapshotValueStore types.SnapshotValueStore, logger *slog.Logger, ) *SnapshotHandlerImpl
func (*SnapshotHandlerImpl) CreateSnapshot ¶
func (h *SnapshotHandlerImpl) CreateSnapshot(c fiber.Ctx) error
func (*SnapshotHandlerImpl) DeleteSnapshot ¶
func (h *SnapshotHandlerImpl) DeleteSnapshot(c fiber.Ctx) error
func (*SnapshotHandlerImpl) GetSnapshotById ¶
func (h *SnapshotHandlerImpl) GetSnapshotById(c fiber.Ctx) error
func (*SnapshotHandlerImpl) GetSnapshots ¶
func (h *SnapshotHandlerImpl) GetSnapshots(c fiber.Ctx) error
func (*SnapshotHandlerImpl) RebalanceSnapshot ¶
func (h *SnapshotHandlerImpl) RebalanceSnapshot(c fiber.Ctx) error
func (*SnapshotHandlerImpl) UpdateSnapshot ¶
func (h *SnapshotHandlerImpl) UpdateSnapshot(c fiber.Ctx) error
type UpdateSnapshotParams ¶
type UpdateSnapshotParams struct {
Id int `json:"id"`
}
func (UpdateSnapshotParams) Validate ¶
func (p UpdateSnapshotParams) Validate() error
type UpdateSnapshotPayload ¶
type UpdateSnapshotPayload struct { Snap_date string `json:"snap_date"` Description string `json:"description"` Benchmark_id int `json:"benchmark_id"` }
func (UpdateSnapshotPayload) Validate ¶
func (p UpdateSnapshotPayload) Validate() error
Source Files
¶
- handler.go
- handler_createsnapshot.go
- handler_deletesnapshot.go
- handler_getsnapshotbyid.go
- handler_getsnapshots.go
- handler_rebalancesnapshot.go
- handler_updatesnapshot.go
- schema_createsnapshot.go
- schema_deletesnapshot.go
- schema_getsnapshotbyid.go
- schema_getsnapshots.go
- schema_updatesnapshot.go
- store.go
- store_createsnapshot.go
- store_deletesnapshot.go
- store_getsnapshotbydate.go
- store_getsnapshotbyid.go
- store_getsnapshots.go
- store_getsnapshottotal.go
- store_groupbyaccount.go
- store_groupbyholding.go
- store_groupbyliquidity.go
- store_groupbymaturationdate.go
- store_refreshtotal.go
- store_refreshweighteder.go
- store_updatesnapshot.go
Click to show internal directories.
Click to hide internal directories.