Documentation
¶
Index ¶
- type CreateHoldingPayload
- type DeleteHoldingParams
- type GetHoldingByIdParams
- type GetHoldingsQuery
- type HoldingHandlerImpl
- func (h *HoldingHandlerImpl) CreateHolding(c fiber.Ctx) error
- func (h *HoldingHandlerImpl) DeleteHolding(c fiber.Ctx) error
- func (h *HoldingHandlerImpl) GetHoldingById(c fiber.Ctx) error
- func (h *HoldingHandlerImpl) GetHoldings(c fiber.Ctx) error
- func (h *HoldingHandlerImpl) UpdateHolding(c fiber.Ctx) error
- type PostgresHoldingStore
- func (s *PostgresHoldingStore) CreateHolding(ctx context.Context, h *types.Holding) (types.Holding, error)
- func (s *PostgresHoldingStore) DeleteHolding(ctx context.Context, userId, holdingId int) (types.Holding, error)
- func (s *PostgresHoldingStore) GetHoldingById(ctx context.Context, userId, holdingId int) (types.Holding, error)
- func (s *PostgresHoldingStore) GetHoldingByName(ctx context.Context, name string, userId int) (types.Holding, error)
- func (s *PostgresHoldingStore) GetHoldingByTicker(ctx context.Context, ticker string, userId int) (types.Holding, error)
- func (s *PostgresHoldingStore) GetHoldings(ctx context.Context, userId int, options *types.GetHoldingsStoreOptions) ([]types.Holding, types.PaginationMetadata, error)
- func (s *PostgresHoldingStore) UpdateHolding(ctx context.Context, h *types.Holding) (types.Holding, error)
- type UpdateHoldingParams
- type UpdateHoldingPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateHoldingPayload ¶
type CreateHoldingPayload struct {
Name string `json:"name"`
Ticker string `json:"ticker,omitempty"`
Asset_category types.AssetCategory `json:"asset_category"`
Expense_ratio_pct float32 `json:"expense_ratio_pct,omitempty"`
Maturation_date string `json:"maturation_date,omitempty"`
Interest_rate_pct float32 `json:"interest_rate_pct,omitempty"`
Is_deprecated bool `json:"is_deprecated"`
}
func (CreateHoldingPayload) Validate ¶
func (p CreateHoldingPayload) Validate() error
type DeleteHoldingParams ¶
type DeleteHoldingParams struct {
Id int `json:"id"`
}
func (DeleteHoldingParams) Validate ¶
func (p DeleteHoldingParams) Validate() error
type GetHoldingByIdParams ¶
type GetHoldingByIdParams struct {
Id int `json:"id"`
}
func (GetHoldingByIdParams) Validate ¶
func (p GetHoldingByIdParams) Validate() error
type GetHoldingsQuery ¶
type GetHoldingsQuery struct {
Ids []int `json:"ids"`
Ticker string `json:"ticker"`
Asset_category types.AssetCategory `json:"asset_category"`
Is_deprecated string `json:"is_deprecated"`
Has_maturation_remaining string `json:"has_maturation_remaining"`
types.PaginationQuery
}
func (GetHoldingsQuery) Validate ¶
func (q GetHoldingsQuery) Validate() error
type HoldingHandlerImpl ¶
type HoldingHandlerImpl struct {
// contains filtered or unexported fields
}
func NewHoldingHandler ¶
func NewHoldingHandler(store types.HoldingStore, logger *slog.Logger) *HoldingHandlerImpl
func (*HoldingHandlerImpl) CreateHolding ¶
func (h *HoldingHandlerImpl) CreateHolding(c fiber.Ctx) error
func (*HoldingHandlerImpl) DeleteHolding ¶
func (h *HoldingHandlerImpl) DeleteHolding(c fiber.Ctx) error
func (*HoldingHandlerImpl) GetHoldingById ¶
func (h *HoldingHandlerImpl) GetHoldingById(c fiber.Ctx) error
func (*HoldingHandlerImpl) GetHoldings ¶
func (h *HoldingHandlerImpl) GetHoldings(c fiber.Ctx) error
func (*HoldingHandlerImpl) UpdateHolding ¶
func (h *HoldingHandlerImpl) UpdateHolding(c fiber.Ctx) error
type PostgresHoldingStore ¶
type PostgresHoldingStore struct {
// contains filtered or unexported fields
}
func NewPostgresHoldingStore ¶
func NewPostgresHoldingStore(db *pgxpool.Pool, logger *slog.Logger) *PostgresHoldingStore
func (*PostgresHoldingStore) CreateHolding ¶
func (*PostgresHoldingStore) DeleteHolding ¶
func (*PostgresHoldingStore) GetHoldingById ¶
func (*PostgresHoldingStore) GetHoldingByName ¶
func (*PostgresHoldingStore) GetHoldingByTicker ¶
func (*PostgresHoldingStore) GetHoldings ¶
func (s *PostgresHoldingStore) GetHoldings(ctx context.Context, userId int, options *types.GetHoldingsStoreOptions) ([]types.Holding, types.PaginationMetadata, error)
func (*PostgresHoldingStore) UpdateHolding ¶
type UpdateHoldingParams ¶
type UpdateHoldingParams struct {
Id int `json:"id"`
}
func (UpdateHoldingParams) Validate ¶
func (p UpdateHoldingParams) Validate() error
type UpdateHoldingPayload ¶
type UpdateHoldingPayload struct {
Name string `json:"name"`
Ticker string `json:"ticker,omitempty"`
Asset_category types.AssetCategory `json:"asset_category"`
Expense_ratio_pct float32 `json:"expense_ratio_pct,omitempty"`
Maturation_date string `json:"maturation_date,omitempty"`
Interest_rate_pct float32 `json:"interest_rate_pct,omitempty"`
Is_deprecated bool `json:"is_deprecated"`
}
func (UpdateHoldingPayload) Validate ¶
func (p UpdateHoldingPayload) Validate() error
Source Files
¶
- handler.go
- handler_createholding.go
- handler_deleteholding.go
- handler_getholdingbyid.go
- handler_getholdings.go
- handler_updateholding.go
- schema_createholding.go
- schema_deleteholding.go
- schema_getholdingbyid.go
- schema_getholdings.go
- schema_updateholding.go
- store.go
- store_createholding.go
- store_deleteholding.go
- store_getholdingbyid.go
- store_getholdingbyname.go
- store_getholdingbyticker.go
- store_getholdings.go
- store_updateholding.go
Click to show internal directories.
Click to hide internal directories.