Documentation
¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type BadGatewayError
- func (s *BadGatewayError) Decode(d *jx.Decoder) error
- func (s *BadGatewayError) Encode(e *jx.Encoder)
- func (s *BadGatewayError) GetError() string
- func (s *BadGatewayError) GetMessage() string
- func (s *BadGatewayError) GetRequestID() OptString
- func (s *BadGatewayError) GetTimestamp() time.Time
- func (s *BadGatewayError) GetUpstreamService() OptString
- func (s *BadGatewayError) MarshalJSON() ([]byte, error)
- func (s *BadGatewayError) SetError(val string)
- func (s *BadGatewayError) SetMessage(val string)
- func (s *BadGatewayError) SetRequestID(val OptString)
- func (s *BadGatewayError) SetTimestamp(val time.Time)
- func (s *BadGatewayError) SetUpstreamService(val OptString)
- func (s *BadGatewayError) UnmarshalJSON(data []byte) error
- type BadRequestError
- func (s *BadRequestError) Decode(d *jx.Decoder) error
- func (s *BadRequestError) Encode(e *jx.Encoder)
- func (s *BadRequestError) GetCode() int
- func (s *BadRequestError) GetMessage() string
- func (s *BadRequestError) MarshalJSON() ([]byte, error)
- func (s *BadRequestError) SetCode(val int)
- func (s *BadRequestError) SetMessage(val string)
- func (s *BadRequestError) UnmarshalJSON(data []byte) error
- type CancelOrderByUuidNoContent
- 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 ConflictError
- func (s *ConflictError) Decode(d *jx.Decoder) error
- func (s *ConflictError) Encode(e *jx.Encoder)
- func (s *ConflictError) GetCode() int
- func (s *ConflictError) GetMessage() string
- func (s *ConflictError) MarshalJSON() ([]byte, error)
- func (s *ConflictError) SetCode(val int)
- func (s *ConflictError) SetMessage(val string)
- func (s *ConflictError) UnmarshalJSON(data []byte) error
- 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() float32
- func (s *CreateOrderResponse) MarshalJSON() ([]byte, error)
- func (s *CreateOrderResponse) SetOrderUUID(val uuid.UUID)
- func (s *CreateOrderResponse) SetTotalPrice(val float32)
- func (s *CreateOrderResponse) UnmarshalJSON(data []byte) error
- func (s *CreateOrderResponse) Validate() error
- type ErrorHandler
- type ForbiddenError
- func (s *ForbiddenError) Decode(d *jx.Decoder) error
- func (s *ForbiddenError) Encode(e *jx.Encoder)
- func (s *ForbiddenError) GetCode() int
- func (s *ForbiddenError) GetMessage() string
- func (s *ForbiddenError) MarshalJSON() ([]byte, error)
- func (s *ForbiddenError) SetCode(val int)
- func (s *ForbiddenError) SetMessage(val string)
- func (s *ForbiddenError) UnmarshalJSON(data []byte) error
- type GenericError
- type GenericErrorStatusCode
- type GetOrderByUuidParams
- type GetOrderByUuidRes
- type GetOrderResponse
- func (s *GetOrderResponse) Decode(d *jx.Decoder) error
- func (s *GetOrderResponse) Encode(e *jx.Encoder)
- func (s *GetOrderResponse) GetMessage() OptString
- func (s *GetOrderResponse) GetOrder() OrderDto
- func (s *GetOrderResponse) MarshalJSON() ([]byte, error)
- func (s *GetOrderResponse) SetMessage(val OptString)
- func (s *GetOrderResponse) SetOrder(val OrderDto)
- func (s *GetOrderResponse) UnmarshalJSON(data []byte) error
- func (s *GetOrderResponse) Validate() error
- type Handler
- type InternalServerError
- func (s *InternalServerError) Decode(d *jx.Decoder) error
- func (s *InternalServerError) Encode(e *jx.Encoder)
- func (s *InternalServerError) GetCode() int
- func (s *InternalServerError) GetMessage() string
- func (s *InternalServerError) MarshalJSON() ([]byte, error)
- func (s *InternalServerError) SetCode(val int)
- func (s *InternalServerError) SetMessage(val string)
- func (s *InternalServerError) UnmarshalJSON(data []byte) error
- type Invoker
- type Labeler
- type Middleware
- type NotFoundError
- func (s *NotFoundError) Decode(d *jx.Decoder) error
- func (s *NotFoundError) Encode(e *jx.Encoder)
- func (s *NotFoundError) GetCode() int
- func (s *NotFoundError) GetMessage() string
- func (s *NotFoundError) MarshalJSON() ([]byte, error)
- func (s *NotFoundError) SetCode(val int)
- func (s *NotFoundError) SetMessage(val string)
- func (s *NotFoundError) UnmarshalJSON(data []byte) error
- type OperationName
- type OptInt
- func (o *OptInt) Decode(d *jx.Decoder) error
- func (o OptInt) Encode(e *jx.Encoder)
- func (o OptInt) Get() (v int, ok bool)
- func (o OptInt) IsSet() bool
- func (s OptInt) MarshalJSON() ([]byte, error)
- func (o OptInt) Or(d int) int
- func (o *OptInt) Reset()
- func (o *OptInt) SetTo(v int)
- func (s *OptInt) UnmarshalJSON(data []byte) error
- type OptString
- func (o *OptString) Decode(d *jx.Decoder) error
- func (o OptString) Encode(e *jx.Encoder)
- func (o OptString) Get() (v string, ok bool)
- func (o OptString) IsSet() bool
- func (s OptString) MarshalJSON() ([]byte, error)
- func (o OptString) Or(d string) string
- func (o *OptString) Reset()
- func (o *OptString) SetTo(v string)
- func (s *OptString) UnmarshalJSON(data []byte) error
- type OptUUID
- func (o *OptUUID) Decode(d *jx.Decoder) error
- func (o OptUUID) Encode(e *jx.Encoder)
- func (o OptUUID) Get() (v uuid.UUID, ok bool)
- func (o OptUUID) IsSet() bool
- func (s OptUUID) MarshalJSON() ([]byte, error)
- func (o OptUUID) Or(d uuid.UUID) uuid.UUID
- func (o *OptUUID) Reset()
- func (o *OptUUID) SetTo(v uuid.UUID)
- func (s *OptUUID) 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() PaymentMethod
- func (s *OrderDto) GetStatus() OrderStatus
- func (s *OrderDto) GetTotalPrice() float32
- func (s *OrderDto) GetTransactionUUID() OptUUID
- 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 PaymentMethod)
- func (s *OrderDto) SetStatus(val OrderStatus)
- func (s *OrderDto) SetTotalPrice(val float32)
- func (s *OrderDto) SetTransactionUUID(val OptUUID)
- 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 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 RateLimitError
- func (s *RateLimitError) Decode(d *jx.Decoder) error
- func (s *RateLimitError) Encode(e *jx.Encoder)
- func (s *RateLimitError) GetCode() int
- func (s *RateLimitError) GetMessage() string
- func (s *RateLimitError) MarshalJSON() ([]byte, error)
- func (s *RateLimitError) SetCode(val int)
- func (s *RateLimitError) SetMessage(val string)
- func (s *RateLimitError) UnmarshalJSON(data []byte) 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 ServiceUnavailableError
- func (s *ServiceUnavailableError) Decode(d *jx.Decoder) error
- func (s *ServiceUnavailableError) Encode(e *jx.Encoder)
- func (s *ServiceUnavailableError) GetError() string
- func (s *ServiceUnavailableError) GetMessage() string
- func (s *ServiceUnavailableError) GetRetryAfter() OptInt
- func (s *ServiceUnavailableError) GetService() OptString
- func (s *ServiceUnavailableError) GetTimestamp() time.Time
- func (s *ServiceUnavailableError) MarshalJSON() ([]byte, error)
- func (s *ServiceUnavailableError) SetError(val string)
- func (s *ServiceUnavailableError) SetMessage(val string)
- func (s *ServiceUnavailableError) SetRetryAfter(val OptInt)
- func (s *ServiceUnavailableError) SetService(val OptString)
- func (s *ServiceUnavailableError) SetTimestamp(val time.Time)
- func (s *ServiceUnavailableError) UnmarshalJSON(data []byte) error
- type UnauthorizedError
- func (s *UnauthorizedError) Decode(d *jx.Decoder) error
- func (s *UnauthorizedError) Encode(e *jx.Encoder)
- func (s *UnauthorizedError) GetCode() int
- func (s *UnauthorizedError) GetMessage() string
- func (s *UnauthorizedError) MarshalJSON() ([]byte, error)
- func (s *UnauthorizedError) SetCode(val int)
- func (s *UnauthorizedError) SetMessage(val string)
- func (s *UnauthorizedError) UnmarshalJSON(data []byte) error
- 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) NewError(ctx context.Context, err error) (r *GenericErrorStatusCode)
- func (UnimplementedHandler) PayOrder(ctx context.Context, req *PayOrderRequest, params PayOrderParams) (r PayOrderRes, _ error)
- type ValidationError
- func (s *ValidationError) Decode(d *jx.Decoder) error
- func (s *ValidationError) Encode(e *jx.Encoder)
- func (s *ValidationError) GetCode() int
- func (s *ValidationError) GetMessage() string
- func (s *ValidationError) MarshalJSON() ([]byte, error)
- func (s *ValidationError) SetCode(val int)
- func (s *ValidationError) SetMessage(val string)
- func (s *ValidationError) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BadGatewayError ¶
type BadGatewayError struct {
// Тип ошибки.
Error string `json:"error"`
// Сообщение об ошибке.
Message string `json:"message"`
// Название вышестоящего сервиса.
UpstreamService OptString `json:"upstream_service"`
// Уникальный идентификатор запроса.
RequestID OptString `json:"request_id"`
// Время возникновения ошибки.
Timestamp time.Time `json:"timestamp"`
}
Ref: #/components/schemas/bad_gateway_error
func (*BadGatewayError) Decode ¶
func (s *BadGatewayError) Decode(d *jx.Decoder) error
Decode decodes BadGatewayError from json.
func (*BadGatewayError) Encode ¶
func (s *BadGatewayError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*BadGatewayError) GetError ¶
func (s *BadGatewayError) GetError() string
GetError returns the value of Error.
func (*BadGatewayError) GetMessage ¶
func (s *BadGatewayError) GetMessage() string
GetMessage returns the value of Message.
func (*BadGatewayError) GetRequestID ¶
func (s *BadGatewayError) GetRequestID() OptString
GetRequestID returns the value of RequestID.
func (*BadGatewayError) GetTimestamp ¶
func (s *BadGatewayError) GetTimestamp() time.Time
GetTimestamp returns the value of Timestamp.
func (*BadGatewayError) GetUpstreamService ¶
func (s *BadGatewayError) GetUpstreamService() OptString
GetUpstreamService returns the value of UpstreamService.
func (*BadGatewayError) MarshalJSON ¶
func (s *BadGatewayError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*BadGatewayError) SetError ¶
func (s *BadGatewayError) SetError(val string)
SetError sets the value of Error.
func (*BadGatewayError) SetMessage ¶
func (s *BadGatewayError) SetMessage(val string)
SetMessage sets the value of Message.
func (*BadGatewayError) SetRequestID ¶
func (s *BadGatewayError) SetRequestID(val OptString)
SetRequestID sets the value of RequestID.
func (*BadGatewayError) SetTimestamp ¶
func (s *BadGatewayError) SetTimestamp(val time.Time)
SetTimestamp sets the value of Timestamp.
func (*BadGatewayError) SetUpstreamService ¶
func (s *BadGatewayError) SetUpstreamService(val OptString)
SetUpstreamService sets the value of UpstreamService.
func (*BadGatewayError) UnmarshalJSON ¶
func (s *BadGatewayError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type BadRequestError ¶
type BadRequestError struct {
// HTTP-код ошибки.
Code int `json:"code"`
// Описание ошибки.
Message string `json:"message"`
}
Ref: #/components/schemas/bad_request_error
func (*BadRequestError) Decode ¶
func (s *BadRequestError) Decode(d *jx.Decoder) error
Decode decodes BadRequestError from json.
func (*BadRequestError) Encode ¶
func (s *BadRequestError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*BadRequestError) GetCode ¶
func (s *BadRequestError) GetCode() int
GetCode returns the value of Code.
func (*BadRequestError) GetMessage ¶
func (s *BadRequestError) GetMessage() string
GetMessage returns the value of Message.
func (*BadRequestError) MarshalJSON ¶
func (s *BadRequestError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*BadRequestError) SetCode ¶
func (s *BadRequestError) SetCode(val int)
SetCode sets the value of Code.
func (*BadRequestError) SetMessage ¶
func (s *BadRequestError) SetMessage(val string)
SetMessage sets the value of Message.
func (*BadRequestError) UnmarshalJSON ¶
func (s *BadRequestError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type CancelOrderByUuidNoContent ¶
type CancelOrderByUuidNoContent struct{}
CancelOrderByUuidNoContent is response for CancelOrderByUuid operation.
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 ConflictError ¶
type ConflictError struct {
// HTTP-код ошибки.
Code int `json:"code"`
// Описание ошибки.
Message string `json:"message"`
}
Ref: #/components/schemas/conflict_error
func (*ConflictError) Decode ¶
func (s *ConflictError) Decode(d *jx.Decoder) error
Decode decodes ConflictError from json.
func (*ConflictError) Encode ¶
func (s *ConflictError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ConflictError) GetCode ¶
func (s *ConflictError) GetCode() int
GetCode returns the value of Code.
func (*ConflictError) GetMessage ¶
func (s *ConflictError) GetMessage() string
GetMessage returns the value of Message.
func (*ConflictError) MarshalJSON ¶
func (s *ConflictError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ConflictError) SetCode ¶
func (s *ConflictError) SetCode(val int)
SetCode sets the value of Code.
func (*ConflictError) SetMessage ¶
func (s *ConflictError) SetMessage(val string)
SetMessage sets the value of Message.
func (*ConflictError) UnmarshalJSON ¶
func (s *ConflictError) 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: #/components/schemas/create_order_request
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 {
// UUID заказа.
OrderUUID uuid.UUID `json:"order_uuid"`
// Общая стоимость заказа.
TotalPrice float32 `json:"total_price"`
}
Ref: #/components/schemas/create_order_response
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() float32
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 float32)
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 ForbiddenError ¶
type ForbiddenError struct {
// HTTP-код ошибки.
Code int `json:"code"`
// Описание ошибки.
Message string `json:"message"`
}
Ref: #/components/schemas/forbidden_error
func (*ForbiddenError) Decode ¶
func (s *ForbiddenError) Decode(d *jx.Decoder) error
Decode decodes ForbiddenError from json.
func (*ForbiddenError) Encode ¶
func (s *ForbiddenError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ForbiddenError) GetCode ¶
func (s *ForbiddenError) GetCode() int
GetCode returns the value of Code.
func (*ForbiddenError) GetMessage ¶
func (s *ForbiddenError) GetMessage() string
GetMessage returns the value of Message.
func (*ForbiddenError) MarshalJSON ¶
func (s *ForbiddenError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ForbiddenError) SetCode ¶
func (s *ForbiddenError) SetCode(val int)
SetCode sets the value of Code.
func (*ForbiddenError) SetMessage ¶
func (s *ForbiddenError) SetMessage(val string)
SetMessage sets the value of Message.
func (*ForbiddenError) UnmarshalJSON ¶
func (s *ForbiddenError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GenericError ¶
type GenericError struct {
// Сообщение об ошибке.
Message string `json:"message"`
}
Ref: #/components/schemas/generic_error
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) 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) 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 GenericErrorStatusCode ¶
type GenericErrorStatusCode struct {
StatusCode int
Response GenericError
}
GenericErrorStatusCode wraps GenericError with StatusCode.
func (*GenericErrorStatusCode) Error ¶
func (s *GenericErrorStatusCode) Error() string
func (*GenericErrorStatusCode) GetResponse ¶
func (s *GenericErrorStatusCode) GetResponse() GenericError
GetResponse returns the value of Response.
func (*GenericErrorStatusCode) GetStatusCode ¶
func (s *GenericErrorStatusCode) GetStatusCode() int
GetStatusCode returns the value of StatusCode.
func (*GenericErrorStatusCode) SetResponse ¶
func (s *GenericErrorStatusCode) SetResponse(val GenericError)
SetResponse sets the value of Response.
func (*GenericErrorStatusCode) SetStatusCode ¶
func (s *GenericErrorStatusCode) SetStatusCode(val int)
SetStatusCode sets the value of StatusCode.
type GetOrderByUuidParams ¶
GetOrderByUuidParams is parameters of getOrderByUuid operation.
type GetOrderByUuidRes ¶
type GetOrderByUuidRes interface {
// contains filtered or unexported methods
}
type GetOrderResponse ¶
type GetOrderResponse struct {
Order OrderDto `json:"order"`
// Сообщение о результате операции.
Message OptString `json:"message"`
}
Ref: #/components/schemas/get_order_response
func (*GetOrderResponse) Decode ¶
func (s *GetOrderResponse) Decode(d *jx.Decoder) error
Decode decodes GetOrderResponse from json.
func (*GetOrderResponse) Encode ¶
func (s *GetOrderResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*GetOrderResponse) GetMessage ¶
func (s *GetOrderResponse) GetMessage() OptString
GetMessage returns the value of Message.
func (*GetOrderResponse) GetOrder ¶
func (s *GetOrderResponse) GetOrder() OrderDto
GetOrder returns the value of Order.
func (*GetOrderResponse) MarshalJSON ¶
func (s *GetOrderResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetOrderResponse) SetMessage ¶
func (s *GetOrderResponse) SetMessage(val OptString)
SetMessage sets the value of Message.
func (*GetOrderResponse) SetOrder ¶
func (s *GetOrderResponse) SetOrder(val OrderDto)
SetOrder sets the value of Order.
func (*GetOrderResponse) UnmarshalJSON ¶
func (s *GetOrderResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*GetOrderResponse) Validate ¶
func (s *GetOrderResponse) Validate() error
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)
// NewError creates *GenericErrorStatusCode from error returned by handler.
//
// Used for common default response.
NewError(ctx context.Context, err error) *GenericErrorStatusCode
}
Handler handles operations described by OpenAPI v3 specification.
type InternalServerError ¶
type InternalServerError struct {
// HTTP-код ошибки.
Code int `json:"code"`
// Описание ошибки.
Message string `json:"message"`
}
Ref: #/components/schemas/internal_server_error
func (*InternalServerError) Decode ¶
func (s *InternalServerError) Decode(d *jx.Decoder) error
Decode decodes InternalServerError from json.
func (*InternalServerError) Encode ¶
func (s *InternalServerError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*InternalServerError) GetCode ¶
func (s *InternalServerError) GetCode() int
GetCode returns the value of Code.
func (*InternalServerError) GetMessage ¶
func (s *InternalServerError) GetMessage() string
GetMessage returns the value of Message.
func (*InternalServerError) MarshalJSON ¶
func (s *InternalServerError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*InternalServerError) SetCode ¶
func (s *InternalServerError) SetCode(val int)
SetCode sets the value of Code.
func (*InternalServerError) SetMessage ¶
func (s *InternalServerError) SetMessage(val string)
SetMessage sets the value of Message.
func (*InternalServerError) UnmarshalJSON ¶
func (s *InternalServerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
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 NotFoundError ¶
type NotFoundError struct {
// HTTP-код ошибки.
Code int `json:"code"`
// Описание ошибки.
Message string `json:"message"`
}
Ref: #/components/schemas/not_found_error
func (*NotFoundError) Decode ¶
func (s *NotFoundError) Decode(d *jx.Decoder) error
Decode decodes NotFoundError from json.
func (*NotFoundError) Encode ¶
func (s *NotFoundError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*NotFoundError) GetCode ¶
func (s *NotFoundError) GetCode() int
GetCode returns the value of Code.
func (*NotFoundError) GetMessage ¶
func (s *NotFoundError) GetMessage() string
GetMessage returns the value of Message.
func (*NotFoundError) MarshalJSON ¶
func (s *NotFoundError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*NotFoundError) SetCode ¶
func (s *NotFoundError) SetCode(val int)
SetCode sets the value of Code.
func (*NotFoundError) SetMessage ¶
func (s *NotFoundError) SetMessage(val string)
SetMessage sets the value of Message.
func (*NotFoundError) UnmarshalJSON ¶
func (s *NotFoundError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
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 OptInt ¶
OptInt is optional int.
func (OptInt) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptInt) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptString ¶
OptString is optional string.
func NewOptString ¶
NewOptString returns new OptString with value set to v.
func (OptString) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptString) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptUUID ¶
OptUUID is optional uuid.UUID.
func NewOptUUID ¶
NewOptUUID returns new OptUUID with value set to v.
func (OptUUID) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptUUID) UnmarshalJSON ¶
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"`
// Уникальный идентификатор пользователя.
UserUUID uuid.UUID `json:"user_uuid"`
// Список UUID деталей/товаров в заказе.
PartUuids []uuid.UUID `json:"part_uuids"`
// Общая стоимость заказа.
TotalPrice float32 `json:"total_price"`
// Уникальный идентификатор транзакции.
TransactionUUID OptUUID `json:"transaction_uuid"`
PaymentMethod PaymentMethod `json:"payment_method"`
Status OrderStatus `json:"status"`
}
Ref: #/components/schemas/order_dto
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() PaymentMethod
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 ¶
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 PaymentMethod)
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 ¶
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: #/components/schemas/order_status
const ( OrderStatusASSEMBLED OrderStatus = "ASSEMBLED" 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 PayOrderParams ¶
PayOrderParams is parameters of payOrder operation.
type PayOrderRequest ¶
type PayOrderRequest struct {
PaymentMethod PaymentMethod `json:"payment_method"`
}
Ref: #/components/schemas/pay_order_request
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: #/components/schemas/pay_order_response
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: #/components/schemas/payment_method
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 RateLimitError ¶
type RateLimitError struct {
// HTTP-код ошибки.
Code int `json:"code"`
// Описание ошибки.
Message string `json:"message"`
}
Ref: #/components/schemas/rate_limit_error
func (*RateLimitError) Decode ¶
func (s *RateLimitError) Decode(d *jx.Decoder) error
Decode decodes RateLimitError from json.
func (*RateLimitError) Encode ¶
func (s *RateLimitError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*RateLimitError) GetCode ¶
func (s *RateLimitError) GetCode() int
GetCode returns the value of Code.
func (*RateLimitError) GetMessage ¶
func (s *RateLimitError) GetMessage() string
GetMessage returns the value of Message.
func (*RateLimitError) MarshalJSON ¶
func (s *RateLimitError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*RateLimitError) SetCode ¶
func (s *RateLimitError) SetCode(val int)
SetCode sets the value of Code.
func (*RateLimitError) SetMessage ¶
func (s *RateLimitError) SetMessage(val string)
SetMessage sets the value of Message.
func (*RateLimitError) UnmarshalJSON ¶
func (s *RateLimitError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
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 ServiceUnavailableError ¶
type ServiceUnavailableError struct {
Error string `json:"error"`
Message string `json:"message"`
RetryAfter OptInt `json:"retry_after"`
Service OptString `json:"service"`
Timestamp time.Time `json:"timestamp"`
}
Ref: #/components/schemas/service_unavailable_error
func (*ServiceUnavailableError) Decode ¶
func (s *ServiceUnavailableError) Decode(d *jx.Decoder) error
Decode decodes ServiceUnavailableError from json.
func (*ServiceUnavailableError) Encode ¶
func (s *ServiceUnavailableError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ServiceUnavailableError) GetError ¶
func (s *ServiceUnavailableError) GetError() string
GetError returns the value of Error.
func (*ServiceUnavailableError) GetMessage ¶
func (s *ServiceUnavailableError) GetMessage() string
GetMessage returns the value of Message.
func (*ServiceUnavailableError) GetRetryAfter ¶
func (s *ServiceUnavailableError) GetRetryAfter() OptInt
GetRetryAfter returns the value of RetryAfter.
func (*ServiceUnavailableError) GetService ¶
func (s *ServiceUnavailableError) GetService() OptString
GetService returns the value of Service.
func (*ServiceUnavailableError) GetTimestamp ¶
func (s *ServiceUnavailableError) GetTimestamp() time.Time
GetTimestamp returns the value of Timestamp.
func (*ServiceUnavailableError) MarshalJSON ¶
func (s *ServiceUnavailableError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ServiceUnavailableError) SetError ¶
func (s *ServiceUnavailableError) SetError(val string)
SetError sets the value of Error.
func (*ServiceUnavailableError) SetMessage ¶
func (s *ServiceUnavailableError) SetMessage(val string)
SetMessage sets the value of Message.
func (*ServiceUnavailableError) SetRetryAfter ¶
func (s *ServiceUnavailableError) SetRetryAfter(val OptInt)
SetRetryAfter sets the value of RetryAfter.
func (*ServiceUnavailableError) SetService ¶
func (s *ServiceUnavailableError) SetService(val OptString)
SetService sets the value of Service.
func (*ServiceUnavailableError) SetTimestamp ¶
func (s *ServiceUnavailableError) SetTimestamp(val time.Time)
SetTimestamp sets the value of Timestamp.
func (*ServiceUnavailableError) UnmarshalJSON ¶
func (s *ServiceUnavailableError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type UnauthorizedError ¶
Ref: #/components/schemas/unauthorized_error
func (*UnauthorizedError) Decode ¶
func (s *UnauthorizedError) Decode(d *jx.Decoder) error
Decode decodes UnauthorizedError from json.
func (*UnauthorizedError) Encode ¶
func (s *UnauthorizedError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*UnauthorizedError) GetCode ¶
func (s *UnauthorizedError) GetCode() int
GetCode returns the value of Code.
func (*UnauthorizedError) GetMessage ¶
func (s *UnauthorizedError) GetMessage() string
GetMessage returns the value of Message.
func (*UnauthorizedError) MarshalJSON ¶
func (s *UnauthorizedError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*UnauthorizedError) SetCode ¶
func (s *UnauthorizedError) SetCode(val int)
SetCode sets the value of Code.
func (*UnauthorizedError) SetMessage ¶
func (s *UnauthorizedError) SetMessage(val string)
SetMessage sets the value of Message.
func (*UnauthorizedError) UnmarshalJSON ¶
func (s *UnauthorizedError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
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) NewError ¶
func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *GenericErrorStatusCode)
NewError creates *GenericErrorStatusCode from error returned by handler.
Used for common default response.
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
type ValidationError ¶
type ValidationError struct {
// HTTP-код ошибки.
Code int `json:"code"`
// Сообщение об ошибке.
Message string `json:"message"`
}
Ref: #/components/schemas/validation_error
func (*ValidationError) Decode ¶
func (s *ValidationError) Decode(d *jx.Decoder) error
Decode decodes ValidationError from json.
func (*ValidationError) Encode ¶
func (s *ValidationError) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ValidationError) GetCode ¶
func (s *ValidationError) GetCode() int
GetCode returns the value of Code.
func (*ValidationError) GetMessage ¶
func (s *ValidationError) GetMessage() string
GetMessage returns the value of Message.
func (*ValidationError) MarshalJSON ¶
func (s *ValidationError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ValidationError) SetCode ¶
func (s *ValidationError) SetCode(val int)
SetCode sets the value of Code.
func (*ValidationError) SetMessage ¶
func (s *ValidationError) SetMessage(val string)
SetMessage sets the value of Message.
func (*ValidationError) UnmarshalJSON ¶
func (s *ValidationError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
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