Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
func Convert(event HappinessRatingEvent) happinessrating.HappinessRating
Convert from the DAO event to the aggregate
Types ¶
type HappinessRatingEvent ¶
type HappinessRatingEvent struct { UserID string `dynamo:"user_id,hash"` Time time.Time `dynamo:"time,range"` Score int `dynamo:"score"` Notes string `dynamo:"notes,omitempty"` }
HappinessRatingEvent is the event stored in the event store It is considered the source of truth
type HappinessRatingEventDAO ¶
type HappinessRatingEventDAO struct {
// contains filtered or unexported fields
}
HappinessRatingEventDAO is the access layer to the happiness events
func New ¶
func New(ratingTableName string, db *dynamo.DB) *HappinessRatingEventDAO
New returns a new DAO to access happiness events
func (*HappinessRatingEventDAO) GetRatings ¶
func (d *HappinessRatingEventDAO) GetRatings(ctx context.Context, input happinessrating.GetRatingsInput) (results []happinessrating.HappinessRating, err error)
GetRatings gets all ratings by partition key
func (*HappinessRatingEventDAO) Rate ¶
func (d *HappinessRatingEventDAO) Rate(ctx context.Context, rating happinessrating.RateInput) error
Rate allows one to rate their happiness
Click to show internal directories.
Click to hide internal directories.