Documentation ¶
Index ¶
- Constants
- Variables
- func Init(app *fiber.App, db *sql.DB) error
- type CopyDrinkResponse
- type CreateDrinkRequest
- type CreateDrinkResponse
- type DeleteDrinkResponse
- type Drink
- type DrinkAlreadyExistsError
- type DrinkData
- func (t DrinkData) GetFavorite() bool
- func (t DrinkData) GetIngredients() []string
- func (t DrinkData) GetInstructions() string
- func (t DrinkData) GetName() string
- func (t DrinkData) GetNotes() string
- func (t DrinkData) GetPreferredGlass() string
- func (t DrinkData) GetPrimaryAlcohol() string
- func (t DrinkData) GetPublicity() string
- func (t DrinkData) GetTags() []string
- func (t DrinkData) GetUnderDevelopment() bool
- func (t *DrinkData) SetFavorite(v bool)
- func (t *DrinkData) SetIngredients(v []string)
- func (t *DrinkData) SetInstructions(v string)
- func (t *DrinkData) SetName(v string)
- func (t *DrinkData) SetNotes(v string)
- func (t *DrinkData) SetPreferredGlass(v string)
- func (t *DrinkData) SetPrimaryAlcohol(v string)
- func (t *DrinkData) SetPublicity(v string)
- func (t *DrinkData) SetTags(v []string)
- func (t *DrinkData) SetUnderDevelopment(v bool)
- 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 CopyDrinkResponse ¶ added in v0.12.0
type CopyDrinkResponse struct {
ID int64 `json:"id,omitempty"`
}
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 DrinkAlreadyExistsError ¶ added in v0.14.0
func (DrinkAlreadyExistsError) Error ¶ added in v0.14.0
func (e DrinkAlreadyExistsError) Error() string
type DrinkData ¶ added in v0.7.0
type DrinkData struct { Name string `json:"name" validate:"required" strugen:"read,write"` PrimaryAlcohol string `json:"primary_alcohol" validate:"required" strugen:"read,write"` PreferredGlass string `json:"preferred_glass,omitempty" strugen:"read,write"` Ingredients []string `json:"ingredients" validate:"required" strugen:"read,write"` Instructions string `json:"instructions,omitempty" strugen:"read,write"` Notes string `json:"notes,omitempty" strugen:"read,write"` Publicity string `json:"publicity" validate:"required" strugen:"read,write"` UnderDevelopment bool `json:"under_development" strugen:"read,write"` Tags []string `json:"tags" strugen:"read,write"` Favorite bool `json:"favorite" strugen:"read,write"` }
func (DrinkData) GetFavorite ¶ added in v0.17.0
Generated accessor for DrinkData
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) GetUnderDevelopment ¶ added in v0.15.0
func (*DrinkData) SetFavorite ¶ added in v0.17.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
func (*DrinkData) SetUnderDevelopment ¶ added in v0.15.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"` UnderDevelopment int `db:"under_development" fieldtag:"required_insert"` Tags string `db:"tags" fieldtag:"required_insert"` Favorite int `db:"favorite" 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.