Documentation
¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- Variables
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type AttributeOption
- func (s *AttributeOption) Decode(d *jx.Decoder) error
- func (s *AttributeOption) Encode(e *jx.Encoder)
- func (s *AttributeOption) GetColorCode() OptString
- func (s *AttributeOption) GetName() string
- func (s *AttributeOption) GetSlug() string
- func (s *AttributeOption) GetSortOrder() int
- func (s *AttributeOption) MarshalJSON() ([]byte, error)
- func (s *AttributeOption) SetColorCode(val OptString)
- func (s *AttributeOption) SetName(val string)
- func (s *AttributeOption) SetSlug(val string)
- func (s *AttributeOption) SetSortOrder(val int)
- func (s *AttributeOption) UnmarshalJSON(data []byte) error
- type AttributeRole
- func (AttributeRole) AllValues() []AttributeRole
- func (s *AttributeRole) Decode(d *jx.Decoder) error
- func (s AttributeRole) Encode(e *jx.Encoder)
- func (s AttributeRole) MarshalJSON() ([]byte, error)
- func (s AttributeRole) MarshalText() ([]byte, error)
- func (s *AttributeRole) UnmarshalJSON(data []byte) error
- func (s *AttributeRole) UnmarshalText(data []byte) error
- func (s AttributeRole) Validate() error
- type AttributeType
- func (AttributeType) AllValues() []AttributeType
- func (s *AttributeType) Decode(d *jx.Decoder) error
- func (s AttributeType) Encode(e *jx.Encoder)
- func (s AttributeType) MarshalJSON() ([]byte, error)
- func (s AttributeType) MarshalText() ([]byte, error)
- func (s *AttributeType) UnmarshalJSON(data []byte) error
- func (s *AttributeType) UnmarshalText(data []byte) error
- func (s AttributeType) Validate() error
- type CategoryAttribute
- func (s *CategoryAttribute) Decode(d *jx.Decoder) error
- func (s *CategoryAttribute) Encode(e *jx.Encoder)
- func (s *CategoryAttribute) GetAttributeId() string
- func (s *CategoryAttribute) GetFilterable() bool
- func (s *CategoryAttribute) GetName() string
- func (s *CategoryAttribute) GetOptions() []AttributeOption
- func (s *CategoryAttribute) GetRole() AttributeRole
- func (s *CategoryAttribute) GetSearchable() bool
- func (s *CategoryAttribute) GetSlug() string
- func (s *CategoryAttribute) GetSortOrder() int
- func (s *CategoryAttribute) GetType() AttributeType
- func (s *CategoryAttribute) GetUnit() OptString
- func (s *CategoryAttribute) MarshalJSON() ([]byte, error)
- func (s *CategoryAttribute) SetAttributeId(val string)
- func (s *CategoryAttribute) SetFilterable(val bool)
- func (s *CategoryAttribute) SetName(val string)
- func (s *CategoryAttribute) SetOptions(val []AttributeOption)
- func (s *CategoryAttribute) SetRole(val AttributeRole)
- func (s *CategoryAttribute) SetSearchable(val bool)
- func (s *CategoryAttribute) SetSlug(val string)
- func (s *CategoryAttribute) SetSortOrder(val int)
- func (s *CategoryAttribute) SetType(val AttributeType)
- func (s *CategoryAttribute) SetUnit(val OptString)
- func (s *CategoryAttribute) UnmarshalJSON(data []byte) error
- func (s *CategoryAttribute) Validate() error
- type CategoryResponse
- func (s *CategoryResponse) Decode(d *jx.Decoder) error
- func (s *CategoryResponse) Encode(e *jx.Encoder)
- func (s *CategoryResponse) GetAttributes() []CategoryAttribute
- func (s *CategoryResponse) GetID() string
- func (s *CategoryResponse) GetName() string
- func (s *CategoryResponse) MarshalJSON() ([]byte, error)
- func (s *CategoryResponse) SetAttributes(val []CategoryAttribute)
- func (s *CategoryResponse) SetID(val string)
- func (s *CategoryResponse) SetName(val string)
- func (s *CategoryResponse) UnmarshalJSON(data []byte) error
- func (s *CategoryResponse) Validate() error
- type Client
- type ClientOption
- type ErrorHandler
- type GetAllActiveCategoriesOKApplicationJSON
- func (s *GetAllActiveCategoriesOKApplicationJSON) Decode(d *jx.Decoder) error
- func (s GetAllActiveCategoriesOKApplicationJSON) Encode(e *jx.Encoder)
- func (s GetAllActiveCategoriesOKApplicationJSON) MarshalJSON() ([]byte, error)
- func (s *GetAllActiveCategoriesOKApplicationJSON) UnmarshalJSON(data []byte) error
- func (s GetAllActiveCategoriesOKApplicationJSON) Validate() error
- type GetAllActiveCategoriesRes
- type GetCategoryByIdInternalServerError
- type GetCategoryByIdNotFound
- type GetCategoryByIdParams
- type GetCategoryByIdRes
- type Handler
- type Invoker
- type Labeler
- type Middleware
- type OperationName
- 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 OptURI
- func (o *OptURI) Decode(d *jx.Decoder) error
- func (o OptURI) Encode(e *jx.Encoder)
- func (o OptURI) Get() (v url.URL, ok bool)
- func (o OptURI) IsSet() bool
- func (s OptURI) MarshalJSON() ([]byte, error)
- func (o OptURI) Or(d url.URL) url.URL
- func (o *OptURI) Reset()
- func (o *OptURI) SetTo(v url.URL)
- func (s *OptURI) UnmarshalJSON(data []byte) error
- type Option
- type Problem
- func (s *Problem) Decode(d *jx.Decoder) error
- func (s *Problem) Encode(e *jx.Encoder)
- func (s *Problem) GetDetail() OptString
- func (s *Problem) GetErrors() []ProblemErrorsItem
- func (s *Problem) GetInstance() OptURI
- func (s *Problem) GetStatus() int
- func (s *Problem) GetTitle() string
- func (s *Problem) GetTraceId() OptString
- func (s *Problem) GetType() url.URL
- func (s *Problem) MarshalJSON() ([]byte, error)
- func (s *Problem) SetDetail(val OptString)
- func (s *Problem) SetErrors(val []ProblemErrorsItem)
- func (s *Problem) SetInstance(val OptURI)
- func (s *Problem) SetStatus(val int)
- func (s *Problem) SetTitle(val string)
- func (s *Problem) SetTraceId(val OptString)
- func (s *Problem) SetType(val url.URL)
- func (s *Problem) UnmarshalJSON(data []byte) error
- type ProblemErrorsItem
- func (s *ProblemErrorsItem) Decode(d *jx.Decoder) error
- func (s *ProblemErrorsItem) Encode(e *jx.Encoder)
- func (s *ProblemErrorsItem) GetField() OptString
- func (s *ProblemErrorsItem) GetMessage() OptString
- func (s *ProblemErrorsItem) MarshalJSON() ([]byte, error)
- func (s *ProblemErrorsItem) SetField(val OptString)
- func (s *ProblemErrorsItem) SetMessage(val OptString)
- func (s *ProblemErrorsItem) 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 UnimplementedHandler
Constants ¶
This section is empty.
Variables ¶
var OpenAPIDoc []byte
Functions ¶
Types ¶
type AttributeOption ¶
type AttributeOption struct {
// Display name of the option.
Name string `json:"name"`
// URL-friendly identifier.
Slug string `json:"slug"`
// Color hex code (for color attributes).
ColorCode OptString `json:"colorCode"`
// Sort order for display.
SortOrder int `json:"sortOrder"`
}
Attribute option for single/multiple type attributes. Ref: #/components/schemas/AttributeOption
func (*AttributeOption) Decode ¶
func (s *AttributeOption) Decode(d *jx.Decoder) error
Decode decodes AttributeOption from json.
func (*AttributeOption) Encode ¶
func (s *AttributeOption) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*AttributeOption) GetColorCode ¶
func (s *AttributeOption) GetColorCode() OptString
GetColorCode returns the value of ColorCode.
func (*AttributeOption) GetName ¶
func (s *AttributeOption) GetName() string
GetName returns the value of Name.
func (*AttributeOption) GetSlug ¶
func (s *AttributeOption) GetSlug() string
GetSlug returns the value of Slug.
func (*AttributeOption) GetSortOrder ¶
func (s *AttributeOption) GetSortOrder() int
GetSortOrder returns the value of SortOrder.
func (*AttributeOption) MarshalJSON ¶
func (s *AttributeOption) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*AttributeOption) SetColorCode ¶
func (s *AttributeOption) SetColorCode(val OptString)
SetColorCode sets the value of ColorCode.
func (*AttributeOption) SetName ¶
func (s *AttributeOption) SetName(val string)
SetName sets the value of Name.
func (*AttributeOption) SetSlug ¶
func (s *AttributeOption) SetSlug(val string)
SetSlug sets the value of Slug.
func (*AttributeOption) SetSortOrder ¶
func (s *AttributeOption) SetSortOrder(val int)
SetSortOrder sets the value of SortOrder.
func (*AttributeOption) UnmarshalJSON ¶
func (s *AttributeOption) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type AttributeRole ¶
type AttributeRole string
How an attribute is used in a category. Ref: #/components/schemas/AttributeRole
const ( AttributeRoleVariant AttributeRole = "variant" AttributeRoleSpecification AttributeRole = "specification" )
func (AttributeRole) AllValues ¶
func (AttributeRole) AllValues() []AttributeRole
AllValues returns all AttributeRole values.
func (*AttributeRole) Decode ¶
func (s *AttributeRole) Decode(d *jx.Decoder) error
Decode decodes AttributeRole from json.
func (AttributeRole) Encode ¶
func (s AttributeRole) Encode(e *jx.Encoder)
Encode encodes AttributeRole as json.
func (AttributeRole) MarshalJSON ¶
func (s AttributeRole) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (AttributeRole) MarshalText ¶
func (s AttributeRole) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*AttributeRole) UnmarshalJSON ¶
func (s *AttributeRole) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*AttributeRole) UnmarshalText ¶
func (s *AttributeRole) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (AttributeRole) Validate ¶
func (s AttributeRole) Validate() error
type AttributeType ¶
type AttributeType string
Type of the attribute. Ref: #/components/schemas/AttributeType
const ( AttributeTypeSingle AttributeType = "single" AttributeTypeMultiple AttributeType = "multiple" AttributeTypeRange AttributeType = "range" AttributeTypeBoolean AttributeType = "boolean" AttributeTypeText AttributeType = "text" )
func (AttributeType) AllValues ¶
func (AttributeType) AllValues() []AttributeType
AllValues returns all AttributeType values.
func (*AttributeType) Decode ¶
func (s *AttributeType) Decode(d *jx.Decoder) error
Decode decodes AttributeType from json.
func (AttributeType) Encode ¶
func (s AttributeType) Encode(e *jx.Encoder)
Encode encodes AttributeType as json.
func (AttributeType) MarshalJSON ¶
func (s AttributeType) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (AttributeType) MarshalText ¶
func (s AttributeType) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*AttributeType) UnmarshalJSON ¶
func (s *AttributeType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*AttributeType) UnmarshalText ¶
func (s *AttributeType) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
func (AttributeType) Validate ¶
func (s AttributeType) Validate() error
type CategoryAttribute ¶
type CategoryAttribute struct {
// Unique attribute identifier (UUID).
AttributeId string `json:"attributeId"`
// Display name of the attribute (denormalized from catalog-service).
Name string `json:"name"`
// URL-friendly identifier (denormalized from catalog-service).
Slug string `json:"slug"`
Type AttributeType `json:"type"`
// Unit of measurement for range attributes (denormalized from catalog-service).
Unit OptString `json:"unit"`
// Available options for single/multiple type attributes (denormalized from catalog-service).
Options []AttributeOption `json:"options"`
Role AttributeRole `json:"role"`
// Sort order for display.
SortOrder int `json:"sortOrder"`
// Whether the attribute is filterable for this category.
Filterable bool `json:"filterable"`
// Whether the attribute is searchable for this category.
Searchable bool `json:"searchable"`
}
Ref: #/components/schemas/CategoryAttribute
func (*CategoryAttribute) Decode ¶
func (s *CategoryAttribute) Decode(d *jx.Decoder) error
Decode decodes CategoryAttribute from json.
func (*CategoryAttribute) Encode ¶
func (s *CategoryAttribute) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*CategoryAttribute) GetAttributeId ¶
func (s *CategoryAttribute) GetAttributeId() string
GetAttributeId returns the value of AttributeId.
func (*CategoryAttribute) GetFilterable ¶
func (s *CategoryAttribute) GetFilterable() bool
GetFilterable returns the value of Filterable.
func (*CategoryAttribute) GetName ¶
func (s *CategoryAttribute) GetName() string
GetName returns the value of Name.
func (*CategoryAttribute) GetOptions ¶
func (s *CategoryAttribute) GetOptions() []AttributeOption
GetOptions returns the value of Options.
func (*CategoryAttribute) GetRole ¶
func (s *CategoryAttribute) GetRole() AttributeRole
GetRole returns the value of Role.
func (*CategoryAttribute) GetSearchable ¶
func (s *CategoryAttribute) GetSearchable() bool
GetSearchable returns the value of Searchable.
func (*CategoryAttribute) GetSlug ¶
func (s *CategoryAttribute) GetSlug() string
GetSlug returns the value of Slug.
func (*CategoryAttribute) GetSortOrder ¶
func (s *CategoryAttribute) GetSortOrder() int
GetSortOrder returns the value of SortOrder.
func (*CategoryAttribute) GetType ¶
func (s *CategoryAttribute) GetType() AttributeType
GetType returns the value of Type.
func (*CategoryAttribute) GetUnit ¶
func (s *CategoryAttribute) GetUnit() OptString
GetUnit returns the value of Unit.
func (*CategoryAttribute) MarshalJSON ¶
func (s *CategoryAttribute) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CategoryAttribute) SetAttributeId ¶
func (s *CategoryAttribute) SetAttributeId(val string)
SetAttributeId sets the value of AttributeId.
func (*CategoryAttribute) SetFilterable ¶
func (s *CategoryAttribute) SetFilterable(val bool)
SetFilterable sets the value of Filterable.
func (*CategoryAttribute) SetName ¶
func (s *CategoryAttribute) SetName(val string)
SetName sets the value of Name.
func (*CategoryAttribute) SetOptions ¶
func (s *CategoryAttribute) SetOptions(val []AttributeOption)
SetOptions sets the value of Options.
func (*CategoryAttribute) SetRole ¶
func (s *CategoryAttribute) SetRole(val AttributeRole)
SetRole sets the value of Role.
func (*CategoryAttribute) SetSearchable ¶
func (s *CategoryAttribute) SetSearchable(val bool)
SetSearchable sets the value of Searchable.
func (*CategoryAttribute) SetSlug ¶
func (s *CategoryAttribute) SetSlug(val string)
SetSlug sets the value of Slug.
func (*CategoryAttribute) SetSortOrder ¶
func (s *CategoryAttribute) SetSortOrder(val int)
SetSortOrder sets the value of SortOrder.
func (*CategoryAttribute) SetType ¶
func (s *CategoryAttribute) SetType(val AttributeType)
SetType sets the value of Type.
func (*CategoryAttribute) SetUnit ¶
func (s *CategoryAttribute) SetUnit(val OptString)
SetUnit sets the value of Unit.
func (*CategoryAttribute) UnmarshalJSON ¶
func (s *CategoryAttribute) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*CategoryAttribute) Validate ¶
func (s *CategoryAttribute) Validate() error
type CategoryResponse ¶
type CategoryResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Attributes []CategoryAttribute `json:"attributes"`
}
Ref: #/components/schemas/CategoryResponse
func (*CategoryResponse) Decode ¶
func (s *CategoryResponse) Decode(d *jx.Decoder) error
Decode decodes CategoryResponse from json.
func (*CategoryResponse) Encode ¶
func (s *CategoryResponse) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*CategoryResponse) GetAttributes ¶
func (s *CategoryResponse) GetAttributes() []CategoryAttribute
GetAttributes returns the value of Attributes.
func (*CategoryResponse) GetID ¶
func (s *CategoryResponse) GetID() string
GetID returns the value of ID.
func (*CategoryResponse) GetName ¶
func (s *CategoryResponse) GetName() string
GetName returns the value of Name.
func (*CategoryResponse) MarshalJSON ¶
func (s *CategoryResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*CategoryResponse) SetAttributes ¶
func (s *CategoryResponse) SetAttributes(val []CategoryAttribute)
SetAttributes sets the value of Attributes.
func (*CategoryResponse) SetID ¶
func (s *CategoryResponse) SetID(val string)
SetID sets the value of ID.
func (*CategoryResponse) SetName ¶
func (s *CategoryResponse) SetName(val string)
SetName sets the value of Name.
func (*CategoryResponse) UnmarshalJSON ¶
func (s *CategoryResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*CategoryResponse) Validate ¶
func (s *CategoryResponse) Validate() error
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) GetAllActiveCategories ¶
func (c *Client) GetAllActiveCategories(ctx context.Context) (GetAllActiveCategoriesRes, error)
GetAllActiveCategories invokes getAllActiveCategories operation.
Get a list of all active categories.
GET /v1/category/list-active-categories
func (*Client) GetCategoryById ¶
func (c *Client) GetCategoryById(ctx context.Context, params GetCategoryByIdParams) (GetCategoryByIdRes, error)
GetCategoryById invokes getCategoryById operation.
Get a category by ID.
GET /v1/category/get/{id}
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 GetAllActiveCategoriesOKApplicationJSON ¶
type GetAllActiveCategoriesOKApplicationJSON []CategoryResponse
func (*GetAllActiveCategoriesOKApplicationJSON) Decode ¶
func (s *GetAllActiveCategoriesOKApplicationJSON) Decode(d *jx.Decoder) error
Decode decodes GetAllActiveCategoriesOKApplicationJSON from json.
func (GetAllActiveCategoriesOKApplicationJSON) Encode ¶
func (s GetAllActiveCategoriesOKApplicationJSON) Encode(e *jx.Encoder)
Encode encodes GetAllActiveCategoriesOKApplicationJSON as json.
func (GetAllActiveCategoriesOKApplicationJSON) MarshalJSON ¶
func (s GetAllActiveCategoriesOKApplicationJSON) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetAllActiveCategoriesOKApplicationJSON) UnmarshalJSON ¶
func (s *GetAllActiveCategoriesOKApplicationJSON) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (GetAllActiveCategoriesOKApplicationJSON) Validate ¶
func (s GetAllActiveCategoriesOKApplicationJSON) Validate() error
type GetAllActiveCategoriesRes ¶
type GetAllActiveCategoriesRes interface {
// contains filtered or unexported methods
}
type GetCategoryByIdInternalServerError ¶
type GetCategoryByIdInternalServerError Problem
func (*GetCategoryByIdInternalServerError) Decode ¶
func (s *GetCategoryByIdInternalServerError) Decode(d *jx.Decoder) error
Decode decodes GetCategoryByIdInternalServerError from json.
func (*GetCategoryByIdInternalServerError) Encode ¶
func (s *GetCategoryByIdInternalServerError) Encode(e *jx.Encoder)
Encode encodes GetCategoryByIdInternalServerError as json.
func (*GetCategoryByIdInternalServerError) MarshalJSON ¶
func (s *GetCategoryByIdInternalServerError) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetCategoryByIdInternalServerError) UnmarshalJSON ¶
func (s *GetCategoryByIdInternalServerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetCategoryByIdNotFound ¶
type GetCategoryByIdNotFound Problem
func (*GetCategoryByIdNotFound) Decode ¶
func (s *GetCategoryByIdNotFound) Decode(d *jx.Decoder) error
Decode decodes GetCategoryByIdNotFound from json.
func (*GetCategoryByIdNotFound) Encode ¶
func (s *GetCategoryByIdNotFound) Encode(e *jx.Encoder)
Encode encodes GetCategoryByIdNotFound as json.
func (*GetCategoryByIdNotFound) MarshalJSON ¶
func (s *GetCategoryByIdNotFound) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*GetCategoryByIdNotFound) UnmarshalJSON ¶
func (s *GetCategoryByIdNotFound) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type GetCategoryByIdParams ¶
type GetCategoryByIdParams struct {
ID string
}
GetCategoryByIdParams is parameters of getCategoryById operation.
type GetCategoryByIdRes ¶
type GetCategoryByIdRes interface {
// contains filtered or unexported methods
}
type Handler ¶
type Handler interface {
// GetAllActiveCategories implements getAllActiveCategories operation.
//
// Get a list of all active categories.
//
// GET /v1/category/list-active-categories
GetAllActiveCategories(ctx context.Context) (GetAllActiveCategoriesRes, error)
// GetCategoryById implements getCategoryById operation.
//
// Get a category by ID.
//
// GET /v1/category/get/{id}
GetCategoryById(ctx context.Context, params GetCategoryByIdParams) (GetCategoryByIdRes, error)
}
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface {
// GetAllActiveCategories invokes getAllActiveCategories operation.
//
// Get a list of all active categories.
//
// GET /v1/category/list-active-categories
GetAllActiveCategories(ctx context.Context) (GetAllActiveCategoriesRes, error)
// GetCategoryById invokes getCategoryById operation.
//
// Get a category by ID.
//
// GET /v1/category/get/{id}
GetCategoryById(ctx context.Context, params GetCategoryByIdParams) (GetCategoryByIdRes, 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 ( GetAllActiveCategoriesOperation OperationName = "GetAllActiveCategories" GetCategoryByIdOperation OperationName = "GetCategoryById" )
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 OptURI ¶
OptURI is optional url.URL.
func (OptURI) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptURI) 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 Problem ¶
type Problem struct {
Type url.URL `json:"type"`
Title string `json:"title"`
Status int `json:"status"`
Detail OptString `json:"detail"`
Instance OptURI `json:"instance"`
TraceId OptString `json:"traceId"`
Errors []ProblemErrorsItem `json:"errors"`
}
RFC7807 Problem Details. Ref: #/components/schemas/Problem
func (*Problem) GetErrors ¶
func (s *Problem) GetErrors() []ProblemErrorsItem
GetErrors returns the value of Errors.
func (*Problem) GetInstance ¶
GetInstance returns the value of Instance.
func (*Problem) GetTraceId ¶
GetTraceId returns the value of TraceId.
func (*Problem) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Problem) SetErrors ¶
func (s *Problem) SetErrors(val []ProblemErrorsItem)
SetErrors sets the value of Errors.
func (*Problem) SetInstance ¶
SetInstance sets the value of Instance.
func (*Problem) SetTraceId ¶
SetTraceId sets the value of TraceId.
func (*Problem) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type ProblemErrorsItem ¶
func (*ProblemErrorsItem) Decode ¶
func (s *ProblemErrorsItem) Decode(d *jx.Decoder) error
Decode decodes ProblemErrorsItem from json.
func (*ProblemErrorsItem) Encode ¶
func (s *ProblemErrorsItem) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ProblemErrorsItem) GetField ¶
func (s *ProblemErrorsItem) GetField() OptString
GetField returns the value of Field.
func (*ProblemErrorsItem) GetMessage ¶
func (s *ProblemErrorsItem) GetMessage() OptString
GetMessage returns the value of Message.
func (*ProblemErrorsItem) MarshalJSON ¶
func (s *ProblemErrorsItem) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ProblemErrorsItem) SetField ¶
func (s *ProblemErrorsItem) SetField(val OptString)
SetField sets the value of Field.
func (*ProblemErrorsItem) SetMessage ¶
func (s *ProblemErrorsItem) SetMessage(val OptString)
SetMessage sets the value of Message.
func (*ProblemErrorsItem) UnmarshalJSON ¶
func (s *ProblemErrorsItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
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.
func ProvideServer ¶ added in v1.0.14
func ProvideServer( handler Handler, tracerProvider trace.TracerProvider, meterProvider metric.MeterProvider, middlewares []middleware.Middleware, errorHandler ogenerrors.ErrorHandler, ) (*Server, error)
ProvideServer creates an ogen server for fx DI.
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) GetAllActiveCategories ¶
func (UnimplementedHandler) GetAllActiveCategories(ctx context.Context) (r GetAllActiveCategoriesRes, _ error)
GetAllActiveCategories implements getAllActiveCategories operation.
Get a list of all active categories.
GET /v1/category/list-active-categories
func (UnimplementedHandler) GetCategoryById ¶
func (UnimplementedHandler) GetCategoryById(ctx context.Context, params GetCategoryByIdParams) (r GetCategoryByIdRes, _ error)
GetCategoryById implements getCategoryById operation.
Get a category by ID.
GET /v1/category/get/{id}
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_server_provider.gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go
- openapi_embed.gen.go