Documentation ¶
Index ¶
- type DynamoCheck
- type DynamoHabit
- type DynamoRepository
- func (r *DynamoRepository) AllArchivedHabits(ctx context.Context, uid auth.UserID) ([]*DynamoHabit, error)
- func (r *DynamoRepository) AllHabits(ctx context.Context, uid auth.UserID) ([]*DynamoHabit, error)
- func (r *DynamoRepository) ArchiveHabit(ctx context.Context, uid auth.UserID, hid string) error
- func (r *DynamoRepository) CreateCheck(ctx context.Context, uid auth.UserID, hid, date string) (*DynamoCheck, error)
- func (r *DynamoRepository) CreateHabit(ctx context.Context, uid auth.UserID, title string) (*DynamoHabit, error)
- func (r *DynamoRepository) DeleteCheck(ctx context.Context, uid auth.UserID, hid, date string) error
- func (r *DynamoRepository) DeleteHabit(ctx context.Context, uid auth.UserID, hid string) error
- func (r *DynamoRepository) FindArchivedHabit(ctx context.Context, uid auth.UserID, hid string) (*DynamoHabit, error)
- func (r *DynamoRepository) FindHabit(ctx context.Context, uid auth.UserID, hid string) (*DynamoHabit, error)
- func (r *DynamoRepository) ListLastWeekChecksInAllHabits(ctx context.Context, uid auth.UserID) ([]*DynamoCheck, error)
- func (r *DynamoRepository) ListLatestChecksWithLimit(ctx context.Context, uid auth.UserID, hid string, limit int32) ([]*DynamoCheck, error)
- func (r *DynamoRepository) UnarchiveHabit(ctx context.Context, uid auth.UserID, hid string) error
- func (r *DynamoRepository) UpdateHabit(ctx context.Context, in *DynamoRepositoryUpdateHabitInput) error
- type DynamoRepositoryUpdateHabitInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamoCheck ¶
type DynamoCheck struct { PK string SK string CheckDateLSISK string HabitID string `dynamodbav:"HabitUUID"` Date string CreatedAt time.Time UpdatedAt time.Time }
func NewDynamoCheck ¶
func NewDynamoCheck(userID auth.UserID, habitID, date string) *DynamoCheck
func (*DynamoCheck) GetKey ¶
func (h *DynamoCheck) GetKey() map[string]types.AttributeValue
GetKey returns the composite primary key of the check in a format that can be sent to DynamoDB.
type DynamoHabit ¶
type DynamoHabit struct { PK string SK string ID string `dynamodbav:"UUID"` UserID auth.UserID Title string ChecksCount int CreatedAt time.Time UpdatedAt time.Time }
func NewArchivedDynamoHabit ¶
func NewArchivedDynamoHabit(userID auth.UserID, habitID string) *DynamoHabit
func NewDynamoHabit ¶
func NewDynamoHabit(userID auth.UserID, habitID string) *DynamoHabit
func (*DynamoHabit) GetKey ¶
func (h *DynamoHabit) GetKey() map[string]types.AttributeValue
GetKey returns the composite primary key of the habit in a format that can be sent to DynamoDB.
type DynamoRepository ¶
func (*DynamoRepository) AllArchivedHabits ¶
func (r *DynamoRepository) AllArchivedHabits(ctx context.Context, uid auth.UserID) ([]*DynamoHabit, error)
func (*DynamoRepository) AllHabits ¶
func (r *DynamoRepository) AllHabits(ctx context.Context, uid auth.UserID) ([]*DynamoHabit, error)
func (*DynamoRepository) ArchiveHabit ¶
func (*DynamoRepository) CreateCheck ¶
func (r *DynamoRepository) CreateCheck(ctx context.Context, uid auth.UserID, hid, date string) (*DynamoCheck, error)
func (*DynamoRepository) CreateHabit ¶
func (r *DynamoRepository) CreateHabit(ctx context.Context, uid auth.UserID, title string) (*DynamoHabit, error)
func (*DynamoRepository) DeleteCheck ¶
func (*DynamoRepository) DeleteHabit ¶
func (*DynamoRepository) FindArchivedHabit ¶
func (r *DynamoRepository) FindArchivedHabit(ctx context.Context, uid auth.UserID, hid string) (*DynamoHabit, error)
func (*DynamoRepository) FindHabit ¶
func (r *DynamoRepository) FindHabit(ctx context.Context, uid auth.UserID, hid string) (*DynamoHabit, error)
func (*DynamoRepository) ListLastWeekChecksInAllHabits ¶
func (r *DynamoRepository) ListLastWeekChecksInAllHabits(ctx context.Context, uid auth.UserID) ([]*DynamoCheck, error)
func (*DynamoRepository) ListLatestChecksWithLimit ¶
func (r *DynamoRepository) ListLatestChecksWithLimit(ctx context.Context, uid auth.UserID, hid string, limit int32) ([]*DynamoCheck, error)
func (*DynamoRepository) UnarchiveHabit ¶
func (*DynamoRepository) UpdateHabit ¶
func (r *DynamoRepository) UpdateHabit(ctx context.Context, in *DynamoRepositoryUpdateHabitInput) error
Click to show internal directories.
Click to hide internal directories.