Documentation ¶
Overview ¶
Package rest provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.
Index ¶
- Constants
- type Address
- type AddressList
- type BadRequest
- type Cart
- type CartList
- type CartProduct
- type Category
- type CategoryList
- type Conflict
- type CreateAddressRequest
- type CreateCategoryRequest
- type CreateProductRequest
- type Error
- type Image
- type ImageList
- type InternalError
- type LoginRequest
- type LoginResponse
- type NotFound
- type Order
- type OrderDetailed
- type OrderList
- type OrderProduct
- type OrderProductList
- type OrderStatus
- type PaginationResponse
- type PatchCartJSONRequestBody
- type PatchCategoryJSONRequestBody
- type PatchProductProductIdJSONRequestBody
- type PostAddressJSONRequestBody
- type PostAuthLoginJSONRequestBody
- type PostAuthSignupJSONRequestBody
- type PostCartJSONRequestBody
- type PostCategoryJSONRequestBody
- type PostProductJSONRequestBody
- type PostProductProductIdImageMultipartRequestBody
- type Product
- type ProductList
- type SignupRequest
- type Unauthorized
- type UploadImagesRequest
- type User
- type UserRole
Constants ¶
const (
BearerAuthScopes = "BearerAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { City string `json:"city"` Country string `json:"country"` Flat *int `json:"flat,omitempty"` House int `json:"house"` Id int64 `json:"id"` Letter *string `json:"letter,omitempty"` Postcode int `json:"postcode"` Street string `json:"street"` UserId int64 `json:"userId"` }
Address defines model for Address.
type Cart ¶
type Cart struct { Amount int64 `json:"amount"` Id int64 `json:"id"` Product Product `json:"product"` UserId int64 `json:"userId"` }
Cart defines model for Cart.
type CartProduct ¶
CartProduct defines model for CartProduct.
func (CartProduct) ToDomainEntity ¶
func (r CartProduct) ToDomainEntity() *cart.Props
ToDomainEntity transforms api template into domain entity.
type CreateAddressRequest ¶
type CreateAddressRequest struct { City string `json:"city"` Country string `json:"country"` Flat *int `json:"flat,omitempty"` House int `json:"house"` Letter *string `json:"letter,omitempty"` Postcode int `json:"postcode"` Street string `json:"street"` }
CreateAddressRequest defines model for CreateAddressRequest.
func (CreateAddressRequest) ToDomainEntity ¶
func (r CreateAddressRequest) ToDomainEntity() *address.Props
ToDomainEntity transforms api template into domain entity.
func (CreateAddressRequest) Validate ¶
func (r CreateAddressRequest) Validate() error
Validate body of CreateAddressRequest.
type CreateCategoryRequest ¶
type CreateCategoryRequest struct {
Name string `json:"name"`
}
CreateCategoryRequest defines model for CreateCategoryRequest.
func (CreateCategoryRequest) ToDomainEntity ¶
func (r CreateCategoryRequest) ToDomainEntity() *category.Props
ToDomainEntity transforms api template into domain entity.
func (CreateCategoryRequest) Validate ¶
func (r CreateCategoryRequest) Validate() error
Validate body of CreateCategoryRequest.
type CreateProductRequest ¶
type CreateProductRequest struct { Amount int64 `json:"amount"` CategoryId int `json:"categoryId"` Description string `json:"description"` Name string `json:"name"` Price int64 `json:"price"` }
CreateProductRequest defines model for CreateProductRequest.
func (CreateProductRequest) ToDomainEntity ¶
func (r CreateProductRequest) ToDomainEntity() *product.Props
ToDomainEntity transforms api template into domain entity.
func (CreateProductRequest) Validate ¶
func (r CreateProductRequest) Validate() error
Validate body of CreateProductRequest.
type Image ¶
type Image struct { Id int64 `json:"id"` Name string `json:"name"` ProductId int64 `json:"productId"` }
Image defines model for Image.
type LoginRequest ¶
LoginRequest defines model for LoginRequest.
func (LoginRequest) ToDomainEntity ¶
func (r LoginRequest) ToDomainEntity() *auth.LoginProps
ToDomainEntity transforms api template into domain entity.
func (LoginRequest) Validate ¶
func (r LoginRequest) Validate() error
Validate body of LoginRequest.
type LoginResponse ¶
type LoginResponse struct {
Token string `json:"token"`
}
LoginResponse defines model for LoginResponse.
type Order ¶
type Order struct { Id int64 `json:"id"` Status OrderStatus `json:"status"` UserId int64 `json:"userId"` }
Order defines model for Order.
type OrderDetailed ¶
type OrderDetailed struct { Id int64 `json:"id"` Products OrderProductList `json:"products"` UserId int64 `json:"userId"` }
OrderDetailed defines model for OrderDetailed.
type OrderProduct ¶
OrderProduct defines model for OrderProduct.
type OrderProductList ¶
type OrderProductList = []OrderProduct
OrderProductList defines model for OrderProductList.
type OrderStatus ¶
type OrderStatus string
OrderStatus defines model for Order.Status.
const ( ACCEPTED OrderStatus = "ACCEPTED" CANCELED OrderStatus = "CANCELED" CREATED OrderStatus = "CREATED" )
Defines values for OrderStatus.
type PaginationResponse ¶
type PaginationResponse struct {
Quantity int `json:"quantity"`
}
PaginationResponse defines model for PaginationResponse.
type PatchCartJSONRequestBody ¶
type PatchCartJSONRequestBody = CartProduct
PatchCartJSONRequestBody defines body for PatchCart for application/json ContentType.
type PatchCategoryJSONRequestBody ¶
type PatchCategoryJSONRequestBody = Category
PatchCategoryJSONRequestBody defines body for PatchCategory for application/json ContentType.
type PatchProductProductIdJSONRequestBody ¶
type PatchProductProductIdJSONRequestBody = CreateProductRequest
PatchProductProductIdJSONRequestBody defines body for PatchProductProductId for application/json ContentType.
type PostAddressJSONRequestBody ¶
type PostAddressJSONRequestBody = CreateAddressRequest
PostAddressJSONRequestBody defines body for PostAddress for application/json ContentType.
type PostAuthLoginJSONRequestBody ¶
type PostAuthLoginJSONRequestBody = LoginRequest
PostAuthLoginJSONRequestBody defines body for PostAuthLogin for application/json ContentType.
type PostAuthSignupJSONRequestBody ¶
type PostAuthSignupJSONRequestBody = SignupRequest
PostAuthSignupJSONRequestBody defines body for PostAuthSignup for application/json ContentType.
type PostCartJSONRequestBody ¶
type PostCartJSONRequestBody = CartProduct
PostCartJSONRequestBody defines body for PostCart for application/json ContentType.
type PostCategoryJSONRequestBody ¶
type PostCategoryJSONRequestBody = CreateCategoryRequest
PostCategoryJSONRequestBody defines body for PostCategory for application/json ContentType.
type PostProductJSONRequestBody ¶
type PostProductJSONRequestBody = CreateProductRequest
PostProductJSONRequestBody defines body for PostProduct for application/json ContentType.
type PostProductProductIdImageMultipartRequestBody ¶
type PostProductProductIdImageMultipartRequestBody = UploadImagesRequest
PostProductProductIdImageMultipartRequestBody defines body for PostProductProductIdImage for multipart/form-data ContentType.
type Product ¶
type Product struct { Amount int64 `json:"amount"` CategoryId int64 `json:"categoryId"` Description *string `json:"description,omitempty"` Id int64 `json:"id"` Images ImageList `json:"images"` Name string `json:"name"` Price int64 `json:"price"` }
Product defines model for Product.
type ProductList ¶
ProductList defines model for ProductList.
type SignupRequest ¶
type SignupRequest struct { Email string `json:"email"` Name string `json:"name"` Password string `json:"password"` Phone string `json:"phone"` }
SignupRequest defines model for SignupRequest.
func (SignupRequest) ToDomainEntity ¶
func (r SignupRequest) ToDomainEntity() *auth.SignupProps
ToDomainEntity transforms api template into domain entity.
func (SignupRequest) Validate ¶
func (r SignupRequest) Validate() error
Validate body of SignupRequest.
type UploadImagesRequest ¶
type UploadImagesRequest struct {
Files []openapi_types.File `json:"files"`
}
UploadImagesRequest defines model for UploadImagesRequest.
Directories ¶
Path | Synopsis |
---|---|
Package controller contains rest controllers.
|
Package controller contains rest controllers. |
mapping
Package mapping contains logic to convert domain entities
|
Package mapping contains logic to convert domain entities |
Package middleware contains rest middlewares
|
Package middleware contains rest middlewares |