httpapi

package
v1.0.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Code generated by ogen, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var OpenAPIDoc []byte

Functions

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

Types

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) ConfirmUpload

func (c *Client) ConfirmUpload(ctx context.Context, request *ConfirmRequest) (ConfirmUploadRes, error)

ConfirmUpload invokes confirmUpload operation.

Confirm upload (HEAD against S3), persist metadata.

POST /v1/images/confirm

func (*Client) CreatePresign

func (c *Client) CreatePresign(ctx context.Context, request *PresignRequest) (CreatePresignRes, error)

CreatePresign invokes createPresign operation.

Create a POST policy for uploading an image to MinIO/S3 with size validation.

POST /v1/images/presign

func (*Client) DeleteImage

func (c *Client) DeleteImage(ctx context.Context, params DeleteImageParams) (DeleteImageRes, error)

DeleteImage invokes deleteImage operation.

Delete image (soft or hard, per policy).

DELETE /v1/images/{id}

func (*Client) GetDeliveryUrl

func (c *Client) GetDeliveryUrl(ctx context.Context, params GetDeliveryUrlParams) (GetDeliveryUrlRes, error)

GetDeliveryUrl invokes getDeliveryUrl operation.

Generate a signed imgproxy URL for delivery with requested params.

GET /v1/images/{id}/url

func (*Client) GetImage

func (c *Client) GetImage(ctx context.Context, params GetImageParams) (GetImageRes, error)

GetImage invokes getImage operation.

Get image metadata.

GET /v1/images/{id}

func (*Client) PromoteImages

func (c *Client) PromoteImages(ctx context.Context, request *PromoteRequest) (PromoteImagesRes, error)

PromoteImages invokes promoteImages operation.

Promote images from a product draft to a final product.

POST /v1/images/promote

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 ConfirmRequest

type ConfirmRequest struct {
	// Signed JWT token from presign response.
	UploadToken string    `json:"uploadToken"`
	Alt         string    `json:"alt"`
	Role        ImageRole `json:"role"`
	// E.g., SHA256 hex for additional integrity check.
	Checksum OptNilString `json:"checksum"`
}

Ref: #/components/schemas/ConfirmRequest

func (*ConfirmRequest) Decode

func (s *ConfirmRequest) Decode(d *jx.Decoder) error

Decode decodes ConfirmRequest from json.

func (*ConfirmRequest) Encode

func (s *ConfirmRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ConfirmRequest) GetAlt

func (s *ConfirmRequest) GetAlt() string

GetAlt returns the value of Alt.

func (*ConfirmRequest) GetChecksum

func (s *ConfirmRequest) GetChecksum() OptNilString

GetChecksum returns the value of Checksum.

func (*ConfirmRequest) GetRole

func (s *ConfirmRequest) GetRole() ImageRole

GetRole returns the value of Role.

func (*ConfirmRequest) GetUploadToken

func (s *ConfirmRequest) GetUploadToken() string

GetUploadToken returns the value of UploadToken.

func (*ConfirmRequest) MarshalJSON

func (s *ConfirmRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ConfirmRequest) SetAlt

func (s *ConfirmRequest) SetAlt(val string)

SetAlt sets the value of Alt.

func (*ConfirmRequest) SetChecksum

func (s *ConfirmRequest) SetChecksum(val OptNilString)

SetChecksum sets the value of Checksum.

func (*ConfirmRequest) SetRole

func (s *ConfirmRequest) SetRole(val ImageRole)

SetRole sets the value of Role.

func (*ConfirmRequest) SetUploadToken

func (s *ConfirmRequest) SetUploadToken(val string)

SetUploadToken sets the value of UploadToken.

func (*ConfirmRequest) UnmarshalJSON

func (s *ConfirmRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ConfirmRequest) Validate

func (s *ConfirmRequest) Validate() error

type ConfirmUploadBadRequest

type ConfirmUploadBadRequest Problem

func (*ConfirmUploadBadRequest) Decode

func (s *ConfirmUploadBadRequest) Decode(d *jx.Decoder) error

Decode decodes ConfirmUploadBadRequest from json.

func (*ConfirmUploadBadRequest) Encode

func (s *ConfirmUploadBadRequest) Encode(e *jx.Encoder)

Encode encodes ConfirmUploadBadRequest as json.

func (*ConfirmUploadBadRequest) MarshalJSON

func (s *ConfirmUploadBadRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ConfirmUploadBadRequest) UnmarshalJSON

func (s *ConfirmUploadBadRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ConfirmUploadConflict

type ConfirmUploadConflict Problem

func (*ConfirmUploadConflict) Decode

func (s *ConfirmUploadConflict) Decode(d *jx.Decoder) error

Decode decodes ConfirmUploadConflict from json.

func (*ConfirmUploadConflict) Encode

func (s *ConfirmUploadConflict) Encode(e *jx.Encoder)

Encode encodes ConfirmUploadConflict as json.

func (*ConfirmUploadConflict) MarshalJSON

func (s *ConfirmUploadConflict) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ConfirmUploadConflict) UnmarshalJSON

func (s *ConfirmUploadConflict) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ConfirmUploadInternalServerError

type ConfirmUploadInternalServerError Problem

func (*ConfirmUploadInternalServerError) Decode

Decode decodes ConfirmUploadInternalServerError from json.

func (*ConfirmUploadInternalServerError) Encode

Encode encodes ConfirmUploadInternalServerError as json.

func (*ConfirmUploadInternalServerError) MarshalJSON

func (s *ConfirmUploadInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ConfirmUploadInternalServerError) UnmarshalJSON

func (s *ConfirmUploadInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ConfirmUploadNotFound

type ConfirmUploadNotFound Problem

func (*ConfirmUploadNotFound) Decode

func (s *ConfirmUploadNotFound) Decode(d *jx.Decoder) error

Decode decodes ConfirmUploadNotFound from json.

func (*ConfirmUploadNotFound) Encode

func (s *ConfirmUploadNotFound) Encode(e *jx.Encoder)

Encode encodes ConfirmUploadNotFound as json.

func (*ConfirmUploadNotFound) MarshalJSON

func (s *ConfirmUploadNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ConfirmUploadNotFound) UnmarshalJSON

func (s *ConfirmUploadNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ConfirmUploadRes

type ConfirmUploadRes interface {
	// contains filtered or unexported methods
}

type CreatePresignBadRequest

type CreatePresignBadRequest Problem

func (*CreatePresignBadRequest) Decode

func (s *CreatePresignBadRequest) Decode(d *jx.Decoder) error

Decode decodes CreatePresignBadRequest from json.

func (*CreatePresignBadRequest) Encode

func (s *CreatePresignBadRequest) Encode(e *jx.Encoder)

Encode encodes CreatePresignBadRequest as json.

func (*CreatePresignBadRequest) MarshalJSON

func (s *CreatePresignBadRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreatePresignBadRequest) UnmarshalJSON

func (s *CreatePresignBadRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreatePresignInternalServerError

type CreatePresignInternalServerError Problem

func (*CreatePresignInternalServerError) Decode

Decode decodes CreatePresignInternalServerError from json.

func (*CreatePresignInternalServerError) Encode

Encode encodes CreatePresignInternalServerError as json.

func (*CreatePresignInternalServerError) MarshalJSON

func (s *CreatePresignInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreatePresignInternalServerError) UnmarshalJSON

func (s *CreatePresignInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreatePresignRes

type CreatePresignRes interface {
	// contains filtered or unexported methods
}

type DeleteImageInternalServerError

type DeleteImageInternalServerError Problem

func (*DeleteImageInternalServerError) Decode

Decode decodes DeleteImageInternalServerError from json.

func (*DeleteImageInternalServerError) Encode

Encode encodes DeleteImageInternalServerError as json.

func (*DeleteImageInternalServerError) MarshalJSON

func (s *DeleteImageInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*DeleteImageInternalServerError) UnmarshalJSON

func (s *DeleteImageInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type DeleteImageNoContent

type DeleteImageNoContent struct{}

DeleteImageNoContent is response for DeleteImage operation.

type DeleteImageNotFound

type DeleteImageNotFound Problem

func (*DeleteImageNotFound) Decode

func (s *DeleteImageNotFound) Decode(d *jx.Decoder) error

Decode decodes DeleteImageNotFound from json.

func (*DeleteImageNotFound) Encode

func (s *DeleteImageNotFound) Encode(e *jx.Encoder)

Encode encodes DeleteImageNotFound as json.

func (*DeleteImageNotFound) MarshalJSON

func (s *DeleteImageNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*DeleteImageNotFound) UnmarshalJSON

func (s *DeleteImageNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type DeleteImageParams

type DeleteImageParams struct {
	ID   string
	Hard OptBool `json:",omitempty,omitzero"`
}

DeleteImageParams is parameters of deleteImage operation.

type DeleteImageRes

type DeleteImageRes interface {
	// contains filtered or unexported methods
}

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type GetDeliveryUrlFit

type GetDeliveryUrlFit string
const (
	GetDeliveryUrlFitCover   GetDeliveryUrlFit = "cover"
	GetDeliveryUrlFitContain GetDeliveryUrlFit = "contain"
	GetDeliveryUrlFitFill    GetDeliveryUrlFit = "fill"
	GetDeliveryUrlFitInside  GetDeliveryUrlFit = "inside"
	GetDeliveryUrlFitOutside GetDeliveryUrlFit = "outside"
)

func (GetDeliveryUrlFit) AllValues

func (GetDeliveryUrlFit) AllValues() []GetDeliveryUrlFit

AllValues returns all GetDeliveryUrlFit values.

func (GetDeliveryUrlFit) MarshalText

func (s GetDeliveryUrlFit) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*GetDeliveryUrlFit) UnmarshalText

func (s *GetDeliveryUrlFit) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (GetDeliveryUrlFit) Validate

func (s GetDeliveryUrlFit) Validate() error

type GetDeliveryUrlFormat

type GetDeliveryUrlFormat string
const (
	GetDeliveryUrlFormatOriginal GetDeliveryUrlFormat = "original"
	GetDeliveryUrlFormatWEBP     GetDeliveryUrlFormat = "webp"
	GetDeliveryUrlFormatAvif     GetDeliveryUrlFormat = "avif"
	GetDeliveryUrlFormatJpeg     GetDeliveryUrlFormat = "jpeg"
	GetDeliveryUrlFormatPNG      GetDeliveryUrlFormat = "png"
)

func (GetDeliveryUrlFormat) AllValues

AllValues returns all GetDeliveryUrlFormat values.

func (GetDeliveryUrlFormat) MarshalText

func (s GetDeliveryUrlFormat) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*GetDeliveryUrlFormat) UnmarshalText

func (s *GetDeliveryUrlFormat) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (GetDeliveryUrlFormat) Validate

func (s GetDeliveryUrlFormat) Validate() error

type GetDeliveryUrlInternalServerError

type GetDeliveryUrlInternalServerError Problem

func (*GetDeliveryUrlInternalServerError) Decode

Decode decodes GetDeliveryUrlInternalServerError from json.

func (*GetDeliveryUrlInternalServerError) Encode

Encode encodes GetDeliveryUrlInternalServerError as json.

func (*GetDeliveryUrlInternalServerError) MarshalJSON

func (s *GetDeliveryUrlInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetDeliveryUrlInternalServerError) UnmarshalJSON

func (s *GetDeliveryUrlInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetDeliveryUrlNotFound

type GetDeliveryUrlNotFound Problem

func (*GetDeliveryUrlNotFound) Decode

func (s *GetDeliveryUrlNotFound) Decode(d *jx.Decoder) error

Decode decodes GetDeliveryUrlNotFound from json.

func (*GetDeliveryUrlNotFound) Encode

func (s *GetDeliveryUrlNotFound) Encode(e *jx.Encoder)

Encode encodes GetDeliveryUrlNotFound as json.

func (*GetDeliveryUrlNotFound) MarshalJSON

func (s *GetDeliveryUrlNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetDeliveryUrlNotFound) UnmarshalJSON

func (s *GetDeliveryUrlNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetDeliveryUrlOK

type GetDeliveryUrlOK struct {
	URL       url.URL     `json:"url"`
	ExpiresAt OptDateTime `json:"expiresAt"`
}

func (*GetDeliveryUrlOK) Decode

func (s *GetDeliveryUrlOK) Decode(d *jx.Decoder) error

Decode decodes GetDeliveryUrlOK from json.

func (*GetDeliveryUrlOK) Encode

func (s *GetDeliveryUrlOK) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*GetDeliveryUrlOK) GetExpiresAt

func (s *GetDeliveryUrlOK) GetExpiresAt() OptDateTime

GetExpiresAt returns the value of ExpiresAt.

func (*GetDeliveryUrlOK) GetURL

func (s *GetDeliveryUrlOK) GetURL() url.URL

GetURL returns the value of URL.

func (*GetDeliveryUrlOK) MarshalJSON

func (s *GetDeliveryUrlOK) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetDeliveryUrlOK) SetExpiresAt

func (s *GetDeliveryUrlOK) SetExpiresAt(val OptDateTime)

SetExpiresAt sets the value of ExpiresAt.

func (*GetDeliveryUrlOK) SetURL

func (s *GetDeliveryUrlOK) SetURL(val url.URL)

SetURL sets the value of URL.

func (*GetDeliveryUrlOK) UnmarshalJSON

func (s *GetDeliveryUrlOK) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetDeliveryUrlParams

type GetDeliveryUrlParams struct {
	ID         string
	Variant    OptString               `json:",omitempty,omitzero"`
	W          OptInt                  `json:",omitempty,omitzero"`
	H          OptInt                  `json:",omitempty,omitzero"`
	Fit        OptGetDeliveryUrlFit    `json:",omitempty,omitzero"`
	Format     OptGetDeliveryUrlFormat `json:",omitempty,omitzero"`
	Quality    OptInt                  `json:",omitempty,omitzero"`
	Dpr        OptFloat64              `json:",omitempty,omitzero"`
	TtlSeconds OptInt                  `json:",omitempty,omitzero"`
}

GetDeliveryUrlParams is parameters of getDeliveryUrl operation.

type GetDeliveryUrlRes

type GetDeliveryUrlRes interface {
	// contains filtered or unexported methods
}

type GetImageInternalServerError

type GetImageInternalServerError Problem

func (*GetImageInternalServerError) Decode

Decode decodes GetImageInternalServerError from json.

func (*GetImageInternalServerError) Encode

func (s *GetImageInternalServerError) Encode(e *jx.Encoder)

Encode encodes GetImageInternalServerError as json.

func (*GetImageInternalServerError) MarshalJSON

func (s *GetImageInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetImageInternalServerError) UnmarshalJSON

func (s *GetImageInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetImageNotFound

type GetImageNotFound Problem

func (*GetImageNotFound) Decode

func (s *GetImageNotFound) Decode(d *jx.Decoder) error

Decode decodes GetImageNotFound from json.

func (*GetImageNotFound) Encode

func (s *GetImageNotFound) Encode(e *jx.Encoder)

Encode encodes GetImageNotFound as json.

func (*GetImageNotFound) MarshalJSON

func (s *GetImageNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetImageNotFound) UnmarshalJSON

func (s *GetImageNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetImageParams

type GetImageParams struct {
	ID string
}

GetImageParams is parameters of getImage operation.

type GetImageRes

type GetImageRes interface {
	// contains filtered or unexported methods
}

type Handler

type Handler interface {
	// ConfirmUpload implements confirmUpload operation.
	//
	// Confirm upload (HEAD against S3), persist metadata.
	//
	// POST /v1/images/confirm
	ConfirmUpload(ctx context.Context, req *ConfirmRequest) (ConfirmUploadRes, error)
	// CreatePresign implements createPresign operation.
	//
	// Create a POST policy for uploading an image to MinIO/S3 with size validation.
	//
	// POST /v1/images/presign
	CreatePresign(ctx context.Context, req *PresignRequest) (CreatePresignRes, error)
	// DeleteImage implements deleteImage operation.
	//
	// Delete image (soft or hard, per policy).
	//
	// DELETE /v1/images/{id}
	DeleteImage(ctx context.Context, params DeleteImageParams) (DeleteImageRes, error)
	// GetDeliveryUrl implements getDeliveryUrl operation.
	//
	// Generate a signed imgproxy URL for delivery with requested params.
	//
	// GET /v1/images/{id}/url
	GetDeliveryUrl(ctx context.Context, params GetDeliveryUrlParams) (GetDeliveryUrlRes, error)
	// GetImage implements getImage operation.
	//
	// Get image metadata.
	//
	// GET /v1/images/{id}
	GetImage(ctx context.Context, params GetImageParams) (GetImageRes, error)
	// PromoteImages implements promoteImages operation.
	//
	// Promote images from a product draft to a final product.
	//
	// POST /v1/images/promote
	PromoteImages(ctx context.Context, req *PromoteRequest) (PromoteImagesRes, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Image

type Image struct {
	ID        string    `json:"id"`
	OwnerType OwnerType `json:"ownerType"`
	OwnerId   string    `json:"ownerId"`
	Role      ImageRole `json:"role"`
	// S3 key of the original image.
	Key string `json:"key"`
	// Optional — direct URL if public or via proxy.
	URL        OptNilString `json:"url"`
	Alt        string       `json:"alt"`
	Mime       string       `json:"mime"`
	Size       int          `json:"size"`
	Hash       OptNilString `json:"hash"`
	Status     ImageStatus  `json:"status"`
	Variants   []Variant    `json:"variants"`
	CreatedAt  time.Time    `json:"createdAt"`
	ModifiedAt time.Time    `json:"modifiedAt"`
}

Ref: #/components/schemas/Image

func (*Image) Decode

func (s *Image) Decode(d *jx.Decoder) error

Decode decodes Image from json.

func (*Image) Encode

func (s *Image) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Image) GetAlt

func (s *Image) GetAlt() string

GetAlt returns the value of Alt.

func (*Image) GetCreatedAt

func (s *Image) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*Image) GetHash

func (s *Image) GetHash() OptNilString

GetHash returns the value of Hash.

func (*Image) GetID

func (s *Image) GetID() string

GetID returns the value of ID.

func (*Image) GetKey

func (s *Image) GetKey() string

GetKey returns the value of Key.

func (*Image) GetMime

func (s *Image) GetMime() string

GetMime returns the value of Mime.

func (*Image) GetModifiedAt

func (s *Image) GetModifiedAt() time.Time

GetModifiedAt returns the value of ModifiedAt.

func (*Image) GetOwnerId

func (s *Image) GetOwnerId() string

GetOwnerId returns the value of OwnerId.

func (*Image) GetOwnerType

func (s *Image) GetOwnerType() OwnerType

GetOwnerType returns the value of OwnerType.

func (*Image) GetRole

func (s *Image) GetRole() ImageRole

GetRole returns the value of Role.

func (*Image) GetSize

func (s *Image) GetSize() int

GetSize returns the value of Size.

func (*Image) GetStatus

func (s *Image) GetStatus() ImageStatus

GetStatus returns the value of Status.

func (*Image) GetURL

func (s *Image) GetURL() OptNilString

GetURL returns the value of URL.

func (*Image) GetVariants

func (s *Image) GetVariants() []Variant

GetVariants returns the value of Variants.

func (*Image) MarshalJSON

func (s *Image) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Image) SetAlt

func (s *Image) SetAlt(val string)

SetAlt sets the value of Alt.

func (*Image) SetCreatedAt

func (s *Image) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*Image) SetHash

func (s *Image) SetHash(val OptNilString)

SetHash sets the value of Hash.

func (*Image) SetID

func (s *Image) SetID(val string)

SetID sets the value of ID.

func (*Image) SetKey

func (s *Image) SetKey(val string)

SetKey sets the value of Key.

func (*Image) SetMime

func (s *Image) SetMime(val string)

SetMime sets the value of Mime.

func (*Image) SetModifiedAt

func (s *Image) SetModifiedAt(val time.Time)

SetModifiedAt sets the value of ModifiedAt.

func (*Image) SetOwnerId

func (s *Image) SetOwnerId(val string)

SetOwnerId sets the value of OwnerId.

func (*Image) SetOwnerType

func (s *Image) SetOwnerType(val OwnerType)

SetOwnerType sets the value of OwnerType.

func (*Image) SetRole

func (s *Image) SetRole(val ImageRole)

SetRole sets the value of Role.

func (*Image) SetSize

func (s *Image) SetSize(val int)

SetSize sets the value of Size.

func (*Image) SetStatus

func (s *Image) SetStatus(val ImageStatus)

SetStatus sets the value of Status.

func (*Image) SetURL

func (s *Image) SetURL(val OptNilString)

SetURL sets the value of URL.

func (*Image) SetVariants

func (s *Image) SetVariants(val []Variant)

SetVariants sets the value of Variants.

func (*Image) UnmarshalJSON

func (s *Image) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Image) Validate

func (s *Image) Validate() error

type ImageRole

type ImageRole string

Ref: #/components/schemas/ImageRole

const (
	ImageRoleMain    ImageRole = "main"
	ImageRoleGallery ImageRole = "gallery"
	ImageRoleOther   ImageRole = "other"
)

func (ImageRole) AllValues

func (ImageRole) AllValues() []ImageRole

AllValues returns all ImageRole values.

func (*ImageRole) Decode

func (s *ImageRole) Decode(d *jx.Decoder) error

Decode decodes ImageRole from json.

func (ImageRole) Encode

func (s ImageRole) Encode(e *jx.Encoder)

Encode encodes ImageRole as json.

func (ImageRole) MarshalJSON

func (s ImageRole) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (ImageRole) MarshalText

func (s ImageRole) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*ImageRole) UnmarshalJSON

func (s *ImageRole) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ImageRole) UnmarshalText

func (s *ImageRole) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (ImageRole) Validate

func (s ImageRole) Validate() error

type ImageStatus

type ImageStatus string

Ref: #/components/schemas/ImageStatus

const (
	ImageStatusUploaded ImageStatus = "uploaded"
	ImageStatusReady    ImageStatus = "ready"
	ImageStatusDeleted  ImageStatus = "deleted"
)

func (ImageStatus) AllValues

func (ImageStatus) AllValues() []ImageStatus

AllValues returns all ImageStatus values.

func (*ImageStatus) Decode

func (s *ImageStatus) Decode(d *jx.Decoder) error

Decode decodes ImageStatus from json.

func (ImageStatus) Encode

func (s ImageStatus) Encode(e *jx.Encoder)

Encode encodes ImageStatus as json.

func (ImageStatus) MarshalJSON

func (s ImageStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (ImageStatus) MarshalText

func (s ImageStatus) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*ImageStatus) UnmarshalJSON

func (s *ImageStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ImageStatus) UnmarshalText

func (s *ImageStatus) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (ImageStatus) Validate

func (s ImageStatus) Validate() error

type Invoker

type Invoker interface {
	// ConfirmUpload invokes confirmUpload operation.
	//
	// Confirm upload (HEAD against S3), persist metadata.
	//
	// POST /v1/images/confirm
	ConfirmUpload(ctx context.Context, request *ConfirmRequest) (ConfirmUploadRes, error)
	// CreatePresign invokes createPresign operation.
	//
	// Create a POST policy for uploading an image to MinIO/S3 with size validation.
	//
	// POST /v1/images/presign
	CreatePresign(ctx context.Context, request *PresignRequest) (CreatePresignRes, error)
	// DeleteImage invokes deleteImage operation.
	//
	// Delete image (soft or hard, per policy).
	//
	// DELETE /v1/images/{id}
	DeleteImage(ctx context.Context, params DeleteImageParams) (DeleteImageRes, error)
	// GetDeliveryUrl invokes getDeliveryUrl operation.
	//
	// Generate a signed imgproxy URL for delivery with requested params.
	//
	// GET /v1/images/{id}/url
	GetDeliveryUrl(ctx context.Context, params GetDeliveryUrlParams) (GetDeliveryUrlRes, error)
	// GetImage invokes getImage operation.
	//
	// Get image metadata.
	//
	// GET /v1/images/{id}
	GetImage(ctx context.Context, params GetImageParams) (GetImageRes, error)
	// PromoteImages invokes promoteImages operation.
	//
	// Promote images from a product draft to a final product.
	//
	// POST /v1/images/promote
	PromoteImages(ctx context.Context, request *PromoteRequest) (PromoteImagesRes, 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

func LabelerFromContext(ctx context.Context) (*Labeler, bool)

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) Add

func (l *Labeler) Add(attrs ...attribute.KeyValue)

Add attributes to the Labeler.

func (*Labeler) AttributeSet

func (l *Labeler) AttributeSet() attribute.Set

AttributeSet returns the attributes added to the Labeler as an attribute.Set.

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OperationName

type OperationName = string

OperationName is the ogen operation name

const (
	ConfirmUploadOperation  OperationName = "ConfirmUpload"
	CreatePresignOperation  OperationName = "CreatePresign"
	DeleteImageOperation    OperationName = "DeleteImage"
	GetDeliveryUrlOperation OperationName = "GetDeliveryUrl"
	GetImageOperation       OperationName = "GetImage"
	PromoteImagesOperation  OperationName = "PromoteImages"
)

type OptBool

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (OptBool) Get

func (o OptBool) Get() (v bool, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptBool) IsSet

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) Or

func (o OptBool) Or(d bool) bool

Or returns value if set, or given parameter if does not.

func (*OptBool) Reset

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetTo

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

type OptDateTime

type OptDateTime struct {
	Value time.Time
	Set   bool
}

OptDateTime is optional time.Time.

func NewOptDateTime

func NewOptDateTime(v time.Time) OptDateTime

NewOptDateTime returns new OptDateTime with value set to v.

func (*OptDateTime) Decode

func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error

Decode decodes time.Time from json.

func (OptDateTime) Encode

func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))

Encode encodes time.Time as json.

func (OptDateTime) Get

func (o OptDateTime) Get() (v time.Time, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptDateTime) IsSet

func (o OptDateTime) IsSet() bool

IsSet returns true if OptDateTime was set.

func (OptDateTime) MarshalJSON

func (s OptDateTime) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptDateTime) Or

func (o OptDateTime) Or(d time.Time) time.Time

Or returns value if set, or given parameter if does not.

func (*OptDateTime) Reset

func (o *OptDateTime) Reset()

Reset unsets value.

func (*OptDateTime) SetTo

func (o *OptDateTime) SetTo(v time.Time)

SetTo sets value to v.

func (*OptDateTime) UnmarshalJSON

func (s *OptDateTime) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptFloat64

type OptFloat64 struct {
	Value float64
	Set   bool
}

OptFloat64 is optional float64.

func NewOptFloat64

func NewOptFloat64(v float64) OptFloat64

NewOptFloat64 returns new OptFloat64 with value set to v.

func (OptFloat64) Get

func (o OptFloat64) Get() (v float64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptFloat64) IsSet

func (o OptFloat64) IsSet() bool

IsSet returns true if OptFloat64 was set.

func (OptFloat64) Or

func (o OptFloat64) Or(d float64) float64

Or returns value if set, or given parameter if does not.

func (*OptFloat64) Reset

func (o *OptFloat64) Reset()

Reset unsets value.

func (*OptFloat64) SetTo

func (o *OptFloat64) SetTo(v float64)

SetTo sets value to v.

type OptGetDeliveryUrlFit

type OptGetDeliveryUrlFit struct {
	Value GetDeliveryUrlFit
	Set   bool
}

OptGetDeliveryUrlFit is optional GetDeliveryUrlFit.

func NewOptGetDeliveryUrlFit

func NewOptGetDeliveryUrlFit(v GetDeliveryUrlFit) OptGetDeliveryUrlFit

NewOptGetDeliveryUrlFit returns new OptGetDeliveryUrlFit with value set to v.

func (OptGetDeliveryUrlFit) Get

Get returns value and boolean that denotes whether value was set.

func (OptGetDeliveryUrlFit) IsSet

func (o OptGetDeliveryUrlFit) IsSet() bool

IsSet returns true if OptGetDeliveryUrlFit was set.

func (OptGetDeliveryUrlFit) Or

Or returns value if set, or given parameter if does not.

func (*OptGetDeliveryUrlFit) Reset

func (o *OptGetDeliveryUrlFit) Reset()

Reset unsets value.

func (*OptGetDeliveryUrlFit) SetTo

SetTo sets value to v.

type OptGetDeliveryUrlFormat

type OptGetDeliveryUrlFormat struct {
	Value GetDeliveryUrlFormat
	Set   bool
}

OptGetDeliveryUrlFormat is optional GetDeliveryUrlFormat.

func NewOptGetDeliveryUrlFormat

func NewOptGetDeliveryUrlFormat(v GetDeliveryUrlFormat) OptGetDeliveryUrlFormat

NewOptGetDeliveryUrlFormat returns new OptGetDeliveryUrlFormat with value set to v.

func (OptGetDeliveryUrlFormat) Get

Get returns value and boolean that denotes whether value was set.

func (OptGetDeliveryUrlFormat) IsSet

func (o OptGetDeliveryUrlFormat) IsSet() bool

IsSet returns true if OptGetDeliveryUrlFormat was set.

func (OptGetDeliveryUrlFormat) Or

Or returns value if set, or given parameter if does not.

func (*OptGetDeliveryUrlFormat) Reset

func (o *OptGetDeliveryUrlFormat) Reset()

Reset unsets value.

func (*OptGetDeliveryUrlFormat) SetTo

SetTo sets value to v.

type OptInt

type OptInt struct {
	Value int
	Set   bool
}

OptInt is optional int.

func NewOptInt

func NewOptInt(v int) OptInt

NewOptInt returns new OptInt with value set to v.

func (*OptInt) Decode

func (o *OptInt) Decode(d *jx.Decoder) error

Decode decodes int from json.

func (OptInt) Encode

func (o OptInt) Encode(e *jx.Encoder)

Encode encodes int as json.

func (OptInt) Get

func (o OptInt) Get() (v int, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt) IsSet

func (o OptInt) IsSet() bool

IsSet returns true if OptInt was set.

func (OptInt) MarshalJSON

func (s OptInt) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt) Or

func (o OptInt) Or(d int) int

Or returns value if set, or given parameter if does not.

func (*OptInt) Reset

func (o *OptInt) Reset()

Reset unsets value.

func (*OptInt) SetTo

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

func (*OptInt) UnmarshalJSON

func (s *OptInt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilString

type OptNilString struct {
	Value string
	Set   bool
	Null  bool
}

OptNilString is optional nullable string.

func NewOptNilString

func NewOptNilString(v string) OptNilString

NewOptNilString returns new OptNilString with value set to v.

func (*OptNilString) Decode

func (o *OptNilString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptNilString) Encode

func (o OptNilString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptNilString) Get

func (o OptNilString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilString) IsNull

func (o OptNilString) IsNull() bool

IsNull returns true if value is Null.

func (OptNilString) IsSet

func (o OptNilString) IsSet() bool

IsSet returns true if OptNilString was set.

func (OptNilString) MarshalJSON

func (s OptNilString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilString) Or

func (o OptNilString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptNilString) Reset

func (o *OptNilString) Reset()

Reset unsets value.

func (*OptNilString) SetTo

func (o *OptNilString) SetTo(v string)

SetTo sets value to v.

func (*OptNilString) SetToNull

func (o *OptNilString) SetToNull()

SetToNull sets value to null.

func (*OptNilString) UnmarshalJSON

func (s *OptNilString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

func (s OptString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptURI

type OptURI struct {
	Value url.URL
	Set   bool
}

OptURI is optional url.URL.

func NewOptURI

func NewOptURI(v url.URL) OptURI

NewOptURI returns new OptURI with value set to v.

func (*OptURI) Decode

func (o *OptURI) Decode(d *jx.Decoder) error

Decode decodes url.URL from json.

func (OptURI) Encode

func (o OptURI) Encode(e *jx.Encoder)

Encode encodes url.URL as json.

func (OptURI) Get

func (o OptURI) Get() (v url.URL, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptURI) IsSet

func (o OptURI) IsSet() bool

IsSet returns true if OptURI was set.

func (OptURI) MarshalJSON

func (s OptURI) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptURI) Or

func (o OptURI) Or(d url.URL) url.URL

Or returns value if set, or given parameter if does not.

func (*OptURI) Reset

func (o *OptURI) Reset()

Reset unsets value.

func (*OptURI) SetTo

func (o *OptURI) SetTo(v url.URL)

SetTo sets value to v.

func (*OptURI) UnmarshalJSON

func (s *OptURI) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithAttributes

func WithAttributes(attributes ...attribute.KeyValue) Option

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 OwnerType

type OwnerType string

Ref: #/components/schemas/OwnerType

const (
	OwnerTypeDraft   OwnerType = "draft"
	OwnerTypeProduct OwnerType = "product"
	OwnerTypeUser    OwnerType = "user"
)

func (OwnerType) AllValues

func (OwnerType) AllValues() []OwnerType

AllValues returns all OwnerType values.

func (*OwnerType) Decode

func (s *OwnerType) Decode(d *jx.Decoder) error

Decode decodes OwnerType from json.

func (OwnerType) Encode

func (s OwnerType) Encode(e *jx.Encoder)

Encode encodes OwnerType as json.

func (OwnerType) MarshalJSON

func (s OwnerType) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OwnerType) MarshalText

func (s OwnerType) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*OwnerType) UnmarshalJSON

func (s *OwnerType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*OwnerType) UnmarshalText

func (s *OwnerType) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (OwnerType) Validate

func (s OwnerType) Validate() error

type PresignRequest

type PresignRequest struct {
	OwnerType OwnerType `json:"ownerType"`
	// Draft ID or owner ID.
	OwnerId     string                    `json:"ownerId"`
	Filename    string                    `json:"filename"`
	ContentType PresignRequestContentType `json:"contentType"`
	// Size in bytes.
	Size int       `json:"size"`
	Role ImageRole `json:"role"`
}

Ref: #/components/schemas/PresignRequest

func (*PresignRequest) Decode

func (s *PresignRequest) Decode(d *jx.Decoder) error

Decode decodes PresignRequest from json.

func (*PresignRequest) Encode

func (s *PresignRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PresignRequest) GetContentType

func (s *PresignRequest) GetContentType() PresignRequestContentType

GetContentType returns the value of ContentType.

func (*PresignRequest) GetFilename

func (s *PresignRequest) GetFilename() string

GetFilename returns the value of Filename.

func (*PresignRequest) GetOwnerId

func (s *PresignRequest) GetOwnerId() string

GetOwnerId returns the value of OwnerId.

func (*PresignRequest) GetOwnerType

func (s *PresignRequest) GetOwnerType() OwnerType

GetOwnerType returns the value of OwnerType.

func (*PresignRequest) GetRole

func (s *PresignRequest) GetRole() ImageRole

GetRole returns the value of Role.

func (*PresignRequest) GetSize

func (s *PresignRequest) GetSize() int

GetSize returns the value of Size.

func (*PresignRequest) MarshalJSON

func (s *PresignRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PresignRequest) SetContentType

func (s *PresignRequest) SetContentType(val PresignRequestContentType)

SetContentType sets the value of ContentType.

func (*PresignRequest) SetFilename

func (s *PresignRequest) SetFilename(val string)

SetFilename sets the value of Filename.

func (*PresignRequest) SetOwnerId

func (s *PresignRequest) SetOwnerId(val string)

SetOwnerId sets the value of OwnerId.

func (*PresignRequest) SetOwnerType

func (s *PresignRequest) SetOwnerType(val OwnerType)

SetOwnerType sets the value of OwnerType.

func (*PresignRequest) SetRole

func (s *PresignRequest) SetRole(val ImageRole)

SetRole sets the value of Role.

func (*PresignRequest) SetSize

func (s *PresignRequest) SetSize(val int)

SetSize sets the value of Size.

func (*PresignRequest) UnmarshalJSON

func (s *PresignRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PresignRequest) Validate

func (s *PresignRequest) Validate() error

type PresignRequestContentType

type PresignRequestContentType string
const (
	PresignRequestContentTypeImageJpeg PresignRequestContentType = "image/jpeg"
	PresignRequestContentTypeImagePNG  PresignRequestContentType = "image/png"
	PresignRequestContentTypeImageWEBP PresignRequestContentType = "image/webp"
	PresignRequestContentTypeImageAvif PresignRequestContentType = "image/avif"
)

func (PresignRequestContentType) AllValues

AllValues returns all PresignRequestContentType values.

func (*PresignRequestContentType) Decode

func (s *PresignRequestContentType) Decode(d *jx.Decoder) error

Decode decodes PresignRequestContentType from json.

func (PresignRequestContentType) Encode

func (s PresignRequestContentType) Encode(e *jx.Encoder)

Encode encodes PresignRequestContentType as json.

func (PresignRequestContentType) MarshalJSON

func (s PresignRequestContentType) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (PresignRequestContentType) MarshalText

func (s PresignRequestContentType) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*PresignRequestContentType) UnmarshalJSON

func (s *PresignRequestContentType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PresignRequestContentType) UnmarshalText

func (s *PresignRequestContentType) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (PresignRequestContentType) Validate

func (s PresignRequestContentType) Validate() error

type PresignResponse

type PresignResponse struct {
	// URL to POST the file to (multipart/form-data).
	UploadUrl url.URL `json:"uploadUrl"`
	// Signed JWT token for confirm endpoint (contains key, ownerType, ownerId, role, etc.).
	UploadToken string `json:"uploadToken"`
	// TTL in seconds.
	ExpiresIn int `json:"expiresIn"`
	// Form fields to include with POST upload. Must be sent BEFORE the file field.
	// Includes: key, Content-Type, policy, x-amz-algorithm, x-amz-credential, x-amz-date, x-amz-signature.
	FormData PresignResponseFormData `json:"formData"`
}

Ref: #/components/schemas/PresignResponse

func (*PresignResponse) Decode

func (s *PresignResponse) Decode(d *jx.Decoder) error

Decode decodes PresignResponse from json.

func (*PresignResponse) Encode

func (s *PresignResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PresignResponse) GetExpiresIn

func (s *PresignResponse) GetExpiresIn() int

GetExpiresIn returns the value of ExpiresIn.

func (*PresignResponse) GetFormData

func (s *PresignResponse) GetFormData() PresignResponseFormData

GetFormData returns the value of FormData.

func (*PresignResponse) GetUploadToken

func (s *PresignResponse) GetUploadToken() string

GetUploadToken returns the value of UploadToken.

func (*PresignResponse) GetUploadUrl

func (s *PresignResponse) GetUploadUrl() url.URL

GetUploadUrl returns the value of UploadUrl.

func (*PresignResponse) MarshalJSON

func (s *PresignResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PresignResponse) SetExpiresIn

func (s *PresignResponse) SetExpiresIn(val int)

SetExpiresIn sets the value of ExpiresIn.

func (*PresignResponse) SetFormData

func (s *PresignResponse) SetFormData(val PresignResponseFormData)

SetFormData sets the value of FormData.

func (*PresignResponse) SetUploadToken

func (s *PresignResponse) SetUploadToken(val string)

SetUploadToken sets the value of UploadToken.

func (*PresignResponse) SetUploadUrl

func (s *PresignResponse) SetUploadUrl(val url.URL)

SetUploadUrl sets the value of UploadUrl.

func (*PresignResponse) UnmarshalJSON

func (s *PresignResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PresignResponseFormData

type PresignResponseFormData map[string]string

Form fields to include with POST upload. Must be sent BEFORE the file field. Includes: key, Content-Type, policy, x-amz-algorithm, x-amz-credential, x-amz-date, x-amz-signature.

func (*PresignResponseFormData) Decode

func (s *PresignResponseFormData) Decode(d *jx.Decoder) error

Decode decodes PresignResponseFormData from json.

func (PresignResponseFormData) Encode

func (s PresignResponseFormData) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (PresignResponseFormData) MarshalJSON

func (s PresignResponseFormData) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PresignResponseFormData) UnmarshalJSON

func (s *PresignResponseFormData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

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) Decode

func (s *Problem) Decode(d *jx.Decoder) error

Decode decodes Problem from json.

func (*Problem) Encode

func (s *Problem) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Problem) GetDetail

func (s *Problem) GetDetail() OptString

GetDetail returns the value of Detail.

func (*Problem) GetErrors

func (s *Problem) GetErrors() []ProblemErrorsItem

GetErrors returns the value of Errors.

func (*Problem) GetInstance

func (s *Problem) GetInstance() OptURI

GetInstance returns the value of Instance.

func (*Problem) GetStatus

func (s *Problem) GetStatus() int

GetStatus returns the value of Status.

func (*Problem) GetTitle

func (s *Problem) GetTitle() string

GetTitle returns the value of Title.

func (*Problem) GetTraceId

func (s *Problem) GetTraceId() OptString

GetTraceId returns the value of TraceId.

func (*Problem) GetType

func (s *Problem) GetType() url.URL

GetType returns the value of Type.

func (*Problem) MarshalJSON

func (s *Problem) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Problem) SetDetail

func (s *Problem) SetDetail(val OptString)

SetDetail sets the value of Detail.

func (*Problem) SetErrors

func (s *Problem) SetErrors(val []ProblemErrorsItem)

SetErrors sets the value of Errors.

func (*Problem) SetInstance

func (s *Problem) SetInstance(val OptURI)

SetInstance sets the value of Instance.

func (*Problem) SetStatus

func (s *Problem) SetStatus(val int)

SetStatus sets the value of Status.

func (*Problem) SetTitle

func (s *Problem) SetTitle(val string)

SetTitle sets the value of Title.

func (*Problem) SetTraceId

func (s *Problem) SetTraceId(val OptString)

SetTraceId sets the value of TraceId.

func (*Problem) SetType

func (s *Problem) SetType(val url.URL)

SetType sets the value of Type.

func (*Problem) UnmarshalJSON

func (s *Problem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ProblemErrorsItem

type ProblemErrorsItem struct {
	Field   OptString `json:"field"`
	Message OptString `json:"message"`
}

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 PromoteImagesBadRequest

type PromoteImagesBadRequest Problem

func (*PromoteImagesBadRequest) Decode

func (s *PromoteImagesBadRequest) Decode(d *jx.Decoder) error

Decode decodes PromoteImagesBadRequest from json.

func (*PromoteImagesBadRequest) Encode

func (s *PromoteImagesBadRequest) Encode(e *jx.Encoder)

Encode encodes PromoteImagesBadRequest as json.

func (*PromoteImagesBadRequest) MarshalJSON

func (s *PromoteImagesBadRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PromoteImagesBadRequest) UnmarshalJSON

func (s *PromoteImagesBadRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PromoteImagesConflict

type PromoteImagesConflict Problem

func (*PromoteImagesConflict) Decode

func (s *PromoteImagesConflict) Decode(d *jx.Decoder) error

Decode decodes PromoteImagesConflict from json.

func (*PromoteImagesConflict) Encode

func (s *PromoteImagesConflict) Encode(e *jx.Encoder)

Encode encodes PromoteImagesConflict as json.

func (*PromoteImagesConflict) MarshalJSON

func (s *PromoteImagesConflict) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PromoteImagesConflict) UnmarshalJSON

func (s *PromoteImagesConflict) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PromoteImagesInternalServerError

type PromoteImagesInternalServerError Problem

func (*PromoteImagesInternalServerError) Decode

Decode decodes PromoteImagesInternalServerError from json.

func (*PromoteImagesInternalServerError) Encode

Encode encodes PromoteImagesInternalServerError as json.

func (*PromoteImagesInternalServerError) MarshalJSON

func (s *PromoteImagesInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PromoteImagesInternalServerError) UnmarshalJSON

func (s *PromoteImagesInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PromoteImagesNotFound

type PromoteImagesNotFound Problem

func (*PromoteImagesNotFound) Decode

func (s *PromoteImagesNotFound) Decode(d *jx.Decoder) error

Decode decodes PromoteImagesNotFound from json.

func (*PromoteImagesNotFound) Encode

func (s *PromoteImagesNotFound) Encode(e *jx.Encoder)

Encode encodes PromoteImagesNotFound as json.

func (*PromoteImagesNotFound) MarshalJSON

func (s *PromoteImagesNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PromoteImagesNotFound) UnmarshalJSON

func (s *PromoteImagesNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PromoteImagesOK

type PromoteImagesOK struct {
	Promoted []Image `json:"promoted"`
}

func (*PromoteImagesOK) Decode

func (s *PromoteImagesOK) Decode(d *jx.Decoder) error

Decode decodes PromoteImagesOK from json.

func (*PromoteImagesOK) Encode

func (s *PromoteImagesOK) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PromoteImagesOK) GetPromoted

func (s *PromoteImagesOK) GetPromoted() []Image

GetPromoted returns the value of Promoted.

func (*PromoteImagesOK) MarshalJSON

func (s *PromoteImagesOK) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PromoteImagesOK) SetPromoted

func (s *PromoteImagesOK) SetPromoted(val []Image)

SetPromoted sets the value of Promoted.

func (*PromoteImagesOK) UnmarshalJSON

func (s *PromoteImagesOK) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PromoteImagesOK) Validate

func (s *PromoteImagesOK) Validate() error

type PromoteImagesRes

type PromoteImagesRes interface {
	// contains filtered or unexported methods
}

type PromoteRequest

type PromoteRequest struct {
	DraftId   string `json:"draftId"`
	ProductId string `json:"productId"`
	// If true — copy to products/{productId}/... and remove old objects.
	Move bool `json:"move"`
	// If omitted — promote all images of the draft.
	Images []string `json:"images"`
}

Ref: #/components/schemas/PromoteRequest

func (*PromoteRequest) Decode

func (s *PromoteRequest) Decode(d *jx.Decoder) error

Decode decodes PromoteRequest from json.

func (*PromoteRequest) Encode

func (s *PromoteRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PromoteRequest) GetDraftId

func (s *PromoteRequest) GetDraftId() string

GetDraftId returns the value of DraftId.

func (*PromoteRequest) GetImages

func (s *PromoteRequest) GetImages() []string

GetImages returns the value of Images.

func (*PromoteRequest) GetMove

func (s *PromoteRequest) GetMove() bool

GetMove returns the value of Move.

func (*PromoteRequest) GetProductId

func (s *PromoteRequest) GetProductId() string

GetProductId returns the value of ProductId.

func (*PromoteRequest) MarshalJSON

func (s *PromoteRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PromoteRequest) SetDraftId

func (s *PromoteRequest) SetDraftId(val string)

SetDraftId sets the value of DraftId.

func (*PromoteRequest) SetImages

func (s *PromoteRequest) SetImages(val []string)

SetImages sets the value of Images.

func (*PromoteRequest) SetMove

func (s *PromoteRequest) SetMove(val bool)

SetMove sets the value of Move.

func (*PromoteRequest) SetProductId

func (s *PromoteRequest) SetProductId(val string)

SetProductId sets the value of ProductId.

func (*PromoteRequest) UnmarshalJSON

func (s *PromoteRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PromoteRequest) Validate

func (s *PromoteRequest) Validate() error

type Route

type Route struct {
	// contains filtered or unexported fields
}

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationGroup

func (r Route) OperationGroup() string

OperationGroup returns the x-ogen-operation-group value.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary

func (r Route) Summary() string

Summary returns OpenAPI summary.

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.33

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.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

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) ConfirmUpload

func (UnimplementedHandler) ConfirmUpload(ctx context.Context, req *ConfirmRequest) (r ConfirmUploadRes, _ error)

ConfirmUpload implements confirmUpload operation.

Confirm upload (HEAD against S3), persist metadata.

POST /v1/images/confirm

func (UnimplementedHandler) CreatePresign

func (UnimplementedHandler) CreatePresign(ctx context.Context, req *PresignRequest) (r CreatePresignRes, _ error)

CreatePresign implements createPresign operation.

Create a POST policy for uploading an image to MinIO/S3 with size validation.

POST /v1/images/presign

func (UnimplementedHandler) DeleteImage

DeleteImage implements deleteImage operation.

Delete image (soft or hard, per policy).

DELETE /v1/images/{id}

func (UnimplementedHandler) GetDeliveryUrl

GetDeliveryUrl implements getDeliveryUrl operation.

Generate a signed imgproxy URL for delivery with requested params.

GET /v1/images/{id}/url

func (UnimplementedHandler) GetImage

func (UnimplementedHandler) GetImage(ctx context.Context, params GetImageParams) (r GetImageRes, _ error)

GetImage implements getImage operation.

Get image metadata.

GET /v1/images/{id}

func (UnimplementedHandler) PromoteImages

func (UnimplementedHandler) PromoteImages(ctx context.Context, req *PromoteRequest) (r PromoteImagesRes, _ error)

PromoteImages implements promoteImages operation.

Promote images from a product draft to a final product.

POST /v1/images/promote

type Variant

type Variant struct {
	Name OptString `json:"name"`
	// S3 key of the variant.
	Key    OptString `json:"key"`
	Width  OptInt    `json:"width"`
	Height OptInt    `json:"height"`
	Mime   OptString `json:"mime"`
	Size   OptInt    `json:"size"`
}

Ref: #/components/schemas/Variant

func (*Variant) Decode

func (s *Variant) Decode(d *jx.Decoder) error

Decode decodes Variant from json.

func (*Variant) Encode

func (s *Variant) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Variant) GetHeight

func (s *Variant) GetHeight() OptInt

GetHeight returns the value of Height.

func (*Variant) GetKey

func (s *Variant) GetKey() OptString

GetKey returns the value of Key.

func (*Variant) GetMime

func (s *Variant) GetMime() OptString

GetMime returns the value of Mime.

func (*Variant) GetName

func (s *Variant) GetName() OptString

GetName returns the value of Name.

func (*Variant) GetSize

func (s *Variant) GetSize() OptInt

GetSize returns the value of Size.

func (*Variant) GetWidth

func (s *Variant) GetWidth() OptInt

GetWidth returns the value of Width.

func (*Variant) MarshalJSON

func (s *Variant) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Variant) SetHeight

func (s *Variant) SetHeight(val OptInt)

SetHeight sets the value of Height.

func (*Variant) SetKey

func (s *Variant) SetKey(val OptString)

SetKey sets the value of Key.

func (*Variant) SetMime

func (s *Variant) SetMime(val OptString)

SetMime sets the value of Mime.

func (*Variant) SetName

func (s *Variant) SetName(val OptString)

SetName sets the value of Name.

func (*Variant) SetSize

func (s *Variant) SetSize(val OptInt)

SetSize sets the value of Size.

func (*Variant) SetWidth

func (s *Variant) SetWidth(val OptInt)

SetWidth sets the value of Width.

func (*Variant) UnmarshalJSON

func (s *Variant) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL