Documentation ¶
Index ¶
- Constants
- Variables
- func Init(app *fiber.App, db *sql.DB) error
- type CreateDrinkRequest
- type CreateDrinkResponse
- type DeleteDrinkResponse
- type Drink
- type DrinkData
- func (d DrinkData) GetIngredients() []string
- func (d DrinkData) GetInstructions() string
- func (d DrinkData) GetName() string
- func (d DrinkData) GetNotes() string
- func (d DrinkData) GetPreferredGlass() string
- func (d DrinkData) GetPrimaryAlcohol() string
- func (d DrinkData) GetPublicity() string
- func (d *DrinkData) SetIngredients(v []string)
- func (d *DrinkData) SetInstructions(v string)
- func (d *DrinkData) SetName(v string)
- func (d *DrinkData) SetNotes(v string)
- func (d *DrinkData) SetPreferredGlass(v string)
- func (d *DrinkData) SetPrimaryAlcohol(v string)
- func (d *DrinkData) SetPublicity(v string)
- type DrinkDataGetter
- type DrinkDataOperator
- type DrinkDataSetter
- type GetDrinkResponse
- type GetDrinksByUserResponse
- type Model
- type UpdateDrinkRequest
- type UpdateDrinkResponse
Constants ¶
View Source
const ( DrinkPublicityPublic = "public" DrinkPublicityPrivate = "private" )
View Source
const (
TableName = "drink"
)
Variables ¶
View Source
var ModelStruct = sqlbuilder.NewStruct(new(Model))
Functions ¶
Types ¶
type CreateDrinkRequest ¶
type CreateDrinkRequest struct {
DrinkData
}
type CreateDrinkResponse ¶
type CreateDrinkResponse struct {
ID int64 `json:"id,omitempty"`
}
type DeleteDrinkResponse ¶
type DeleteDrinkResponse struct {
Success bool `json:"success"`
}
type DrinkData ¶ added in v0.7.0
type DrinkData struct { Name string `json:"name" validate:"required"` PrimaryAlcohol string `json:"primary_alcohol" validate:"required"` PreferredGlass string `json:"preferred_glass,omitempty"` Ingredients []string `json:"ingredients" validate:"required"` Instructions string `json:"instructions,omitempty"` Notes string `json:"notes,omitempty"` Publicity string `json:"publicity" validate:"required"` }
func (DrinkData) GetIngredients ¶ added in v0.7.0
func (DrinkData) GetInstructions ¶ added in v0.7.0
func (DrinkData) GetPreferredGlass ¶ added in v0.7.0
func (DrinkData) GetPrimaryAlcohol ¶ added in v0.7.0
func (DrinkData) GetPublicity ¶ added in v0.7.0
func (*DrinkData) SetIngredients ¶ added in v0.7.0
func (*DrinkData) SetInstructions ¶ added in v0.7.0
func (*DrinkData) SetPreferredGlass ¶ added in v0.7.0
func (*DrinkData) SetPrimaryAlcohol ¶ added in v0.7.0
func (*DrinkData) SetPublicity ¶ added in v0.7.0
type DrinkDataGetter ¶
type DrinkDataOperator ¶
type DrinkDataOperator interface { DrinkDataSetter DrinkDataGetter }
type DrinkDataSetter ¶
type GetDrinkResponse ¶
type GetDrinkResponse struct {
Drink *Drink `json:"drink"`
}
type GetDrinksByUserResponse ¶
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 {
DrinkData
}
type UpdateDrinkResponse ¶
type UpdateDrinkResponse struct {
Success bool `json:"success"`
}
Click to show internal directories.
Click to hide internal directories.