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) GetCode() int
- func (s *BadGatewayError) GetMessage() string
- func (s *BadGatewayError) MarshalJSON() ([]byte, error)
- func (s *BadGatewayError) SetCode(val int)
- func (s *BadGatewayError) SetMessage(val string)
- func (s *BadGatewayError) UnmarshalJSON(data []byte) error
- type CancelOrderParams
- type CancelOrderRes
- type Client
- func (c *Client) CancelOrder(ctx context.Context, params CancelOrderParams) (CancelOrderRes, error)
- func (c *Client) CreateOrder(ctx context.Context, request *OrderCreateRequest) (CreateOrderRes, error)
- func (c *Client) GetOrderByUuid(ctx context.Context, params GetOrderByUuidParams) (GetOrderByUuidRes, error)
- func (c *Client) PayOrder(ctx context.Context, request *OrderPayRequest, 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 CreateOrderRes
- type ErrorHandler
- type GenericError
- func (s *GenericError) Decode(d *jx.Decoder) error
- func (s *GenericError) Encode(e *jx.Encoder)
- func (s *GenericError) GetCode() OptInt
- func (s *GenericError) GetMessage() OptString
- func (s *GenericError) MarshalJSON() ([]byte, error)
- func (s *GenericError) SetCode(val OptInt)
- func (s *GenericError) SetMessage(val OptString)
- func (s *GenericError) UnmarshalJSON(data []byte) error
- type GenericErrorStatusCode
- type GetOrderByUuidParams
- type GetOrderByUuidRes
- type Handler
- 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 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 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 Order
- func (s *Order) Decode(d *jx.Decoder) error
- func (s *Order) Encode(e *jx.Encoder)
- func (s *Order) GetOrderUUID() uuid.UUID
- func (s *Order) GetPartUuids() []uuid.UUID
- func (s *Order) GetPaymentMethod() OptPaymentMethod
- func (s *Order) GetStatus() OrderStatus
- func (s *Order) GetTotalPriceMinor() int64
- func (s *Order) GetTransactionUUID() OptUUID
- func (s *Order) GetUserUUID() uuid.UUID
- func (s *Order) MarshalJSON() ([]byte, error)
- func (s *Order) SetOrderUUID(val uuid.UUID)
- func (s *Order) SetPartUuids(val []uuid.UUID)
- func (s *Order) SetPaymentMethod(val OptPaymentMethod)
- func (s *Order) SetStatus(val OrderStatus)
- func (s *Order) SetTotalPriceMinor(val int64)
- func (s *Order) SetTransactionUUID(val OptUUID)
- func (s *Order) SetUserUUID(val uuid.UUID)
- func (s *Order) UnmarshalJSON(data []byte) error
- func (s *Order) Validate() error
- type OrderCreateRequest
- func (s *OrderCreateRequest) Decode(d *jx.Decoder) error
- func (s *OrderCreateRequest) Encode(e *jx.Encoder)
- func (s *OrderCreateRequest) GetPartUuids() PartUuids
- func (s *OrderCreateRequest) GetUserUUID() UserUUID
- func (s *OrderCreateRequest) MarshalJSON() ([]byte, error)
- func (s *OrderCreateRequest) SetPartUuids(val PartUuids)
- func (s *OrderCreateRequest) SetUserUUID(val UserUUID)
- func (s *OrderCreateRequest) UnmarshalJSON(data []byte) error
- func (s *OrderCreateRequest) Validate() error
- type OrderCreateResponse
- func (s *OrderCreateResponse) Decode(d *jx.Decoder) error
- func (s *OrderCreateResponse) Encode(e *jx.Encoder)
- func (s *OrderCreateResponse) GetOrderUUID() OrderUUID
- func (s *OrderCreateResponse) GetTotalPriceMinor() TotalPriceMinor
- func (s *OrderCreateResponse) MarshalJSON() ([]byte, error)
- func (s *OrderCreateResponse) SetOrderUUID(val OrderUUID)
- func (s *OrderCreateResponse) SetTotalPriceMinor(val TotalPriceMinor)
- func (s *OrderCreateResponse) UnmarshalJSON(data []byte) error
- type OrderPayRequest
- func (s *OrderPayRequest) Decode(d *jx.Decoder) error
- func (s *OrderPayRequest) Encode(e *jx.Encoder)
- func (s *OrderPayRequest) GetPaymentMethod() PaymentMethod
- func (s *OrderPayRequest) MarshalJSON() ([]byte, error)
- func (s *OrderPayRequest) SetPaymentMethod(val PaymentMethod)
- func (s *OrderPayRequest) UnmarshalJSON(data []byte) error
- func (s *OrderPayRequest) Validate() error
- type OrderPayResponse
- func (s *OrderPayResponse) Decode(d *jx.Decoder) error
- func (s *OrderPayResponse) Encode(e *jx.Encoder)
- func (s *OrderPayResponse) GetTransactionUUID() uuid.UUID
- func (s *OrderPayResponse) MarshalJSON() ([]byte, error)
- func (s *OrderPayResponse) SetTransactionUUID(val uuid.UUID)
- func (s *OrderPayResponse) UnmarshalJSON(data []byte) 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 OrderUUID
- type PartUuids
- type PayOrderParams
- type PayOrderRes
- 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 TotalPriceMinor
- type UnimplementedHandler
- func (UnimplementedHandler) CancelOrder(ctx context.Context, params CancelOrderParams) (r CancelOrderRes, _ error)
- func (UnimplementedHandler) CreateOrder(ctx context.Context, req *OrderCreateRequest) (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 *OrderPayRequest, params PayOrderParams) (r PayOrderRes, _ error)
- type UserUUID
- 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 {
// HTTP-код ошибки.
Code int `json:"code"`
// Описание ошибки.
Message string `json:"message"`
}
Ref: #
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) GetCode ¶
func (s *BadGatewayError) GetCode() int
GetCode returns the value of Code.
func (*BadGatewayError) GetMessage ¶
func (s *BadGatewayError) GetMessage() string
GetMessage returns the value of Message.
func (*BadGatewayError) MarshalJSON ¶
func (s *BadGatewayError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*BadGatewayError) SetCode ¶
func (s *BadGatewayError) SetCode(val int)
SetCode sets the value of Code.
func (*BadGatewayError) SetMessage ¶
func (s *BadGatewayError) SetMessage(val string)
SetMessage sets the value of Message.
func (*BadGatewayError) UnmarshalJSON ¶
func (s *BadGatewayError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type CancelOrderParams ¶
CancelOrderParams is parameters of cancelOrder operation.
type CancelOrderRes ¶
type CancelOrderRes 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) CancelOrder ¶
func (c *Client) CancelOrder(ctx context.Context, params CancelOrderParams) (CancelOrderRes, error)
CancelOrder invokes cancelOrder operation.
Cancels an existing order.
POST /api/v1/orders/{order_uuid}/cancel
func (*Client) CreateOrder ¶
func (c *Client) CreateOrder(ctx context.Context, request *OrderCreateRequest) (CreateOrderRes, error)
CreateOrder invokes createOrder operation.
Creates a new order.
POST /api/v1/orders
func (*Client) GetOrderByUuid ¶
func (c *Client) GetOrderByUuid(ctx context.Context, params GetOrderByUuidParams) (GetOrderByUuidRes, error)
GetOrderByUuid invokes getOrderByUuid operation.
Retrieves order details by UUID.
GET /api/v1/orders/{order_uuid}
func (*Client) PayOrder ¶
func (c *Client) PayOrder(ctx context.Context, request *OrderPayRequest, params PayOrderParams) (PayOrderRes, error)
PayOrder invokes payOrder operation.
Processes payment for an existing order.
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: #
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 CreateOrderRes ¶
type CreateOrderRes interface {
// contains filtered or unexported methods
}
type GenericError ¶
type GenericError struct {
// HTTP-код ошибки.
Code OptInt `json:"code"`
// Описание ошибки.
Message OptString `json:"message"`
}
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() OptInt
GetCode returns the value of Code.
func (*GenericError) GetMessage ¶
func (s *GenericError) GetMessage() OptString
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 OptInt)
SetCode sets the value of Code.
func (*GenericError) SetMessage ¶
func (s *GenericError) SetMessage(val OptString)
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 Handler ¶
type Handler interface {
// CancelOrder implements cancelOrder operation.
//
// Cancels an existing order.
//
// POST /api/v1/orders/{order_uuid}/cancel
CancelOrder(ctx context.Context, params CancelOrderParams) (CancelOrderRes, error)
// CreateOrder implements createOrder operation.
//
// Creates a new order.
//
// POST /api/v1/orders
CreateOrder(ctx context.Context, req *OrderCreateRequest) (CreateOrderRes, error)
// GetOrderByUuid implements getOrderByUuid operation.
//
// Retrieves order details by UUID.
//
// GET /api/v1/orders/{order_uuid}
GetOrderByUuid(ctx context.Context, params GetOrderByUuidParams) (GetOrderByUuidRes, error)
// PayOrder implements payOrder operation.
//
// Processes payment for an existing order.
//
// POST /api/v1/orders/{order_uuid}/pay
PayOrder(ctx context.Context, req *OrderPayRequest, 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 Invoker ¶
type Invoker interface {
// CancelOrder invokes cancelOrder operation.
//
// Cancels an existing order.
//
// POST /api/v1/orders/{order_uuid}/cancel
CancelOrder(ctx context.Context, params CancelOrderParams) (CancelOrderRes, error)
// CreateOrder invokes createOrder operation.
//
// Creates a new order.
//
// POST /api/v1/orders
CreateOrder(ctx context.Context, request *OrderCreateRequest) (CreateOrderRes, error)
// GetOrderByUuid invokes getOrderByUuid operation.
//
// Retrieves order details by UUID.
//
// GET /api/v1/orders/{order_uuid}
GetOrderByUuid(ctx context.Context, params GetOrderByUuidParams) (GetOrderByUuidRes, error)
// PayOrder invokes payOrder operation.
//
// Processes payment for an existing order.
//
// POST /api/v1/orders/{order_uuid}/pay
PayOrder(ctx context.Context, request *OrderPayRequest, 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: #
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 ( CancelOrderOperation OperationName = "CancelOrder" 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 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 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 WithAttributes ¶
WithAttributes specifies default otel attributes.
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 Order ¶
type Order struct {
// UUID заказа.
OrderUUID uuid.UUID `json:"order_uuid"`
// UUID пользователя.
UserUUID uuid.UUID `json:"user_uuid"`
// Список UUID деталей.
PartUuids []uuid.UUID `json:"part_uuids"`
// Сумма заказа в копейках.
TotalPriceMinor int64 `json:"total_price_minor"`
// UUID транзакции.
TransactionUUID OptUUID `json:"transaction_uuid"`
PaymentMethod OptPaymentMethod `json:"payment_method"`
Status OrderStatus `json:"status"`
}
Ref: #
func (*Order) GetOrderUUID ¶
GetOrderUUID returns the value of OrderUUID.
func (*Order) GetPartUuids ¶
GetPartUuids returns the value of PartUuids.
func (*Order) GetPaymentMethod ¶
func (s *Order) GetPaymentMethod() OptPaymentMethod
GetPaymentMethod returns the value of PaymentMethod.
func (*Order) GetStatus ¶
func (s *Order) GetStatus() OrderStatus
GetStatus returns the value of Status.
func (*Order) GetTotalPriceMinor ¶
GetTotalPriceMinor returns the value of TotalPriceMinor.
func (*Order) GetTransactionUUID ¶
GetTransactionUUID returns the value of TransactionUUID.
func (*Order) GetUserUUID ¶
GetUserUUID returns the value of UserUUID.
func (*Order) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Order) SetOrderUUID ¶
SetOrderUUID sets the value of OrderUUID.
func (*Order) SetPartUuids ¶
SetPartUuids sets the value of PartUuids.
func (*Order) SetPaymentMethod ¶
func (s *Order) SetPaymentMethod(val OptPaymentMethod)
SetPaymentMethod sets the value of PaymentMethod.
func (*Order) SetStatus ¶
func (s *Order) SetStatus(val OrderStatus)
SetStatus sets the value of Status.
func (*Order) SetTotalPriceMinor ¶
SetTotalPriceMinor sets the value of TotalPriceMinor.
func (*Order) SetTransactionUUID ¶
SetTransactionUUID sets the value of TransactionUUID.
func (*Order) SetUserUUID ¶
SetUserUUID sets the value of UserUUID.
func (*Order) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OrderCreateRequest ¶
type OrderCreateRequest struct {
UserUUID UserUUID `json:"user_uuid"`
PartUuids PartUuids `json:"part_uuids"`
}
Ref: #
func (*OrderCreateRequest) Decode ¶
func (s *OrderCreateRequest) Decode(d *jx.Decoder) error
Decode decodes OrderCreateRequest from json.
func (*OrderCreateRequest) Encode ¶
func (s *OrderCreateRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*OrderCreateRequest) GetPartUuids ¶
func (s *OrderCreateRequest) GetPartUuids() PartUuids
GetPartUuids returns the value of PartUuids.
func (*OrderCreateRequest) GetUserUUID ¶
func (s *OrderCreateRequest) GetUserUUID() UserUUID
GetUserUUID returns the value of UserUUID.
func (*OrderCreateRequest) MarshalJSON ¶
func (s *OrderCreateRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*OrderCreateRequest) SetPartUuids ¶
func (s *OrderCreateRequest) SetPartUuids(val PartUuids)
SetPartUuids sets the value of PartUuids.
func (*OrderCreateRequest) SetUserUUID ¶
func (s *OrderCreateRequest) SetUserUUID(val UserUUID)
SetUserUUID sets the value of UserUUID.
func (*OrderCreateRequest) UnmarshalJSON ¶
func (s *OrderCreateRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*OrderCreateRequest) Validate ¶
func (s *OrderCreateRequest) Validate() error
type OrderCreateResponse ¶
type OrderCreateResponse struct {
OrderUUID OrderUUID `json:"order_uuid"`
TotalPriceMinor TotalPriceMinor `json:"total_price_minor"`
}
Ref: #
func (*OrderCreateResponse) Decode ¶
func (s *OrderCreateResponse) Decode(d *jx.Decoder) error
Decode decodes OrderCreateResponse from json.
func (*OrderCreateResponse) Encode ¶
func (s *OrderCreateResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*OrderCreateResponse) GetOrderUUID ¶
func (s *OrderCreateResponse) GetOrderUUID() OrderUUID
GetOrderUUID returns the value of OrderUUID.
func (*OrderCreateResponse) GetTotalPriceMinor ¶
func (s *OrderCreateResponse) GetTotalPriceMinor() TotalPriceMinor
GetTotalPriceMinor returns the value of TotalPriceMinor.
func (*OrderCreateResponse) MarshalJSON ¶
func (s *OrderCreateResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*OrderCreateResponse) SetOrderUUID ¶
func (s *OrderCreateResponse) SetOrderUUID(val OrderUUID)
SetOrderUUID sets the value of OrderUUID.
func (*OrderCreateResponse) SetTotalPriceMinor ¶
func (s *OrderCreateResponse) SetTotalPriceMinor(val TotalPriceMinor)
SetTotalPriceMinor sets the value of TotalPriceMinor.
func (*OrderCreateResponse) UnmarshalJSON ¶
func (s *OrderCreateResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OrderPayRequest ¶
type OrderPayRequest struct {
PaymentMethod PaymentMethod `json:"payment_method"`
}
Ref: #
func (*OrderPayRequest) Decode ¶
func (s *OrderPayRequest) Decode(d *jx.Decoder) error
Decode decodes OrderPayRequest from json.
func (*OrderPayRequest) Encode ¶
func (s *OrderPayRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*OrderPayRequest) GetPaymentMethod ¶
func (s *OrderPayRequest) GetPaymentMethod() PaymentMethod
GetPaymentMethod returns the value of PaymentMethod.
func (*OrderPayRequest) MarshalJSON ¶
func (s *OrderPayRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*OrderPayRequest) SetPaymentMethod ¶
func (s *OrderPayRequest) SetPaymentMethod(val PaymentMethod)
SetPaymentMethod sets the value of PaymentMethod.
func (*OrderPayRequest) UnmarshalJSON ¶
func (s *OrderPayRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*OrderPayRequest) Validate ¶
func (s *OrderPayRequest) Validate() error
type OrderPayResponse ¶
type OrderPayResponse struct {
// UUID транзакции.
TransactionUUID uuid.UUID `json:"transaction_uuid"`
}
Ref: #
func (*OrderPayResponse) Decode ¶
func (s *OrderPayResponse) Decode(d *jx.Decoder) error
Decode decodes OrderPayResponse from json.
func (*OrderPayResponse) Encode ¶
func (s *OrderPayResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*OrderPayResponse) GetTransactionUUID ¶
func (s *OrderPayResponse) GetTransactionUUID() uuid.UUID
GetTransactionUUID returns the value of TransactionUUID.
func (*OrderPayResponse) MarshalJSON ¶
func (s *OrderPayResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*OrderPayResponse) SetTransactionUUID ¶
func (s *OrderPayResponse) SetTransactionUUID(val uuid.UUID)
SetTransactionUUID sets the value of TransactionUUID.
func (*OrderPayResponse) UnmarshalJSON ¶
func (s *OrderPayResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OrderStatus ¶
type OrderStatus string
Статус заказа. Ref: #
const ( OrderStatusSTATUSPENDINGPAYMENT OrderStatus = "STATUS_PENDING_PAYMENT" OrderStatusSTATUSPAID OrderStatus = "STATUS_PAID" OrderStatusSTATUSCANCELLED OrderStatus = "STATUS_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 OrderUUID ¶
func (OrderUUID) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OrderUUID) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type PartUuids ¶
func (PartUuids) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*PartUuids) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type PayOrderParams ¶
PayOrderParams is parameters of payOrder operation.
type PayOrderRes ¶
type PayOrderRes interface {
// contains filtered or unexported methods
}
type PaymentMethod ¶
type PaymentMethod string
Способ оплаты. Ref: #
const ( PaymentMethodPAYMENTMETHODUNSPECIFIED PaymentMethod = "PAYMENT_METHOD_UNSPECIFIED" PaymentMethodPAYMENTMETHODCARD PaymentMethod = "PAYMENT_METHOD_CARD" PaymentMethodPAYMENTMETHODSBP PaymentMethod = "PAYMENT_METHOD_SBP" PaymentMethodPAYMENTMETHODCREDITCARD PaymentMethod = "PAYMENT_METHOD_CREDIT_CARD" PaymentMethodPAYMENTMETHODINVESTORMONEY PaymentMethod = "PAYMENT_METHOD_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) OperationGroup ¶
OperationGroup returns the x-ogen-operation-group value.
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 TotalPriceMinor ¶
type TotalPriceMinor int64
func (*TotalPriceMinor) Decode ¶
func (s *TotalPriceMinor) Decode(d *jx.Decoder) error
Decode decodes TotalPriceMinor from json.
func (TotalPriceMinor) Encode ¶
func (s TotalPriceMinor) Encode(e *jx.Encoder)
Encode encodes TotalPriceMinor as json.
func (TotalPriceMinor) MarshalJSON ¶
func (s TotalPriceMinor) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*TotalPriceMinor) UnmarshalJSON ¶
func (s *TotalPriceMinor) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) CancelOrder ¶
func (UnimplementedHandler) CancelOrder(ctx context.Context, params CancelOrderParams) (r CancelOrderRes, _ error)
CancelOrder implements cancelOrder operation.
Cancels an existing order.
POST /api/v1/orders/{order_uuid}/cancel
func (UnimplementedHandler) CreateOrder ¶
func (UnimplementedHandler) CreateOrder(ctx context.Context, req *OrderCreateRequest) (r CreateOrderRes, _ error)
CreateOrder implements createOrder operation.
Creates a new order.
POST /api/v1/orders
func (UnimplementedHandler) GetOrderByUuid ¶
func (UnimplementedHandler) GetOrderByUuid(ctx context.Context, params GetOrderByUuidParams) (r GetOrderByUuidRes, _ error)
GetOrderByUuid implements getOrderByUuid operation.
Retrieves order details by 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 *OrderPayRequest, params PayOrderParams) (r PayOrderRes, _ error)
PayOrder implements payOrder operation.
Processes payment for an existing order.
POST /api/v1/orders/{order_uuid}/pay
type UserUUID ¶
func (UserUUID) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*UserUUID) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type ValidationError ¶
type ValidationError struct {
// HTTP-код ошибки.
Code int `json:"code"`
// Описание ошибки.
Message string `json:"message"`
}
Ref: #
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