Documentation ¶
Index ¶
- Constants
- type Category
- type City
- type Comment
- type CommentChanges
- type CommentInFeed
- type Image
- type Order
- type OrderChanges
- type OrderInBasket
- type OrderNotInBasket
- type PreComment
- type PreOrder
- type PreProduct
- type PriceHistoryRecord
- type Product
- type ProductID
- type ProductInFeed
- type User
- type UserWithoutID
- type UserWithoutPassword
Constants ¶
const ( OrderStatusInBasket = iota OrderStatusInProcessing OrderStatusPaid OrderStatusClosed OrderStatusError = 255 )
const EmailWithRus = "^[^\\s()<>@,;:\\/]+@[\\wА-Яа-я][\\wА-Яа-я.-]+\\.[a-zа-я]{2,}$"
const MinLenPassword = 6
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct { ID uint64 `json:"id" valid:"required"` Name string `` //nolint /* 135-byte string literal not displayed */ ParentID sql.NullInt64 `json:"parent_id" swaggertype:"integer" valid:"required"` }
func (*Category) MarshalJSON ¶
func (*Category) SafeUnmarshalJSON ¶
type City ¶
type City struct { ID uint64 `json:"id" valid:"required"` Name string `json:"name" valid:"required, length(1|256)~City name length must be from 1 to 256"` }
func (City) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (City) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*City) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*City) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Comment ¶
type Comment struct { ID uint64 `json:"id" valid:"required"` SenderID uint64 `json:"sender_id" valid:"required"` RecipientID uint64 `json:"recipient_id" valid:"required"` Text string `` //nolint:nolintlint /* 136-byte string literal not displayed */ Rating uint8 `json:"rating" valid:"required,range(1|5)"` CreatedAt time.Time `json:"created_at" valid:"required"` }
type CommentChanges ¶
type CommentChanges struct { Text string `` //nolint:nolintlint /* 136-byte string literal not displayed */ Rating uint8 `json:"rating" valid:"required,range(1|5)"` }
func (CommentChanges) MarshalEasyJSON ¶
func (v CommentChanges) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CommentChanges) MarshalJSON ¶
func (v CommentChanges) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CommentChanges) Trim ¶
func (c *CommentChanges) Trim()
func (*CommentChanges) UnmarshalEasyJSON ¶
func (v *CommentChanges) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CommentChanges) UnmarshalJSON ¶
func (v *CommentChanges) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CommentInFeed ¶
type CommentInFeed struct { ID uint64 `json:"id" valid:"required"` SenderID uint64 `json:"sender_id" valid:"required"` SenderName string `json:"sender_name"` Avatar sql.NullString `json:"avatar" swaggertype:"string"` Text string `` //nolint:nolintlint /* 136-byte string literal not displayed */ Rating uint8 `json:"rating" valid:"required,min=1,max=5"` CreatedAt time.Time `json:"created_at" valid:"required"` }
func (*CommentInFeed) MarshalJSON ¶
func (c *CommentInFeed) MarshalJSON() ([]byte, error)
func (*CommentInFeed) Sanitize ¶
func (c *CommentInFeed) Sanitize()
func (*CommentInFeed) UnmarshalJSON ¶
func (c *CommentInFeed) UnmarshalJSON(bytes []byte) error
type Order ¶
type Order struct { ID uint64 `json:"id" valid:"required"` OwnerID uint64 `json:"owner_id" valid:"required"` ProductID uint64 `json:"product_id" valid:"required"` Count uint32 `json:"count" valid:"required"` Status uint8 `json:"status" valid:"required"` CreatedAt time.Time `json:"created_at" valid:"required"` UpdatedAt time.Time `json:"updated_at" valid:"required"` ClosedAt sql.NullTime `json:"closed_at" swaggertype:"string" example:"2014-12-12T14:00:12+07:00" valid:"required"` }
func (*Order) MarshalJSON ¶
func (*Order) UnmarshalJSON ¶
type OrderChanges ¶
type OrderChanges struct { ID uint64 `json:"id" valid:"required"` Count uint32 `json:"count" valid:"required"` Status uint8 `json:"status" valid:"required"` }
func (OrderChanges) MarshalEasyJSON ¶
func (v OrderChanges) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderChanges) MarshalJSON ¶
func (v OrderChanges) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderChanges) UnmarshalEasyJSON ¶
func (v *OrderChanges) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderChanges) UnmarshalJSON ¶
func (v *OrderChanges) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderInBasket ¶
type OrderInBasket struct { ID uint64 `json:"id" valid:"required"` OwnerID uint64 `json:"owner_id" valid:"required"` SalerID uint64 `json:"saler_id" valid:"required"` ProductID uint64 `json:"product_id" valid:"required"` CityID uint64 `json:"city_id" valid:"required"` Title string `json:"title" valid:"required, length(1|256)~Title length must be from 1 to 256"` Price uint64 `json:"price" valid:"required"` Count uint32 `json:"count" valid:"required"` AvailableCount uint32 `json:"available_count" valid:"required"` Delivery bool `json:"delivery" valid:"required"` SafeDeal bool `json:"safe_deal" valid:"required"` InFavourites bool `json:"in_favourites" valid:"required"` Images []Image `json:"images"` }
func (OrderInBasket) MarshalEasyJSON ¶
func (v OrderInBasket) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderInBasket) MarshalJSON ¶
func (v OrderInBasket) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderInBasket) Sanitize ¶
func (o *OrderInBasket) Sanitize()
func (*OrderInBasket) UnmarshalEasyJSON ¶
func (v *OrderInBasket) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderInBasket) UnmarshalJSON ¶
func (v *OrderInBasket) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderNotInBasket ¶
type OrderNotInBasket struct { OrderInBasket Status int `json:"status"` }
func (OrderNotInBasket) MarshalEasyJSON ¶
func (v OrderNotInBasket) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderNotInBasket) MarshalJSON ¶
func (v OrderNotInBasket) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderNotInBasket) UnmarshalEasyJSON ¶
func (v *OrderNotInBasket) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderNotInBasket) UnmarshalJSON ¶
func (v *OrderNotInBasket) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PreComment ¶
type PreComment struct { SenderID uint64 `json:"sender_id" valid:"required"` RecipientID uint64 `json:"recipient_id" valid:"required"` Text string `` //nolint:nolintlint /* 136-byte string literal not displayed */ Rating uint8 `json:"rating" valid:"required,range(1|5)"` }
func (PreComment) MarshalEasyJSON ¶
func (v PreComment) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PreComment) MarshalJSON ¶
func (v PreComment) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PreComment) Trim ¶
func (p *PreComment) Trim()
func (*PreComment) UnmarshalEasyJSON ¶
func (v *PreComment) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PreComment) UnmarshalJSON ¶
func (v *PreComment) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PreOrder ¶
type PreOrder struct { ProductID uint64 `json:"product_id" valid:"required"` Count uint32 `json:"count" valid:"required"` }
func (PreOrder) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (PreOrder) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*PreOrder) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PreOrder) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type PreProduct ¶
type PreProduct struct { SalerID uint64 `json:"saler_id" valid:"required"` CategoryID uint64 `json:"category_id" valid:"required"` CityID uint64 `json:"city_id" valid:"required"` Title string `` //nolint:nolintlint /* 143-byte string literal not displayed */ Description string `` //nolint:nolintlint /* 145-byte string literal not displayed */ Price uint64 `json:"price" valid:"required"` AvailableCount uint32 `json:"available_count" valid:"required"` Delivery bool `json:"delivery" valid:"optional"` SafeDeal bool `json:"safe_deal" valid:"optional"` IsActive bool `json:"is_active" valid:"optional"` Images []Image `json:"images"` }
PreProduct @Description safe_deal optional @Description delivery optional
func (PreProduct) MarshalEasyJSON ¶
func (v PreProduct) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PreProduct) MarshalJSON ¶
func (v PreProduct) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PreProduct) Trim ¶
func (p *PreProduct) Trim()
func (*PreProduct) UnmarshalEasyJSON ¶
func (v *PreProduct) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PreProduct) UnmarshalJSON ¶
func (v *PreProduct) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PriceHistoryRecord ¶
type Product ¶
type Product struct { ID uint64 `json:"id" valid:"required"` SalerID uint64 `json:"saler_id" valid:"required"` CategoryID uint64 `json:"category_id" valid:"required"` CityID uint64 `json:"city_id" valid:"required"` Title string `` //nolint:nolintlint /* 143-byte string literal not displayed */ Description string `` //nolint:nolintlint /* 145-byte string literal not displayed */ Price uint64 `json:"price" valid:"required"` CreatedAt time.Time `json:"created_at" valid:"required"` PremiumExpire sql.NullTime `json:"premium_expire" swaggertype:"string" example:"2014-12-12T14:00:12+07:00" valid:"optional"` //nolint:nolintlint Views uint32 `json:"views" valid:"required"` AvailableCount uint32 `json:"available_count" valid:"required"` Delivery bool `json:"delivery" valid:"optional"` SafeDeal bool `json:"safe_deal" valid:"optional"` InFavourites bool `json:"in_favourites" valid:"optional"` IsActive bool `json:"is_active" valid:"optional"` Premium bool `json:"premium" valid:"required"` Images []Image `json:"images"` PriceHistory []PriceHistoryRecord `json:"price_history" valid:"optional"` Favourites uint64 `json:"favourites" valid:"required"` CommentID sql.NullInt64 `json:"comment_id" swaggertype:"integer" example:"10" valid:"optional"` //nolint:nolintlint }
func (*Product) MarshalJSON ¶
func (*Product) UnmarshalJSON ¶
type ProductID ¶
type ProductID struct {
ProductID uint64 `json:"product_id"`
}
func (ProductID) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (ProductID) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*ProductID) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ProductID) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type ProductInFeed ¶
type ProductInFeed struct { ID uint64 `json:"id" valid:"required"` Title string `` //nolint:nolintlint /* 143-byte string literal not displayed */ Price uint64 `json:"price" valid:"required"` CityID uint64 `json:"city_id" valid:"required"` AvailableCount uint32 `json:"available_count" valid:"required"` Delivery bool `json:"delivery" valid:"optional"` SafeDeal bool `json:"safe_deal" valid:"optional"` InFavourites bool `json:"in_favourites" valid:"optional"` IsActive bool `json:"is_active" valid:"optional"` Premium bool `json:"premium" valid:"required"` Images []Image `json:"images"` Favourites uint64 `json:"favourites" valid:"required"` }
func (ProductInFeed) MarshalEasyJSON ¶
func (v ProductInFeed) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ProductInFeed) MarshalJSON ¶
func (v ProductInFeed) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ProductInFeed) Sanitize ¶
func (p *ProductInFeed) Sanitize()
func (*ProductInFeed) UnmarshalEasyJSON ¶
func (v *ProductInFeed) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ProductInFeed) UnmarshalJSON ¶
func (v *ProductInFeed) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type User ¶
type User struct { ID uint64 `json:"id" valid:"required"` Email string `json:"email_with_rus" valid:"required,email_with_rus~Некорректный формат email"` //nolint Phone sql.NullString `` //nolint /* 307-byte string literal not displayed */ Name sql.NullString `` //nolint /* 194-byte string literal not displayed */ Password string `json:"password" valid:"required,password~Пароль должен быть минимум 6 символов"` Birthday sql.NullTime `json:"birthday"` Avatar sql.NullString `json:"avatar"` }
type UserWithoutID ¶
type UserWithoutID struct { Email string `json:"email_with_rus" valid:"required,email_with_rus~Некорректный формат email"` //nolint Phone sql.NullString `` //nolint /* 304-byte string literal not displayed */ Name sql.NullString `` //nolint /* 191-byte string literal not displayed */ Password string `json:"password" valid:"required,password~Пароль должен быть минимум 6 символов"` Birthday sql.NullTime `json:"birthday"` Avatar sql.NullString `json:"avatar"` }
func (UserWithoutID) MarshalEasyJSON ¶
func (v UserWithoutID) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UserWithoutID) MarshalJSON ¶
func (v UserWithoutID) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UserWithoutID) Trim ¶
func (u *UserWithoutID) Trim()
func (*UserWithoutID) UnmarshalEasyJSON ¶
func (v *UserWithoutID) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UserWithoutID) UnmarshalJSON ¶
func (v *UserWithoutID) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UserWithoutPassword ¶
type UserWithoutPassword struct { ID uint64 `json:"id" valid:"required"` Email string `json:"email_with_rus" valid:"required,email_with_rus~Некорректный формат email"` //nolint AvgRating sql.NullFloat64 `json:"avg_rating" valid:"range(1|5)"` Phone sql.NullString `` //nolint /* 333-byte string literal not displayed */ Name sql.NullString `` //nolint /* 219-byte string literal not displayed */ Birthday sql.NullTime `json:"birthday" swaggertype:"string" example:"2014-12-12T14:00:12+07:00"` Avatar sql.NullString `json:"avatar" swaggertype:"string"` CreatedAt time.Time `json:"created_at" valid:"required"` }
func (*UserWithoutPassword) MarshalJSON ¶
func (u *UserWithoutPassword) MarshalJSON() ([]byte, error)
func (*UserWithoutPassword) Sanitize ¶
func (u *UserWithoutPassword) Sanitize()
func (*UserWithoutPassword) Trim ¶
func (u *UserWithoutPassword) Trim()
func (*UserWithoutPassword) UnmarshalJSON ¶
func (u *UserWithoutPassword) UnmarshalJSON(bytes []byte) error
Source Files ¶
- category.go
- category_json.go
- category_json_easyjson.go
- city.go
- city_easyjson.go
- comment.go
- comment_easyjson.go
- comment_json.go
- comment_json_easyjson.go
- order.go
- order_easyjson.go
- order_json.go
- order_json_easyjson.go
- price_history.go
- product.go
- product_easyjson.go
- product_json.go
- product_json_easyjson.go
- user_json.go
- user_json_easyjson.go
- users.go
- users_easyjson.go