service

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: 11 Imported by: 0

Documentation

Overview

Package service implements the RPCs for neutral-diet services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectWrapper

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

A ConnectWrapper represents the PostgreSQL database, Firebase Authentication and Firebase messaging clients.

func NewConnectWrapper

func NewConnectWrapper(s *db.Store, a *auth.Client, m *messaging.Client) *ConnectWrapper

NewConnectWrapper creates a new instance of ConnectWrapper.

func (*ConnectWrapper) AddCarbonFootprintGoal

func (c *ConnectWrapper) AddCarbonFootprintGoal(
	ctx context.Context,
	req *connect.Request[userv1.AddCarbonFootprintGoalRequest],
) (*connect.Response[userv1.AddCarbonFootprintGoalResponse], error)

func (*ConnectWrapper) AddDevice

func (c *ConnectWrapper) AddDevice(
	ctx context.Context,
	req *connect.Request[userv1.AddDeviceRequest],
) (*connect.Response[userv1.AddDeviceResponse], error)

func (*ConnectWrapper) AddFoodItem

func (c *ConnectWrapper) AddFoodItem(
	ctx context.Context,
	req *connect.Request[userv1.AddFoodItemRequest],
) (*connect.Response[userv1.AddFoodItemResponse], error)

func (*ConnectWrapper) CreateFoodItem

func (c *ConnectWrapper) CreateFoodItem(
	ctx context.Context,
	req *connect.Request[foodv1.CreateFoodItemRequest],
) (*connect.Response[foodv1.CreateFoodItemResponse], error)

func (*ConnectWrapper) CreateLifeCycle

func (c *ConnectWrapper) CreateLifeCycle(
	ctx context.Context,
	req *connect.Request[foodv1.CreateLifeCycleRequest],
) (*connect.Response[foodv1.CreateLifeCycleResponse], error)

func (*ConnectWrapper) CreateSource

func (c *ConnectWrapper) CreateSource(
	ctx context.Context,
	req *connect.Request[foodv1.CreateSourceRequest],
) (*connect.Response[foodv1.CreateSourceResponse], error)

func (*ConnectWrapper) CreateSubTypology

func (c *ConnectWrapper) CreateSubTypology(
	ctx context.Context,
	req *connect.Request[foodv1.CreateSubTypologyRequest],
) (*connect.Response[foodv1.CreateSubTypologyResponse], error)

func (*ConnectWrapper) CreateTypology

func (c *ConnectWrapper) CreateTypology(
	ctx context.Context,
	req *connect.Request[foodv1.CreateTypologyRequest],
) (*connect.Response[foodv1.CreateTypologyResponse], error)

func (*ConnectWrapper) CreateUser

func (c *ConnectWrapper) CreateUser(
	ctx context.Context,
	req *connect.Request[userv1.CreateUserRequest],
) (*connect.Response[userv1.CreateUserResponse], error)

func (*ConnectWrapper) DeleteCarbonFootprintGoal

func (c *ConnectWrapper) DeleteCarbonFootprintGoal(
	ctx context.Context,
	req *connect.Request[userv1.DeleteCarbonFootprintGoalRequest],
) (*connect.Response[userv1.DeleteCarbonFootprintGoalResponse], error)

func (*ConnectWrapper) DeleteFoodItem

func (c *ConnectWrapper) DeleteFoodItem(
	ctx context.Context,
	req *connect.Request[userv1.DeleteFoodItemRequest],
) (*connect.Response[userv1.DeleteFoodItemResponse], error)

func (*ConnectWrapper) DeleteUser

func (c *ConnectWrapper) DeleteUser(
	ctx context.Context,
	req *connect.Request[userv1.DeleteUserRequest],
) (*connect.Response[userv1.DeleteUserResponse], error)

func (*ConnectWrapper) GetCarbonFootprintGoals

func (c *ConnectWrapper) GetCarbonFootprintGoals(
	ctx context.Context,
	req *connect.Request[userv1.GetCarbonFootprintGoalsRequest],
) (*connect.Response[userv1.GetCarbonFootprintGoalsResponse], error)

func (*ConnectWrapper) GetFoodItemInfo

func (c *ConnectWrapper) GetFoodItemInfo(
	ctx context.Context,
	req *connect.Request[foodv1.GetFoodItemInfoRequest],
) (*connect.Response[foodv1.GetFoodItemInfoResponse], error)

func (*ConnectWrapper) GetFoodItemLog

func (c *ConnectWrapper) GetFoodItemLog(
	ctx context.Context,
	req *connect.Request[userv1.GetFoodItemLogRequest],
) (*connect.Response[userv1.GetFoodItemLogResponse], error)

func (*ConnectWrapper) GetFoodItemLogDays

func (c *ConnectWrapper) GetFoodItemLogDays(
	ctx context.Context,
	req *connect.Request[userv1.GetFoodItemLogDaysRequest],
) (*connect.Response[userv1.GetFoodItemLogDaysResponse], error)

func (*ConnectWrapper) GetUserInsights

func (c *ConnectWrapper) GetUserInsights(
	ctx context.Context,
	req *connect.Request[userv1.GetUserInsightsRequest],
) (*connect.Response[userv1.GetUserInsightsResponse], error)

func (*ConnectWrapper) GetUserProgress

func (c *ConnectWrapper) GetUserProgress(
	ctx context.Context,
	req *connect.Request[userv1.GetUserProgressRequest],
) (*connect.Response[userv1.GetUserProgressResponse], error)

func (*ConnectWrapper) GetUserSettings

func (c *ConnectWrapper) GetUserSettings(
	ctx context.Context,
	req *connect.Request[userv1.GetUserSettingsRequest],
) (*connect.Response[userv1.GetUserSettingsResponse], error)

func (*ConnectWrapper) ListAggregateFoodItems

func (c *ConnectWrapper) ListAggregateFoodItems(
	ctx context.Context,
	req *connect.Request[foodv1.ListAggregateFoodItemsRequest],
) (*connect.Response[foodv1.ListAggregateFoodItemsResponse], error)

func (*ConnectWrapper) ListSubTypologyNames

func (c *ConnectWrapper) ListSubTypologyNames(
	ctx context.Context,
	req *connect.Request[foodv1.ListSubTypologyNamesRequest],
) (*connect.Response[foodv1.ListSubTypologyNamesResponse], error)

func (*ConnectWrapper) ListTypologyNames

func (c *ConnectWrapper) ListTypologyNames(
	ctx context.Context,
	req *connect.Request[foodv1.ListTypologyNamesRequest],
) (*connect.Response[foodv1.ListTypologyNamesResponse], error)

func (*ConnectWrapper) MarkCompletedGoals

func (c *ConnectWrapper) MarkCompletedGoals(
	ctx context.Context,
	req *connect.Request[jobv1.MarkCompletedGoalsRequest],
) (*connect.Response[jobv1.MarkCompletedGoalsResponse], error)

func (*ConnectWrapper) RemoveStaleRegistrationTokens

func (c *ConnectWrapper) RemoveStaleRegistrationTokens(
	ctx context.Context,
	req *connect.Request[jobv1.RemoveStaleRegistrationTokensRequest],
) (*connect.Response[jobv1.RemoveStaleRegistrationTokensResponse], error)

func (*ConnectWrapper) SendGoalNotifications

func (c *ConnectWrapper) SendGoalNotifications(
	ctx context.Context,
	req *connect.Request[jobv1.SendGoalNotificationsRequest],
) (*connect.Response[jobv1.SendGoalNotificationsResponse], error)

func (*ConnectWrapper) SendStreakNotifications

func (c *ConnectWrapper) SendStreakNotifications(
	ctx context.Context,
	req *connect.Request[jobv1.SendStreakNotificationsRequest],
) (*connect.Response[jobv1.SendStreakNotificationsResponse], error)

func (*ConnectWrapper) UpdateCarbonFootprintGoal

func (c *ConnectWrapper) UpdateCarbonFootprintGoal(
	ctx context.Context,
	req *connect.Request[userv1.UpdateCarbonFootprintGoalRequest],
) (*connect.Response[userv1.UpdateCarbonFootprintGoalResponse], error)

func (*ConnectWrapper) UpdateFoodItem

func (c *ConnectWrapper) UpdateFoodItem(
	ctx context.Context,
	req *connect.Request[userv1.UpdateFoodItemRequest],
) (*connect.Response[userv1.UpdateFoodItemResponse], error)

func (*ConnectWrapper) UpdateUserSettings

func (c *ConnectWrapper) UpdateUserSettings(
	ctx context.Context,
	req *connect.Request[userv1.UpdateUserSettingsRequest],
) (*connect.Response[userv1.UpdateUserSettingsResponse], error)

type RequestWithValidator

type RequestWithValidator interface {
	Validate() error
}

RequestWithValidator is an abstract interface used for connect-go requests.

Directories

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

Jump to

Keyboard shortcuts

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