Documentation
¶
Index ¶
- type CreateAssociationConditions
- type ListCardsRequest
- func (req ListCardsRequest) Where() []glinq.QueryString
- func (req ListCardsRequest) WhereCardIndexIn(indices []protomodels.CardIndex) ListCardsRequest
- func (req ListCardsRequest) WhereLabelContains(label string) ListCardsRequest
- func (req ListCardsRequest) WhereLanguage(lang protomodels.Language) ListCardsRequest
- func (req ListCardsRequest) WhereNeedReview(today itime.UnixTime) ListCardsRequest
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateAssociationConditions ¶
type CreateAssociationConditions struct {
CardIndex protomodels.CardIndex
RelatedCardIndex protomodels.CardIndex
Association protomodels.AssociationTypes
}
type ListCardsRequest ¶
type ListCardsRequest struct {
// contains filtered or unexported fields
}
func NewListCardRequest ¶
func NewListCardRequest() ListCardsRequest
func (ListCardsRequest) Where ¶
func (req ListCardsRequest) Where() []glinq.QueryString
func (ListCardsRequest) WhereCardIndexIn ¶
func (req ListCardsRequest) WhereCardIndexIn(indices []protomodels.CardIndex) ListCardsRequest
func (ListCardsRequest) WhereLabelContains ¶
func (req ListCardsRequest) WhereLabelContains(label string) ListCardsRequest
func (ListCardsRequest) WhereLanguage ¶
func (req ListCardsRequest) WhereLanguage(lang protomodels.Language) ListCardsRequest
func (ListCardsRequest) WhereNeedReview ¶
func (req ListCardsRequest) WhereNeedReview(today itime.UnixTime) ListCardsRequest
type Storage ¶
type Storage interface {
// todo : refactor with builder pattern
ListCards(ctx context.Context, req ListCardsRequest) ([]protomodels.Card, error)
ListCardIndices(ctx context.Context) ([]protomodels.CardIndex, error)
GetAssociations(ctx context.Context, cardIndex protomodels.CardIndex) (protomodels.RelatedCards, error)
CreateAssociation(ctx context.Context, conditions CreateAssociationConditions) error
// upsert to logs NewCards++
CreateCard(ctx context.Context, card protomodels.Card) error
// zero values will NOT been updated
UpdateCard(ctx context.Context, card protomodels.Card) error
DeleteCard(ctx context.Context, cardIndex protomodels.CardIndex) error
GetLog(ctx context.Context, date time.Time) (protomodels.Log, error)
ListLogs(ctx context.Context, from time.Time, until time.Time) ([]protomodels.Log, error)
// upsert to logs ReviewedCards++
// update card review date
ReviewCard(ctx context.Context, cardIndex protomodels.CardIndex) error
}
Click to show internal directories.
Click to hide internal directories.