drink

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DrinkPublicityPublic  = "public"
	DrinkPublicityPrivate = "private"
)
View Source
const (
	TableName = "drink"
)

Variables

View Source
var ModelStruct = sqlbuilder.NewStruct(new(Model))

Functions

func Init

func Init(app *fiber.App, db *sql.DB) error

Types

type CreateDrinkRequest

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

func (CreateDrinkRequest) GetIngredients

func (d CreateDrinkRequest) GetIngredients() []string

func (CreateDrinkRequest) GetInstructions

func (d CreateDrinkRequest) GetInstructions() string

func (CreateDrinkRequest) GetName

func (d CreateDrinkRequest) GetName() string

func (CreateDrinkRequest) GetNotes

func (d CreateDrinkRequest) GetNotes() string

func (CreateDrinkRequest) GetPreferredGlass

func (d CreateDrinkRequest) GetPreferredGlass() string

func (CreateDrinkRequest) GetPrimaryAlcohol

func (d CreateDrinkRequest) GetPrimaryAlcohol() string

func (CreateDrinkRequest) GetPublicity

func (d CreateDrinkRequest) GetPublicity() string

func (*CreateDrinkRequest) SetIngredients

func (d *CreateDrinkRequest) SetIngredients(v []string)

func (*CreateDrinkRequest) SetInstructions

func (d *CreateDrinkRequest) SetInstructions(v string)

func (*CreateDrinkRequest) SetName

func (d *CreateDrinkRequest) SetName(v string)

func (*CreateDrinkRequest) SetNotes

func (d *CreateDrinkRequest) SetNotes(v string)

func (*CreateDrinkRequest) SetPreferredGlass

func (d *CreateDrinkRequest) SetPreferredGlass(v string)

func (*CreateDrinkRequest) SetPrimaryAlcohol

func (d *CreateDrinkRequest) SetPrimaryAlcohol(v string)

func (*CreateDrinkRequest) SetPublicity

func (d *CreateDrinkRequest) SetPublicity(v string)

type CreateDrinkResponse

type CreateDrinkResponse struct {
	Error   string `json:"error,omitempty"`
	Success bool   `json:"success"`
	ID      int64  `json:"id,omitempty"`
}

type DeleteDrinkResponse

type DeleteDrinkResponse struct {
	Error   string `json:"error,omitempty"`
	Success bool   `json:"success"`
}

type Drink

type Drink struct {
	ID       int64  `json:"id"`
	Username string `json:"username" validate:"required"`
	// contains filtered or unexported fields
}

func (Drink) GetIngredients

func (d Drink) GetIngredients() []string

func (Drink) GetInstructions

func (d Drink) GetInstructions() string

func (Drink) GetName

func (d Drink) GetName() string

func (Drink) GetNotes

func (d Drink) GetNotes() string

func (Drink) GetPreferredGlass

func (d Drink) GetPreferredGlass() string

func (Drink) GetPrimaryAlcohol

func (d Drink) GetPrimaryAlcohol() string

func (Drink) GetPublicity

func (d Drink) GetPublicity() string

func (*Drink) SetIngredients

func (d *Drink) SetIngredients(v []string)

func (*Drink) SetInstructions

func (d *Drink) SetInstructions(v string)

func (*Drink) SetName

func (d *Drink) SetName(v string)

func (*Drink) SetNotes

func (d *Drink) SetNotes(v string)

func (*Drink) SetPreferredGlass

func (d *Drink) SetPreferredGlass(v string)

func (*Drink) SetPrimaryAlcohol

func (d *Drink) SetPrimaryAlcohol(v string)

func (*Drink) SetPublicity

func (d *Drink) SetPublicity(v string)

type DrinkDataGetter

type DrinkDataGetter interface {
	GetName() string
	GetPrimaryAlcohol() string
	GetPreferredGlass() string
	GetIngredients() []string
	GetInstructions() string
	GetNotes() string
	GetPublicity() string
}

type DrinkDataOperator

type DrinkDataOperator interface {
	DrinkDataSetter
	DrinkDataGetter
}

type DrinkDataSetter

type DrinkDataSetter interface {
	SetName(string)
	SetPrimaryAlcohol(string)
	SetPreferredGlass(string)
	SetIngredients([]string)
	SetInstructions(string)
	SetNotes(string)
	SetPublicity(string)
}

type GetDrinkResponse

type GetDrinkResponse struct {
	Error   string `json:"error"`
	Success bool   `json:"success"`
	Drink   *Drink `json:"drink"`
}

type GetDrinksByUserResponse

type GetDrinksByUserResponse struct {
	Error   string  `json:"error"`
	Success bool    `json:"success"`
	Drinks  []Drink `json:"drinks"`
}

type Model

type Model struct {
	ID             int64  `db:"id"`
	Name           string `db:"name" fieldtag:"required_insert"`
	Username       string `db:"username" fieldtag:"required_insert"`
	PrimaryAlcohol string `db:"primary_alcohol" fieldtag:"required_insert"`
	PreferredGlass string `db:"preferred_glass" fieldtag:"required_insert"`
	Ingredients    string `db:"ingredients" fieldtag:"required_insert"`
	Instructions   string `db:"instructions" fieldtag:"required_insert"`
	Notes          string `db:"notes" fieldtag:"required_insert"`
	Publicity      string `db:"publicity" fieldtag:"required_insert"`
}

type UpdateDrinkRequest

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

func (UpdateDrinkRequest) GetIngredients

func (d UpdateDrinkRequest) GetIngredients() []string

func (UpdateDrinkRequest) GetInstructions

func (d UpdateDrinkRequest) GetInstructions() string

func (UpdateDrinkRequest) GetName

func (d UpdateDrinkRequest) GetName() string

func (UpdateDrinkRequest) GetNotes

func (d UpdateDrinkRequest) GetNotes() string

func (UpdateDrinkRequest) GetPreferredGlass

func (d UpdateDrinkRequest) GetPreferredGlass() string

func (UpdateDrinkRequest) GetPrimaryAlcohol

func (d UpdateDrinkRequest) GetPrimaryAlcohol() string

func (UpdateDrinkRequest) GetPublicity

func (d UpdateDrinkRequest) GetPublicity() string

func (*UpdateDrinkRequest) SetIngredients

func (d *UpdateDrinkRequest) SetIngredients(v []string)

func (*UpdateDrinkRequest) SetInstructions

func (d *UpdateDrinkRequest) SetInstructions(v string)

func (*UpdateDrinkRequest) SetName

func (d *UpdateDrinkRequest) SetName(v string)

func (*UpdateDrinkRequest) SetNotes

func (d *UpdateDrinkRequest) SetNotes(v string)

func (*UpdateDrinkRequest) SetPreferredGlass

func (d *UpdateDrinkRequest) SetPreferredGlass(v string)

func (*UpdateDrinkRequest) SetPrimaryAlcohol

func (d *UpdateDrinkRequest) SetPrimaryAlcohol(v string)

func (*UpdateDrinkRequest) SetPublicity

func (d *UpdateDrinkRequest) SetPublicity(v string)

type UpdateDrinkResponse

type UpdateDrinkResponse struct {
	Error   string `json:"error,omitempty"`
	Success bool   `json:"success"`
}

Jump to

Keyboard shortcuts

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