Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessToken ¶
type AccessToken struct {
AccessToken string `json:"access_token"`
}
func (*AccessToken) Render ¶
func (at *AccessToken) Render(writer http.ResponseWriter, request *http.Request) error
type Invitation ¶
type Invitation struct { UserId string `json:"user_id"` Items []uint `json:"items"` Recipient string `json:"recipient"` }
func (*Invitation) Render ¶
func (Invitation *Invitation) Render(writer http.ResponseWriter, request *http.Request) error
type Item ¶
type Item struct { ID uint `gorm:"primary_key" json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Name string `gorm:"type:varchar(255); not null" json:"name"` Price float32 `sql:"type:decimal(10,2); not null" json:"price"` // TODO better to rid of this in the future Vendor string `gorm:"type:varchar(100); not null" json:"vendor"` // TODO future table called Vendor, foreign key here VendorID string `gorm:"type:varchar(255); unique_index; not null" json:"vendor_id"` // TODO ID given by the vendor better name HasBeenBaught bool `gorm:"type:bool; default:false; not null" json:"has_been_baught"` }
type ItemResponse ¶
type ItemResponse struct { ID uint `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Name string `json:"name"` Price float32 `json:"price"` Vendor string `json:"vendor"` VendorID string `json:"vendor_id"` HasBeenBaught bool `json:"has_been_baught"` }
func NewItemReponse ¶
func NewItemReponse(item Item) ItemResponse
func (*ItemResponse) Render ¶
func (*ItemResponse) Render(w http.ResponseWriter, r *http.Request) error
type ItemResponseList ¶
type ItemResponseList []ItemResponse
type ItemUpdate ¶
type ItemUpdate struct { Name string `json:"name"` Price float32 `json:"price"` VendorID string `json:"vendor_id"` HasBeenBaught bool `json:"has_been_baught"` }
func (*ItemUpdate) Render ¶
func (*ItemUpdate) Render(w http.ResponseWriter, r *http.Request) error
func (*ItemUpdate) TableName ¶
func (*ItemUpdate) TableName() string
func (ItemUpdate) ToMap ¶
func (update ItemUpdate) ToMap() map[string]interface{}
type SuccessMessage ¶
type SuccessMessage struct {
Message string `json:"message"`
}
func (*SuccessMessage) Render ¶
func (m *SuccessMessage) Render(w http.ResponseWriter, r *http.Request) error
type User ¶
type UserVerification ¶
type UserVerification struct {
IsVerified bool `json:"is_verified"`
}
func (*UserVerification) Render ¶
func (uv *UserVerification) Render(writer http.ResponseWriter, request *http.Request) error
Click to show internal directories.
Click to hide internal directories.