db

package
v0.0.0-...-64e57e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package db implements database interactions for neutral-diet service RPCs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FoodItemInfo

type FoodItemInfo struct {
	TypologyName    string
	SubTypologyName string
	N               int64
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store represents a connection pool to the database.

func NewStore

func NewStore(dbPool *pgxpool.Pool) *Store

NewStore create a Store instance

func (*Store) AddCarbonFootprintGoal

func (s *Store) AddCarbonFootprintGoal(
	ctx context.Context,
	r *userv1.AddCarbonFootprintGoalRequest,
	firebaseUID string,
) (*userv1.AddCarbonFootprintGoalResponse, error)

func (*Store) AddDevice

func (s *Store) AddDevice(
	ctx context.Context,
	r *userv1.AddDeviceRequest,
	firebaseUID string,
) (*userv1.AddDeviceResponse, error)

func (*Store) AddFoodItemToLog

func (s *Store) AddFoodItemToLog(
	ctx context.Context,
	r *userv1.AddFoodItemRequest,
	firebaseUID string,
) (*userv1.AddFoodItemResponse, error)

func (*Store) CreateFoodItem

func (*Store) CreateLifeCycle

func (*Store) CreateSource

func (*Store) CreateTypology

func (*Store) CreateUser

func (*Store) DeleteCarbonFootprintGoal

func (s *Store) DeleteCarbonFootprintGoal(
	ctx context.Context,
	r *userv1.DeleteCarbonFootprintGoalRequest,
	firebaseUID string,
) (*userv1.DeleteCarbonFootprintGoalResponse, error)

func (*Store) DeleteFoodItemFromLog

func (s *Store) DeleteFoodItemFromLog(
	ctx context.Context,
	r *userv1.DeleteFoodItemRequest,
	firebaseUID string,
) (*userv1.DeleteFoodItemResponse, error)

func (*Store) DeleteUser

func (s *Store) DeleteUser(
	ctx context.Context,
	firebaseUID string,
) (*userv1.DeleteUserResponse, error)

func (*Store) GetCarbonFootprintGoals

func (s *Store) GetCarbonFootprintGoals(
	ctx context.Context,
	r *userv1.GetCarbonFootprintGoalsRequest,
	firebaseUID string,
) (*userv1.GetCarbonFootprintGoalsResponse, error)

func (*Store) GetFoodItemInfo

func (*Store) GetFoodItemLog

func (s *Store) GetFoodItemLog(
	ctx context.Context,
	r *userv1.GetFoodItemLogRequest,
	firebaseUID string,
) (*userv1.GetFoodItemLogResponse, error)

func (*Store) GetFoodItemLogDays

func (s *Store) GetFoodItemLogDays(
	ctx context.Context,
	r *userv1.GetFoodItemLogDaysRequest,
	firebaseUID string,
) (*userv1.GetFoodItemLogDaysResponse, error)

func (*Store) GetUser

func (s *Store) GetUser(
	ctx context.Context,
	firebaseUID string,
) (*userv1.GetUserSettingsResponse, error)

func (*Store) GetUserInsights

func (s *Store) GetUserInsights(
	ctx context.Context,
	r *userv1.GetUserInsightsRequest,
	firebaseUID string,
) (*userv1.GetUserInsightsResponse, error)

func (*Store) GetUserProgress

func (s *Store) GetUserProgress(
	ctx context.Context,
	r *userv1.GetUserProgressRequest,
	firebaseUID string,
) (*userv1.GetUserProgressResponse, error)

func (*Store) ListSubTypologyNames

func (s *Store) ListSubTypologyNames(
	ctx context.Context,
) (*foodv1.ListSubTypologyNamesResponse, error)

func (*Store) ListTypologyNames

func (s *Store) ListTypologyNames(
	ctx context.Context,
) (*foodv1.ListTypologyNamesResponse, error)

func (*Store) MarkCompletedGoals

func (s *Store) MarkCompletedGoals(ctx context.Context)

func (*Store) RemoveStaleRegistrationTokens

func (s *Store) RemoveStaleRegistrationTokens(ctx context.Context)

func (*Store) SendGoalNotifications

func (s *Store) SendGoalNotifications(ctx context.Context, m *messaging.Client)

func (*Store) SendStreakNotifications

func (s *Store) SendStreakNotifications(ctx context.Context, m *messaging.Client)

func (*Store) UpdateCarbonFootprintGoal

func (s *Store) UpdateCarbonFootprintGoal(
	ctx context.Context,
	r *userv1.UpdateCarbonFootprintGoalRequest,
	firebaseUID string,
) (*userv1.UpdateCarbonFootprintGoalResponse, error)

func (*Store) UpdateFoodItemFromLog

func (s *Store) UpdateFoodItemFromLog(
	ctx context.Context,
	r *userv1.UpdateFoodItemRequest,
	firebaseUID string,
) (*userv1.UpdateFoodItemResponse, error)

func (*Store) UpdateUserSettings

func (s *Store) UpdateUserSettings(
	ctx context.Context,
	r *userv1.UpdateUserSettingsRequest,
	firebaseUID string,
) (*userv1.UpdateUserSettingsResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL