Documentation
¶
Index ¶
- type BenchmarkHandlerImpl
- func (h *BenchmarkHandlerImpl) CreateBenchmark(c fiber.Ctx) error
- func (h *BenchmarkHandlerImpl) DeleteBenchmark(c fiber.Ctx) error
- func (h *BenchmarkHandlerImpl) GetBenchmarkById(c fiber.Ctx) error
- func (h *BenchmarkHandlerImpl) GetBenchmarks(c fiber.Ctx) error
- func (h *BenchmarkHandlerImpl) UpdateBenchmark(c fiber.Ctx) error
- type CreateBenchmarkPayload
- type DeleteBenchmarkById
- type GetBenchmarkByIdParams
- type GetBenchmarksQuery
- type PostgresBenchmarkStore
- func (s *PostgresBenchmarkStore) CreateBenchmark(ctx context.Context, b *types.Benchmark) (types.Benchmark, error)
- func (s *PostgresBenchmarkStore) DeleteBenchmark(ctx context.Context, userId, benchmarkId int) (types.Benchmark, error)
- func (s *PostgresBenchmarkStore) GetBenchmarkById(ctx context.Context, userId, benchmarkId int) (types.Benchmark, error)
- func (s *PostgresBenchmarkStore) GetBenchmarkByName(ctx context.Context, name string, userId int) (types.Benchmark, error)
- func (s *PostgresBenchmarkStore) GetBenchmarks(ctx context.Context, userId int, options *types.GetBenchmarksStoreOptions) ([]types.Benchmark, types.PaginationMetadata, error)
- func (s *PostgresBenchmarkStore) UpdateBenchmark(ctx context.Context, b *types.Benchmark) (types.Benchmark, error)
- type UpdateBenchmarkById
- type UpdateBenchmarkPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BenchmarkHandlerImpl ¶
type BenchmarkHandlerImpl struct {
// contains filtered or unexported fields
}
func NewBenchmarkHandler ¶
func NewBenchmarkHandler(userStore types.UserStore, benchmarkStore types.BenchmarkStore, logger *slog.Logger) *BenchmarkHandlerImpl
func (*BenchmarkHandlerImpl) CreateBenchmark ¶
func (h *BenchmarkHandlerImpl) CreateBenchmark(c fiber.Ctx) error
func (*BenchmarkHandlerImpl) DeleteBenchmark ¶
func (h *BenchmarkHandlerImpl) DeleteBenchmark(c fiber.Ctx) error
func (*BenchmarkHandlerImpl) GetBenchmarkById ¶
func (h *BenchmarkHandlerImpl) GetBenchmarkById(c fiber.Ctx) error
func (*BenchmarkHandlerImpl) GetBenchmarks ¶
func (h *BenchmarkHandlerImpl) GetBenchmarks(c fiber.Ctx) error
func (*BenchmarkHandlerImpl) UpdateBenchmark ¶
func (h *BenchmarkHandlerImpl) UpdateBenchmark(c fiber.Ctx) error
type CreateBenchmarkPayload ¶
type CreateBenchmarkPayload struct { Name string `json:"name"` Description string `json:"description"` Asset_allocation []types.AssetAllocationPct `json:"asset_allocation"` Std_dev_pct float32 `json:"std_dev_pct"` Real_return_pct float32 `json:"real_return_pct"` Drawdown_yrs int `json:"drawdown_yrs"` Is_deprecated bool `json:"is_deprecated"` }
func (CreateBenchmarkPayload) Validate ¶
func (p CreateBenchmarkPayload) Validate() error
type DeleteBenchmarkById ¶
type DeleteBenchmarkById struct {
Id int
}
func (DeleteBenchmarkById) Validate ¶
func (p DeleteBenchmarkById) Validate() error
type GetBenchmarkByIdParams ¶
type GetBenchmarkByIdParams struct {
Id int
}
func (GetBenchmarkByIdParams) Validate ¶
func (p GetBenchmarkByIdParams) Validate() error
type GetBenchmarksQuery ¶
type GetBenchmarksQuery struct { Ids []int `json:"ids"` Name string `json:"name"` Is_deprecated string `json:"is_deprecated"` types.PaginationQuery }
func (GetBenchmarksQuery) Validate ¶
func (q GetBenchmarksQuery) Validate() error
type PostgresBenchmarkStore ¶
type PostgresBenchmarkStore struct {
// contains filtered or unexported fields
}
func NewPostgresBenchmarkStore ¶
func NewPostgresBenchmarkStore(db *pgxpool.Pool, logger *slog.Logger) *PostgresBenchmarkStore
func (*PostgresBenchmarkStore) CreateBenchmark ¶
func (*PostgresBenchmarkStore) DeleteBenchmark ¶
func (*PostgresBenchmarkStore) GetBenchmarkById ¶
func (*PostgresBenchmarkStore) GetBenchmarkByName ¶
func (*PostgresBenchmarkStore) GetBenchmarks ¶
func (s *PostgresBenchmarkStore) GetBenchmarks(ctx context.Context, userId int, options *types.GetBenchmarksStoreOptions) ([]types.Benchmark, types.PaginationMetadata, error)
func (*PostgresBenchmarkStore) UpdateBenchmark ¶
type UpdateBenchmarkById ¶
type UpdateBenchmarkById struct {
Id int
}
func (UpdateBenchmarkById) Validate ¶
func (p UpdateBenchmarkById) Validate() error
type UpdateBenchmarkPayload ¶
type UpdateBenchmarkPayload struct { Name string `json:"name"` Description string `json:"description"` Asset_allocation []types.AssetAllocationPct `json:"asset_allocation"` Std_dev_pct float32 `json:"std_dev_pct"` Real_return_pct float32 `json:"real_return_pct"` Drawdown_yrs int `json:"drawdown_yrs"` Is_deprecated bool `json:"is_deprecated"` }
func (UpdateBenchmarkPayload) Validate ¶
func (p UpdateBenchmarkPayload) Validate() error
Source Files
¶
- handler.go
- handler_createbenchmark.go
- handler_deletebenchmark.go
- handler_getbenchmarkbyid.go
- handler_getbenchmarks.go
- handler_updatebenchmark.go
- schema_createbenchmark.go
- schema_deletebenchmark.go
- schema_getbenchmarkbyid.go
- schema_getbenchmarks.go
- schema_updatebenchmark.go
- store.go
- store_createbenchmark.go
- store_deletebenchmark.go
- store_getbenchmarkbyid.go
- store_getbenchmarkbyname.go
- store_getbenchmarks.go
- store_updatebenchmark.go
Click to show internal directories.
Click to hide internal directories.