Documentation
¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type CancelOrderByUUIDConflict
- type CancelOrderByUUIDInternalServerError
- func (s *CancelOrderByUUIDInternalServerError) Decode(d *jx.Decoder) error
- func (s *CancelOrderByUUIDInternalServerError) Encode(e *jx.Encoder)
- func (s *CancelOrderByUUIDInternalServerError) MarshalJSON() ([]byte, error)
- func (s *CancelOrderByUUIDInternalServerError) UnmarshalJSON(data []byte) error
- type CancelOrderByUUIDNoContent
- type CancelOrderByUUIDNotFound
- type CancelOrderByUUIDParams
- type CancelOrderByUUIDRes
- type Client
- func (c *Client) CancelOrderByUUID(ctx context.Context, params CancelOrderByUUIDParams) (CancelOrderByUUIDRes, error)
- func (c *Client) CreateOrder(ctx context.Context, request *CreateOrderRequest) (CreateOrderRes, error)
- func (c *Client) GetOrderByUUID(ctx context.Context, params GetOrderByUUIDParams) (GetOrderByUUIDRes, error)
- func (c *Client) PayOrder(ctx context.Context, request *PayOrderRequest, params PayOrderParams) (PayOrderRes, error)
- type ClientOption
- type CreateOrderBadRequest
- type CreateOrderInternalServerError
- type CreateOrderRequest
- func (s *CreateOrderRequest) Decode(d *jx.Decoder) error
- func (s *CreateOrderRequest) Encode(e *jx.Encoder)
- func (s *CreateOrderRequest) GetPartUuids() []uuid.UUID
- func (s *CreateOrderRequest) GetUserUUID() uuid.UUID
- func (s *CreateOrderRequest) MarshalJSON() ([]byte, error)
- func (s *CreateOrderRequest) SetPartUuids(val []uuid.UUID)
- func (s *CreateOrderRequest) SetUserUUID(val uuid.UUID)
- func (s *CreateOrderRequest) UnmarshalJSON(data []byte) error
- func (s *CreateOrderRequest) Validate() error
- type CreateOrderRes
- type CreateOrderResponse
- func (s *CreateOrderResponse) Decode(d *jx.Decoder) error
- func (s *CreateOrderResponse) Encode(e *jx.Encoder)
- func (s *CreateOrderResponse) GetOrderUUID() uuid.UUID
- func (s *CreateOrderResponse) GetTotalPrice() float64
- func (s *CreateOrderResponse) MarshalJSON() ([]byte, error)
- func (s *CreateOrderResponse) SetOrderUUID(val uuid.UUID)
- func (s *CreateOrderResponse) SetTotalPrice(val float64)
- func (s *CreateOrderResponse) UnmarshalJSON(data []byte) error
- func (s *CreateOrderResponse) Validate() error
- type ErrorHandler
- type GenericError
- func (s *GenericError) Decode(d *jx.Decoder) error
- func (s *GenericError) Encode(e *jx.Encoder)
- func (s *GenericError) GetCode() int
- func (s *GenericError) GetMessage() string
- func (s *GenericError) MarshalJSON() ([]byte, error)
- func (s *GenericError) SetCode(val int)
- func (s *GenericError) SetMessage(val string)
- func (s *GenericError) UnmarshalJSON(data []byte) error
- type GetOrderByUUIDInternalServerError
- type GetOrderByUUIDNotFound
- type GetOrderByUUIDParams
- type GetOrderByUUIDRes
- type Handler
- type Invoker
- type Labeler
- type Middleware
- type OperationName
- type OptNilUUID
- func (o *OptNilUUID) Decode(d *jx.Decoder) error
- func (o OptNilUUID) Encode(e *jx.Encoder)
- func (o OptNilUUID) Get() (v uuid.UUID, ok bool)
- func (o OptNilUUID) IsNull() bool
- func (o OptNilUUID) IsSet() bool
- func (s OptNilUUID) MarshalJSON() ([]byte, error)
- func (o OptNilUUID) Or(d uuid.UUID) uuid.UUID
- func (o *OptNilUUID) Reset()
- func (o *OptNilUUID) SetTo(v uuid.UUID)
- func (o *OptNilUUID) SetToNull()
- func (s *OptNilUUID) UnmarshalJSON(data []byte) error
- type OptPaymentMethod
- func (o *OptPaymentMethod) Decode(d *jx.Decoder) error
- func (o OptPaymentMethod) Encode(e *jx.Encoder)
- func (o OptPaymentMethod) Get() (v PaymentMethod, ok bool)
- func (o OptPaymentMethod) IsSet() bool
- func (s OptPaymentMethod) MarshalJSON() ([]byte, error)
- func (o OptPaymentMethod) Or(d PaymentMethod) PaymentMethod
- func (o *OptPaymentMethod) Reset()
- func (o *OptPaymentMethod) SetTo(v PaymentMethod)
- func (s *OptPaymentMethod) UnmarshalJSON(data []byte) error
- type Option
- type OrderDto
- func (s *OrderDto) Decode(d *jx.Decoder) error
- func (s *OrderDto) Encode(e *jx.Encoder)
- func (s *OrderDto) GetOrderUUID() uuid.UUID
- func (s *OrderDto) GetPartUuids() []uuid.UUID
- func (s *OrderDto) GetPaymentMethod() OptPaymentMethod
- func (s *OrderDto) GetStatus() OrderStatus
- func (s *OrderDto) GetTotalPrice() float64
- func (s *OrderDto) GetTransactionUUID() OptNilUUID
- func (s *OrderDto) GetUserUUID() uuid.UUID
- func (s *OrderDto) MarshalJSON() ([]byte, error)
- func (s *OrderDto) SetOrderUUID(val uuid.UUID)
- func (s *OrderDto) SetPartUuids(val []uuid.UUID)
- func (s *OrderDto) SetPaymentMethod(val OptPaymentMethod)
- func (s *OrderDto) SetStatus(val OrderStatus)
- func (s *OrderDto) SetTotalPrice(val float64)
- func (s *OrderDto) SetTransactionUUID(val OptNilUUID)
- func (s *OrderDto) SetUserUUID(val uuid.UUID)
- func (s *OrderDto) UnmarshalJSON(data []byte) error
- func (s *OrderDto) Validate() error
- type OrderStatus
- func (OrderStatus) AllValues() []OrderStatus
- func (s *OrderStatus) Decode(d *jx.Decoder) error
- func (s OrderStatus) Encode(e *jx.Encoder)
- func (s OrderStatus) MarshalJSON() ([]byte, error)
- func (s OrderStatus) MarshalText() ([]byte, error)
- func (s *OrderStatus) UnmarshalJSON(data []byte) error
- func (s *OrderStatus) UnmarshalText(data []byte) error
- func (s OrderStatus) Validate() error
- type PayOrderBadRequest
- type PayOrderInternalServerError
- type PayOrderNotFound
- type PayOrderParams
- type PayOrderRequest
- func (s *PayOrderRequest) Decode(d *jx.Decoder) error
- func (s *PayOrderRequest) Encode(e *jx.Encoder)
- func (s *PayOrderRequest) GetPaymentMethod() PaymentMethod
- func (s *PayOrderRequest) MarshalJSON() ([]byte, error)
- func (s *PayOrderRequest) SetPaymentMethod(val PaymentMethod)
- func (s *PayOrderRequest) UnmarshalJSON(data []byte) error
- func (s *PayOrderRequest) Validate() error
- type PayOrderRes
- type PayOrderResponse
- func (s *PayOrderResponse) Decode(d *jx.Decoder) error
- func (s *PayOrderResponse) Encode(e *jx.Encoder)
- func (s *PayOrderResponse) GetTransactionUUID() uuid.UUID
- func (s *PayOrderResponse) MarshalJSON() ([]byte, error)
- func (s *PayOrderResponse) SetTransactionUUID(val uuid.UUID)
- func (s *PayOrderResponse) UnmarshalJSON(data []byte) error
- type PaymentMethod
- func (PaymentMethod) AllValues() []PaymentMethod
- func (s *PaymentMethod) Decode(d *jx.Decoder) error
- func (s PaymentMethod) Encode(e *jx.Encoder)
- func (s PaymentMethod) MarshalJSON() ([]byte, error)
- func (s PaymentMethod) MarshalText() ([]byte, error)
- func (s *PaymentMethod) UnmarshalJSON(data []byte) error
- func (s *PaymentMethod) UnmarshalText(data []byte) error
- func (s PaymentMethod) Validate() error
- type Route
- type Server
- type ServerOption
- func WithErrorHandler(h ErrorHandler) ServerOption
- func WithMaxMultipartMemory(max int64) ServerOption
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
- func WithMiddleware(m ...Middleware) ServerOption
- func WithNotFound(notFound http.HandlerFunc) ServerOption
- func WithPathPrefix(prefix string) ServerOption
- type UnimplementedHandler
- func (UnimplementedHandler) CancelOrderByUUID(ctx context.Context, params CancelOrderByUUIDParams) (r CancelOrderByUUIDRes, _ error)
- func (UnimplementedHandler) CreateOrder(ctx context.Context, req *CreateOrderRequest) (r CreateOrderRes, _ error)
- func (UnimplementedHandler) GetOrderByUUID(ctx context.Context, params GetOrderByUUIDParams) (r GetOrderByUUIDRes, _ error)
- func (UnimplementedHandler) PayOrder(ctx context.Context, req *PayOrderRequest, params PayOrderParams) (r PayOrderRes, _ error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CancelOrderByUUIDConflict ¶
type CancelOrderByUUIDConflict GenericError
func (*CancelOrderByUUIDConflict) Decode ¶
func (s *CancelOrderByUUIDConflict) Decode(d *jx.Decoder) error
Decode decodes CancelOrderByUUIDConflict from json.
func (*CancelOrderByUUIDConflict) Encode ¶
func (s *CancelOrderByUUIDConflict) Encode(e *jx.Encoder)
Encode encodes CancelOrderByUUIDConflict as json.
func (*CancelOrderByUUIDConflict) MarshalJSON ¶
func (s *CancelOrderByUUIDConflict) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CancelOrderByUUIDConflict) UnmarshalJSON ¶
func (s *CancelOrderByUUIDConflict) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type CancelOrderByUUIDInternalServerError ¶
type CancelOrderByUUIDInternalServerError GenericError
func (*CancelOrderByUUIDInternalServerError) Decode ¶
func (s *CancelOrderByUUIDInternalServerError) Decode(d *jx.Decoder) error
Decode decodes CancelOrderByUUIDInternalServerError from json.
func (*CancelOrderByUUIDInternalServerError) Encode ¶
func (s *CancelOrderByUUIDInternalServerError) Encode(e *jx.Encoder)
Encode encodes CancelOrderByUUIDInternalServerError as json.
func (*CancelOrderByUUIDInternalServerError) MarshalJSON ¶
func (s *CancelOrderByUUIDInternalServerError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CancelOrderByUUIDInternalServerError) UnmarshalJSON ¶
func (s *CancelOrderByUUIDInternalServerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type CancelOrderByUUIDNoContent ¶
type CancelOrderByUUIDNoContent struct{}
CancelOrderByUUIDNoContent is response for CancelOrderByUUID operation.
type CancelOrderByUUIDNotFound ¶
type CancelOrderByUUIDNotFound GenericError
func (*CancelOrderByUUIDNotFound) Decode ¶
func (s *CancelOrderByUUIDNotFound) Decode(d *jx.Decoder) error
Decode decodes CancelOrderByUUIDNotFound from json.
func (*CancelOrderByUUIDNotFound) Encode ¶
func (s *CancelOrderByUUIDNotFound) Encode(e *jx.Encoder)
Encode encodes CancelOrderByUUIDNotFound as json.
func (*CancelOrderByUUIDNotFound) MarshalJSON ¶
func (s *CancelOrderByUUIDNotFound) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CancelOrderByUUIDNotFound) UnmarshalJSON ¶
func (s *CancelOrderByUUIDNotFound) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type CancelOrderByUUIDParams ¶
CancelOrderByUUIDParams is parameters of CancelOrderByUUID operation.
type CancelOrderByUUIDRes ¶
type CancelOrderByUUIDRes interface {
// contains filtered or unexported methods
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements OAS client.
func NewClient ¶
func NewClient(serverURL string, opts ...ClientOption) (*Client, error)
NewClient initializes new Client defined by OAS.
func (*Client) CancelOrderByUUID ¶
func (c *Client) CancelOrderByUUID(ctx context.Context, params CancelOrderByUUIDParams) (CancelOrderByUUIDRes, error)
CancelOrderByUUID invokes CancelOrderByUUID operation.
Отменяет заказ.
POST /api/v1/orders/{order_uuid}/cancel
func (*Client) CreateOrder ¶
func (c *Client) CreateOrder(ctx context.Context, request *CreateOrderRequest) (CreateOrderRes, error)
CreateOrder invokes CreateOrder operation.
Создаёт новый заказ на основе выбранных пользователем деталей.
POST /api/v1/orders
func (*Client) GetOrderByUUID ¶
func (c *Client) GetOrderByUUID(ctx context.Context, params GetOrderByUUIDParams) (GetOrderByUUIDRes, error)
GetOrderByUUID invokes GetOrderByUUID operation.
Возвращает информацию о заказе по его UUID.
GET /api/v1/orders/{order_uuid}
func (*Client) PayOrder ¶
func (c *Client) PayOrder(ctx context.Context, request *PayOrderRequest, params PayOrderParams) (PayOrderRes, error)
PayOrder invokes PayOrder operation.
Проводит оплату ранее созданного заказа.
POST /api/v1/orders/{order_uuid}/pay
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption is client config option.
func WithClient ¶
func WithClient(client ht.Client) ClientOption
WithClient specifies http client to use.
type CreateOrderBadRequest ¶
type CreateOrderBadRequest GenericError
func (*CreateOrderBadRequest) Decode ¶
func (s *CreateOrderBadRequest) Decode(d *jx.Decoder) error
Decode decodes CreateOrderBadRequest from json.
func (*CreateOrderBadRequest) Encode ¶
func (s *CreateOrderBadRequest) Encode(e *jx.Encoder)
Encode encodes CreateOrderBadRequest as json.
func (*CreateOrderBadRequest) MarshalJSON ¶
func (s *CreateOrderBadRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CreateOrderBadRequest) UnmarshalJSON ¶
func (s *CreateOrderBadRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type CreateOrderInternalServerError ¶
type CreateOrderInternalServerError GenericError
func (*CreateOrderInternalServerError) Decode ¶
func (s *CreateOrderInternalServerError) Decode(d *jx.Decoder) error
Decode decodes CreateOrderInternalServerError from json.
func (*CreateOrderInternalServerError) Encode ¶
func (s *CreateOrderInternalServerError) Encode(e *jx.Encoder)
Encode encodes CreateOrderInternalServerError as json.
func (*CreateOrderInternalServerError) MarshalJSON ¶
func (s *CreateOrderInternalServerError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CreateOrderInternalServerError) UnmarshalJSON ¶
func (s *CreateOrderInternalServerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type CreateOrderRequest ¶
type CreateOrderRequest struct { // UUID пользователя. UserUUID uuid.UUID `json:"user_uuid"` // Список UUID деталей для заказа. PartUuids []uuid.UUID `json:"part_uuids"` }
Ref: #
func (*CreateOrderRequest) Decode ¶
func (s *CreateOrderRequest) Decode(d *jx.Decoder) error
Decode decodes CreateOrderRequest from json.
func (*CreateOrderRequest) Encode ¶
func (s *CreateOrderRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*CreateOrderRequest) GetPartUuids ¶
func (s *CreateOrderRequest) GetPartUuids() []uuid.UUID
GetPartUuids returns the value of PartUuids.
func (*CreateOrderRequest) GetUserUUID ¶
func (s *CreateOrderRequest) GetUserUUID() uuid.UUID
GetUserUUID returns the value of UserUUID.
func (*CreateOrderRequest) MarshalJSON ¶
func (s *CreateOrderRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CreateOrderRequest) SetPartUuids ¶
func (s *CreateOrderRequest) SetPartUuids(val []uuid.UUID)
SetPartUuids sets the value of PartUuids.
func (*CreateOrderRequest) SetUserUUID ¶
func (s *CreateOrderRequest) SetUserUUID(val uuid.UUID)
SetUserUUID sets the value of UserUUID.
func (*CreateOrderRequest) UnmarshalJSON ¶
func (s *CreateOrderRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*CreateOrderRequest) Validate ¶
func (s *CreateOrderRequest) Validate() error
type CreateOrderRes ¶
type CreateOrderRes interface {
// contains filtered or unexported methods
}
type CreateOrderResponse ¶
type CreateOrderResponse struct { // Уникальный идентификатор созданного заказа. OrderUUID uuid.UUID `json:"order_uuid"` // Итоговая стоимость заказа. TotalPrice float64 `json:"total_price"` }
Ref: #
func (*CreateOrderResponse) Decode ¶
func (s *CreateOrderResponse) Decode(d *jx.Decoder) error
Decode decodes CreateOrderResponse from json.
func (*CreateOrderResponse) Encode ¶
func (s *CreateOrderResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*CreateOrderResponse) GetOrderUUID ¶
func (s *CreateOrderResponse) GetOrderUUID() uuid.UUID
GetOrderUUID returns the value of OrderUUID.
func (*CreateOrderResponse) GetTotalPrice ¶
func (s *CreateOrderResponse) GetTotalPrice() float64
GetTotalPrice returns the value of TotalPrice.
func (*CreateOrderResponse) MarshalJSON ¶
func (s *CreateOrderResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CreateOrderResponse) SetOrderUUID ¶
func (s *CreateOrderResponse) SetOrderUUID(val uuid.UUID)
SetOrderUUID sets the value of OrderUUID.
func (*CreateOrderResponse) SetTotalPrice ¶
func (s *CreateOrderResponse) SetTotalPrice(val float64)
SetTotalPrice sets the value of TotalPrice.
func (*CreateOrderResponse) UnmarshalJSON ¶
func (s *CreateOrderResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*CreateOrderResponse) Validate ¶
func (s *CreateOrderResponse) Validate() error
type GenericError ¶
type GenericError struct { // Описание ошибки. Message string `json:"message"` // HTTP-код ошибки. Code int `json:"code"` }
Ref: #
func (*GenericError) Decode ¶
func (s *GenericError) Decode(d *jx.Decoder) error
Decode decodes GenericError from json.
func (*GenericError) Encode ¶
func (s *GenericError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*GenericError) GetCode ¶
func (s *GenericError) GetCode() int
GetCode returns the value of Code.
func (*GenericError) GetMessage ¶
func (s *GenericError) GetMessage() string
GetMessage returns the value of Message.
func (*GenericError) MarshalJSON ¶
func (s *GenericError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GenericError) SetCode ¶
func (s *GenericError) SetCode(val int)
SetCode sets the value of Code.
func (*GenericError) SetMessage ¶
func (s *GenericError) SetMessage(val string)
SetMessage sets the value of Message.
func (*GenericError) UnmarshalJSON ¶
func (s *GenericError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetOrderByUUIDInternalServerError ¶
type GetOrderByUUIDInternalServerError GenericError
func (*GetOrderByUUIDInternalServerError) Decode ¶
func (s *GetOrderByUUIDInternalServerError) Decode(d *jx.Decoder) error
Decode decodes GetOrderByUUIDInternalServerError from json.
func (*GetOrderByUUIDInternalServerError) Encode ¶
func (s *GetOrderByUUIDInternalServerError) Encode(e *jx.Encoder)
Encode encodes GetOrderByUUIDInternalServerError as json.
func (*GetOrderByUUIDInternalServerError) MarshalJSON ¶
func (s *GetOrderByUUIDInternalServerError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetOrderByUUIDInternalServerError) UnmarshalJSON ¶
func (s *GetOrderByUUIDInternalServerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetOrderByUUIDNotFound ¶
type GetOrderByUUIDNotFound GenericError
func (*GetOrderByUUIDNotFound) Decode ¶
func (s *GetOrderByUUIDNotFound) Decode(d *jx.Decoder) error
Decode decodes GetOrderByUUIDNotFound from json.
func (*GetOrderByUUIDNotFound) Encode ¶
func (s *GetOrderByUUIDNotFound) Encode(e *jx.Encoder)
Encode encodes GetOrderByUUIDNotFound as json.
func (*GetOrderByUUIDNotFound) MarshalJSON ¶
func (s *GetOrderByUUIDNotFound) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetOrderByUUIDNotFound) UnmarshalJSON ¶
func (s *GetOrderByUUIDNotFound) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetOrderByUUIDParams ¶
GetOrderByUUIDParams is parameters of GetOrderByUUID operation.
type GetOrderByUUIDRes ¶
type GetOrderByUUIDRes interface {
// contains filtered or unexported methods
}
type Handler ¶
type Handler interface { // CancelOrderByUUID implements CancelOrderByUUID operation. // // Отменяет заказ. // // POST /api/v1/orders/{order_uuid}/cancel CancelOrderByUUID(ctx context.Context, params CancelOrderByUUIDParams) (CancelOrderByUUIDRes, error) // CreateOrder implements CreateOrder operation. // // Создаёт новый заказ на основе выбранных // пользователем деталей. // // POST /api/v1/orders CreateOrder(ctx context.Context, req *CreateOrderRequest) (CreateOrderRes, error) // GetOrderByUUID implements GetOrderByUUID operation. // // Возвращает информацию о заказе по его UUID. // // GET /api/v1/orders/{order_uuid} GetOrderByUUID(ctx context.Context, params GetOrderByUUIDParams) (GetOrderByUUIDRes, error) // PayOrder implements PayOrder operation. // // Проводит оплату ранее созданного заказа. // // POST /api/v1/orders/{order_uuid}/pay PayOrder(ctx context.Context, req *PayOrderRequest, params PayOrderParams) (PayOrderRes, error) }
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface { // CancelOrderByUUID invokes CancelOrderByUUID operation. // // Отменяет заказ. // // POST /api/v1/orders/{order_uuid}/cancel CancelOrderByUUID(ctx context.Context, params CancelOrderByUUIDParams) (CancelOrderByUUIDRes, error) // CreateOrder invokes CreateOrder operation. // // Создаёт новый заказ на основе выбранных // пользователем деталей. // // POST /api/v1/orders CreateOrder(ctx context.Context, request *CreateOrderRequest) (CreateOrderRes, error) // GetOrderByUUID invokes GetOrderByUUID operation. // // Возвращает информацию о заказе по его UUID. // // GET /api/v1/orders/{order_uuid} GetOrderByUUID(ctx context.Context, params GetOrderByUUIDParams) (GetOrderByUUIDRes, error) // PayOrder invokes PayOrder operation. // // Проводит оплату ранее созданного заказа. // // POST /api/v1/orders/{order_uuid}/pay PayOrder(ctx context.Context, request *PayOrderRequest, params PayOrderParams) (PayOrderRes, error) }
Invoker invokes operations described by OpenAPI v3 specification.
type Labeler ¶
type Labeler struct {
// contains filtered or unexported fields
}
Labeler is used to allow adding custom attributes to the server request metrics.
func LabelerFromContext ¶
LabelerFromContext retrieves the Labeler from the provided context, if present.
If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.
func (*Labeler) AttributeSet ¶
AttributeSet returns the attributes added to the Labeler as an attribute.Set.
type OperationName ¶
type OperationName = string
OperationName is the ogen operation name
const ( CancelOrderByUUIDOperation OperationName = "CancelOrderByUUID" CreateOrderOperation OperationName = "CreateOrder" GetOrderByUUIDOperation OperationName = "GetOrderByUUID" PayOrderOperation OperationName = "PayOrder" )
type OptNilUUID ¶
OptNilUUID is optional nullable uuid.UUID.
func NewOptNilUUID ¶
func NewOptNilUUID(v uuid.UUID) OptNilUUID
NewOptNilUUID returns new OptNilUUID with value set to v.
func (*OptNilUUID) Decode ¶
func (o *OptNilUUID) Decode(d *jx.Decoder) error
Decode decodes uuid.UUID from json.
func (OptNilUUID) Encode ¶
func (o OptNilUUID) Encode(e *jx.Encoder)
Encode encodes uuid.UUID as json.
func (OptNilUUID) Get ¶
func (o OptNilUUID) Get() (v uuid.UUID, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptNilUUID) IsSet ¶
func (o OptNilUUID) IsSet() bool
IsSet returns true if OptNilUUID was set.
func (OptNilUUID) MarshalJSON ¶
func (s OptNilUUID) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptNilUUID) Or ¶
func (o OptNilUUID) Or(d uuid.UUID) uuid.UUID
Or returns value if set, or given parameter if does not.
func (*OptNilUUID) UnmarshalJSON ¶
func (s *OptNilUUID) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptPaymentMethod ¶
type OptPaymentMethod struct { Value PaymentMethod Set bool }
OptPaymentMethod is optional PaymentMethod.
func NewOptPaymentMethod ¶
func NewOptPaymentMethod(v PaymentMethod) OptPaymentMethod
NewOptPaymentMethod returns new OptPaymentMethod with value set to v.
func (*OptPaymentMethod) Decode ¶
func (o *OptPaymentMethod) Decode(d *jx.Decoder) error
Decode decodes PaymentMethod from json.
func (OptPaymentMethod) Encode ¶
func (o OptPaymentMethod) Encode(e *jx.Encoder)
Encode encodes PaymentMethod as json.
func (OptPaymentMethod) Get ¶
func (o OptPaymentMethod) Get() (v PaymentMethod, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptPaymentMethod) IsSet ¶
func (o OptPaymentMethod) IsSet() bool
IsSet returns true if OptPaymentMethod was set.
func (OptPaymentMethod) MarshalJSON ¶
func (s OptPaymentMethod) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptPaymentMethod) Or ¶
func (o OptPaymentMethod) Or(d PaymentMethod) PaymentMethod
Or returns value if set, or given parameter if does not.
func (*OptPaymentMethod) SetTo ¶
func (o *OptPaymentMethod) SetTo(v PaymentMethod)
SetTo sets value to v.
func (*OptPaymentMethod) UnmarshalJSON ¶
func (s *OptPaymentMethod) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type Option ¶
type Option interface { ServerOption ClientOption }
Option is config option.
func WithMeterProvider ¶
func WithMeterProvider(provider metric.MeterProvider) Option
WithMeterProvider specifies a meter provider to use for creating a meter.
If none is specified, the otel.GetMeterProvider() is used.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer.
If none is specified, the global provider is used.
type OrderDto ¶
type OrderDto struct { // Уникальный идентификатор заказа. OrderUUID uuid.UUID `json:"order_uuid"` // UUID пользователя. UserUUID uuid.UUID `json:"user_uuid"` // Список UUID деталей. PartUuids []uuid.UUID `json:"part_uuids"` // Итоговая стоимость. TotalPrice float64 `json:"total_price"` // UUID транзакции (если оплачен). TransactionUUID OptNilUUID `json:"transaction_uuid"` // Способ оплаты (если оплачен). PaymentMethod OptPaymentMethod `json:"payment_method"` // Статус заказа (PENDING_PAYMENT, PAID, CANCELLED). Status OrderStatus `json:"status"` }
Ref: #
func (*OrderDto) GetOrderUUID ¶
GetOrderUUID returns the value of OrderUUID.
func (*OrderDto) GetPartUuids ¶
GetPartUuids returns the value of PartUuids.
func (*OrderDto) GetPaymentMethod ¶
func (s *OrderDto) GetPaymentMethod() OptPaymentMethod
GetPaymentMethod returns the value of PaymentMethod.
func (*OrderDto) GetStatus ¶
func (s *OrderDto) GetStatus() OrderStatus
GetStatus returns the value of Status.
func (*OrderDto) GetTotalPrice ¶
GetTotalPrice returns the value of TotalPrice.
func (*OrderDto) GetTransactionUUID ¶
func (s *OrderDto) GetTransactionUUID() OptNilUUID
GetTransactionUUID returns the value of TransactionUUID.
func (*OrderDto) GetUserUUID ¶
GetUserUUID returns the value of UserUUID.
func (*OrderDto) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OrderDto) SetOrderUUID ¶
SetOrderUUID sets the value of OrderUUID.
func (*OrderDto) SetPartUuids ¶
SetPartUuids sets the value of PartUuids.
func (*OrderDto) SetPaymentMethod ¶
func (s *OrderDto) SetPaymentMethod(val OptPaymentMethod)
SetPaymentMethod sets the value of PaymentMethod.
func (*OrderDto) SetStatus ¶
func (s *OrderDto) SetStatus(val OrderStatus)
SetStatus sets the value of Status.
func (*OrderDto) SetTotalPrice ¶
SetTotalPrice sets the value of TotalPrice.
func (*OrderDto) SetTransactionUUID ¶
func (s *OrderDto) SetTransactionUUID(val OptNilUUID)
SetTransactionUUID sets the value of TransactionUUID.
func (*OrderDto) SetUserUUID ¶
SetUserUUID sets the value of UserUUID.
func (*OrderDto) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OrderStatus ¶
type OrderStatus string
Статус заказа. Ref: #/OrderStatus
const ( OrderStatusPENDINGPAYMENT OrderStatus = "PENDING_PAYMENT" OrderStatusPAID OrderStatus = "PAID" OrderStatusCANCELLED OrderStatus = "CANCELLED" )
func (OrderStatus) AllValues ¶
func (OrderStatus) AllValues() []OrderStatus
AllValues returns all OrderStatus values.
func (*OrderStatus) Decode ¶
func (s *OrderStatus) Decode(d *jx.Decoder) error
Decode decodes OrderStatus from json.
func (OrderStatus) Encode ¶
func (s OrderStatus) Encode(e *jx.Encoder)
Encode encodes OrderStatus as json.
func (OrderStatus) MarshalJSON ¶
func (s OrderStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OrderStatus) MarshalText ¶
func (s OrderStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*OrderStatus) UnmarshalJSON ¶
func (s *OrderStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*OrderStatus) UnmarshalText ¶
func (s *OrderStatus) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (OrderStatus) Validate ¶
func (s OrderStatus) Validate() error
type PayOrderBadRequest ¶
type PayOrderBadRequest GenericError
func (*PayOrderBadRequest) Decode ¶
func (s *PayOrderBadRequest) Decode(d *jx.Decoder) error
Decode decodes PayOrderBadRequest from json.
func (*PayOrderBadRequest) Encode ¶
func (s *PayOrderBadRequest) Encode(e *jx.Encoder)
Encode encodes PayOrderBadRequest as json.
func (*PayOrderBadRequest) MarshalJSON ¶
func (s *PayOrderBadRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PayOrderBadRequest) UnmarshalJSON ¶
func (s *PayOrderBadRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type PayOrderInternalServerError ¶
type PayOrderInternalServerError GenericError
func (*PayOrderInternalServerError) Decode ¶
func (s *PayOrderInternalServerError) Decode(d *jx.Decoder) error
Decode decodes PayOrderInternalServerError from json.
func (*PayOrderInternalServerError) Encode ¶
func (s *PayOrderInternalServerError) Encode(e *jx.Encoder)
Encode encodes PayOrderInternalServerError as json.
func (*PayOrderInternalServerError) MarshalJSON ¶
func (s *PayOrderInternalServerError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PayOrderInternalServerError) UnmarshalJSON ¶
func (s *PayOrderInternalServerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type PayOrderNotFound ¶
type PayOrderNotFound GenericError
func (*PayOrderNotFound) Decode ¶
func (s *PayOrderNotFound) Decode(d *jx.Decoder) error
Decode decodes PayOrderNotFound from json.
func (*PayOrderNotFound) Encode ¶
func (s *PayOrderNotFound) Encode(e *jx.Encoder)
Encode encodes PayOrderNotFound as json.
func (*PayOrderNotFound) MarshalJSON ¶
func (s *PayOrderNotFound) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PayOrderNotFound) UnmarshalJSON ¶
func (s *PayOrderNotFound) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type PayOrderParams ¶
PayOrderParams is parameters of PayOrder operation.
type PayOrderRequest ¶
type PayOrderRequest struct { // Способ оплаты заказа. PaymentMethod PaymentMethod `json:"payment_method"` }
Ref: #
func (*PayOrderRequest) Decode ¶
func (s *PayOrderRequest) Decode(d *jx.Decoder) error
Decode decodes PayOrderRequest from json.
func (*PayOrderRequest) Encode ¶
func (s *PayOrderRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*PayOrderRequest) GetPaymentMethod ¶
func (s *PayOrderRequest) GetPaymentMethod() PaymentMethod
GetPaymentMethod returns the value of PaymentMethod.
func (*PayOrderRequest) MarshalJSON ¶
func (s *PayOrderRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PayOrderRequest) SetPaymentMethod ¶
func (s *PayOrderRequest) SetPaymentMethod(val PaymentMethod)
SetPaymentMethod sets the value of PaymentMethod.
func (*PayOrderRequest) UnmarshalJSON ¶
func (s *PayOrderRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*PayOrderRequest) Validate ¶
func (s *PayOrderRequest) Validate() error
type PayOrderRes ¶
type PayOrderRes interface {
// contains filtered or unexported methods
}
type PayOrderResponse ¶
type PayOrderResponse struct { // UUID транзакции оплаты. TransactionUUID uuid.UUID `json:"transaction_uuid"` }
Ref: #
func (*PayOrderResponse) Decode ¶
func (s *PayOrderResponse) Decode(d *jx.Decoder) error
Decode decodes PayOrderResponse from json.
func (*PayOrderResponse) Encode ¶
func (s *PayOrderResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*PayOrderResponse) GetTransactionUUID ¶
func (s *PayOrderResponse) GetTransactionUUID() uuid.UUID
GetTransactionUUID returns the value of TransactionUUID.
func (*PayOrderResponse) MarshalJSON ¶
func (s *PayOrderResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PayOrderResponse) SetTransactionUUID ¶
func (s *PayOrderResponse) SetTransactionUUID(val uuid.UUID)
SetTransactionUUID sets the value of TransactionUUID.
func (*PayOrderResponse) UnmarshalJSON ¶
func (s *PayOrderResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type PaymentMethod ¶
type PaymentMethod string
Метод оплаты. Ref: #/PaymentMethod
const ( PaymentMethodUNKNOWN PaymentMethod = "UNKNOWN" PaymentMethodCARD PaymentMethod = "CARD" PaymentMethodSBP PaymentMethod = "SBP" PaymentMethodCREDITCARD PaymentMethod = "CREDIT_CARD" PaymentMethodINVESTORMONEY PaymentMethod = "INVESTOR_MONEY" )
func (PaymentMethod) AllValues ¶
func (PaymentMethod) AllValues() []PaymentMethod
AllValues returns all PaymentMethod values.
func (*PaymentMethod) Decode ¶
func (s *PaymentMethod) Decode(d *jx.Decoder) error
Decode decodes PaymentMethod from json.
func (PaymentMethod) Encode ¶
func (s PaymentMethod) Encode(e *jx.Encoder)
Encode encodes PaymentMethod as json.
func (PaymentMethod) MarshalJSON ¶
func (s PaymentMethod) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (PaymentMethod) MarshalText ¶
func (s PaymentMethod) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*PaymentMethod) UnmarshalJSON ¶
func (s *PaymentMethod) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*PaymentMethod) UnmarshalText ¶
func (s *PaymentMethod) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (PaymentMethod) Validate ¶
func (s PaymentMethod) Validate() error
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.
func NewServer ¶
func NewServer(h Handler, opts ...ServerOption) (*Server, error)
NewServer creates new Server.
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
ServerOption is server config option.
func WithErrorHandler ¶
func WithErrorHandler(h ErrorHandler) ServerOption
WithErrorHandler specifies error handler to use.
func WithMaxMultipartMemory ¶
func WithMaxMultipartMemory(max int64) ServerOption
WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.
func WithMethodNotAllowed ¶
func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
WithMethodNotAllowed specifies Method Not Allowed handler to use.
func WithMiddleware ¶
func WithMiddleware(m ...Middleware) ServerOption
WithMiddleware specifies middlewares to use.
func WithNotFound ¶
func WithNotFound(notFound http.HandlerFunc) ServerOption
WithNotFound specifies Not Found handler to use.
func WithPathPrefix ¶
func WithPathPrefix(prefix string) ServerOption
WithPathPrefix specifies server path prefix.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) CancelOrderByUUID ¶
func (UnimplementedHandler) CancelOrderByUUID(ctx context.Context, params CancelOrderByUUIDParams) (r CancelOrderByUUIDRes, _ error)
CancelOrderByUUID implements CancelOrderByUUID operation.
Отменяет заказ.
POST /api/v1/orders/{order_uuid}/cancel
func (UnimplementedHandler) CreateOrder ¶
func (UnimplementedHandler) CreateOrder(ctx context.Context, req *CreateOrderRequest) (r CreateOrderRes, _ error)
CreateOrder implements CreateOrder operation.
Создаёт новый заказ на основе выбранных пользователем деталей.
POST /api/v1/orders
func (UnimplementedHandler) GetOrderByUUID ¶
func (UnimplementedHandler) GetOrderByUUID(ctx context.Context, params GetOrderByUUIDParams) (r GetOrderByUUIDRes, _ error)
GetOrderByUUID implements GetOrderByUUID operation.
Возвращает информацию о заказе по его UUID.
GET /api/v1/orders/{order_uuid}
func (UnimplementedHandler) PayOrder ¶
func (UnimplementedHandler) PayOrder(ctx context.Context, req *PayOrderRequest, params PayOrderParams) (r PayOrderRes, _ error)
PayOrder implements PayOrder operation.
Проводит оплату ранее созданного заказа.
POST /api/v1/orders/{order_uuid}/pay
Source Files
¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_handlers_gen.go
- oas_interfaces_gen.go
- oas_json_gen.go
- oas_labeler_gen.go
- oas_middleware_gen.go
- oas_operations_gen.go
- oas_parameters_gen.go
- oas_request_decoders_gen.go
- oas_request_encoders_gen.go
- oas_response_decoders_gen.go
- oas_response_encoders_gen.go
- oas_router_gen.go
- oas_schemas_gen.go
- oas_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go