v1

package
v0.0.0-...-de159e6 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateUniqueID

func GenerateUniqueID(beerID int, userEmail string) uint

Types

type BeersPayload

type BeersPayload struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type Controller

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

func New

func New(
	beerApiClient *beerapi.Client,
	userProfileCrudRepository repository.UserProfileCrudRepository,
	userPreferencesCrudRepository repository.UserPreferencesCrudRepository,
	cacheProvider cache.Provider,
) *Controller

func (*Controller) GetBeers

func (c *Controller) GetBeers(w http.ResponseWriter, r *http.Request)

func (*Controller) GetUserPreferences

func (c *Controller) GetUserPreferences(w http.ResponseWriter, r *http.Request)

func (*Controller) HelloWorld

func (c *Controller) HelloWorld(w http.ResponseWriter, _ *http.Request)

func (*Controller) SaveBeers

func (c *Controller) SaveBeers(w http.ResponseWriter, r *http.Request)

func (*Controller) SaveUserPreferences

func (c *Controller) SaveUserPreferences(w http.ResponseWriter, r *http.Request)

func (*Controller) SaveUserProfile

func (c *Controller) SaveUserProfile(w http.ResponseWriter, r *http.Request)

type GetBeersResponse

type GetBeersResponse struct {
	Body []BeersPayload
}

type GetUserBeerPreferencesResponse

type GetUserBeerPreferencesResponse struct {
	Body []UserBeerPreferencesPayload
}

type SaveBeerPayload

type SaveBeerPayload struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type UserBeerPreferencesPayload

type UserBeerPreferencesPayload struct {
	ID                 int    `json:"id"`
	Name               string `json:"name"`
	DrunkTheBeerBefore bool   `json:"drunk_before"`
	GotDrunk           bool   `json:"got_drunk"`
	LastTime           string `json:"last_time"`
	Rating             int    `json:"rating"`
	Comment            string `json:"comment"`
}

Jump to

Keyboard shortcuts

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