api

package
v0.0.0-...-2c50256 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Code generated by ogen, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithServerURL

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

WithServerURL sets context key to override server URL.

Types

type Book

type Book struct {
	ID           OptInt    `json:"id"`
	MediaID      OptInt    `json:"media_id"`
	Images       OptImages `json:"images"`
	Title        OptTitle  `json:"title"`
	Tags         []Tag     `json:"tags"`
	Scanlator    OptString `json:"scanlator"`
	UploadDate   OptInt    `json:"upload_date"`
	NumPages     OptInt    `json:"num_pages"`
	NumFavorites OptInt    `json:"num_favorites"`
}

Ref: #/components/schemas/Book

func (*Book) Decode

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

Decode decodes Book from json.

func (*Book) Encode

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

Encode implements json.Marshaler.

func (*Book) GetID

func (s *Book) GetID() OptInt

GetID returns the value of ID.

func (*Book) GetImages

func (s *Book) GetImages() OptImages

GetImages returns the value of Images.

func (*Book) GetMediaID

func (s *Book) GetMediaID() OptInt

GetMediaID returns the value of MediaID.

func (*Book) GetNumFavorites

func (s *Book) GetNumFavorites() OptInt

GetNumFavorites returns the value of NumFavorites.

func (*Book) GetNumPages

func (s *Book) GetNumPages() OptInt

GetNumPages returns the value of NumPages.

func (*Book) GetScanlator

func (s *Book) GetScanlator() OptString

GetScanlator returns the value of Scanlator.

func (*Book) GetTags

func (s *Book) GetTags() []Tag

GetTags returns the value of Tags.

func (*Book) GetTitle

func (s *Book) GetTitle() OptTitle

GetTitle returns the value of Title.

func (*Book) GetUploadDate

func (s *Book) GetUploadDate() OptInt

GetUploadDate returns the value of UploadDate.

func (*Book) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Book) SetFake

func (s *Book) SetFake()

SetFake set fake values.

func (*Book) SetID

func (s *Book) SetID(val OptInt)

SetID sets the value of ID.

func (*Book) SetImages

func (s *Book) SetImages(val OptImages)

SetImages sets the value of Images.

func (*Book) SetMediaID

func (s *Book) SetMediaID(val OptInt)

SetMediaID sets the value of MediaID.

func (*Book) SetNumFavorites

func (s *Book) SetNumFavorites(val OptInt)

SetNumFavorites sets the value of NumFavorites.

func (*Book) SetNumPages

func (s *Book) SetNumPages(val OptInt)

SetNumPages sets the value of NumPages.

func (*Book) SetScanlator

func (s *Book) SetScanlator(val OptString)

SetScanlator sets the value of Scanlator.

func (*Book) SetTags

func (s *Book) SetTags(val []Tag)

SetTags sets the value of Tags.

func (*Book) SetTitle

func (s *Book) SetTitle(val OptTitle)

SetTitle sets the value of Title.

func (*Book) SetUploadDate

func (s *Book) SetUploadDate(val OptInt)

SetUploadDate sets the value of UploadDate.

func (*Book) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Book) Validate

func (s *Book) 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) GetBook

func (c *Client) GetBook(ctx context.Context, params GetBookParams) (GetBookRes, error)

GetBook invokes getBook operation.

Gets metadata of book.

GET /api/gallery/{book_id}

func (*Client) GetPageCoverImage

func (c *Client) GetPageCoverImage(ctx context.Context, params GetPageCoverImageParams) (GetPageCoverImageRes, error)

GetPageCoverImage invokes getPageCoverImage operation.

Gets page cover.

GET /galleries/{media_id}/cover.{format}

func (*Client) GetPageImage

func (c *Client) GetPageImage(ctx context.Context, params GetPageImageParams) (GetPageImageRes, error)

GetPageImage invokes getPageImage operation.

Gets page.

GET /galleries/{media_id}/{page}.{format}

func (*Client) GetPageThumbnailImage

func (c *Client) GetPageThumbnailImage(ctx context.Context, params GetPageThumbnailImageParams) (GetPageThumbnailImageRes, error)

GetPageThumbnailImage invokes getPageThumbnailImage operation.

Gets page thumbnail.

GET /galleries/{media_id}/{page}t.{format}

func (*Client) Search

func (c *Client) Search(ctx context.Context, params SearchParams) (SearchRes, error)

Search invokes search operation.

Search for comics.

GET /api/galleries/search

func (*Client) SearchByTagID

func (c *Client) SearchByTagID(ctx context.Context, params SearchByTagIDParams) (SearchByTagIDRes, error)

SearchByTagID invokes searchByTagID operation.

Search for comics by tag ID.

GET /api/galleries/tagged

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 ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type GetBookForbidden

type GetBookForbidden struct{}

GetBookForbidden is response for GetBook operation.

type GetBookParams

type GetBookParams struct {
	// ID of book.
	BookID int
}

GetBookParams is parameters of getBook operation.

type GetBookRes

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

type GetPageCoverImageForbidden

type GetPageCoverImageForbidden struct{}

GetPageCoverImageForbidden is response for GetPageCoverImage operation.

type GetPageCoverImageOK

type GetPageCoverImageOK struct {
	Data io.Reader
}

func (GetPageCoverImageOK) Read

func (s GetPageCoverImageOK) Read(p []byte) (n int, err error)

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

type GetPageCoverImageOKHeaders

type GetPageCoverImageOKHeaders struct {
	ContentType string
	Response    GetPageCoverImageOK
}

GetPageCoverImageOKHeaders wraps GetPageCoverImageOK with response headers.

func (*GetPageCoverImageOKHeaders) GetContentType

func (s *GetPageCoverImageOKHeaders) GetContentType() string

GetContentType returns the value of ContentType.

func (*GetPageCoverImageOKHeaders) GetResponse

GetResponse returns the value of Response.

func (*GetPageCoverImageOKHeaders) SetContentType

func (s *GetPageCoverImageOKHeaders) SetContentType(val string)

SetContentType sets the value of ContentType.

func (*GetPageCoverImageOKHeaders) SetResponse

func (s *GetPageCoverImageOKHeaders) SetResponse(val GetPageCoverImageOK)

SetResponse sets the value of Response.

type GetPageCoverImageParams

type GetPageCoverImageParams struct {
	// ID of book.
	MediaID int
	// Image format.
	Format string
}

GetPageCoverImageParams is parameters of getPageCoverImage operation.

type GetPageCoverImageRes

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

type GetPageImageForbidden

type GetPageImageForbidden struct{}

GetPageImageForbidden is response for GetPageImage operation.

type GetPageImageOK

type GetPageImageOK struct {
	Data io.Reader
}

func (GetPageImageOK) Read

func (s GetPageImageOK) Read(p []byte) (n int, err error)

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

type GetPageImageOKHeaders

type GetPageImageOKHeaders struct {
	ContentType string
	Response    GetPageImageOK
}

GetPageImageOKHeaders wraps GetPageImageOK with response headers.

func (*GetPageImageOKHeaders) GetContentType

func (s *GetPageImageOKHeaders) GetContentType() string

GetContentType returns the value of ContentType.

func (*GetPageImageOKHeaders) GetResponse

func (s *GetPageImageOKHeaders) GetResponse() GetPageImageOK

GetResponse returns the value of Response.

func (*GetPageImageOKHeaders) SetContentType

func (s *GetPageImageOKHeaders) SetContentType(val string)

SetContentType sets the value of ContentType.

func (*GetPageImageOKHeaders) SetResponse

func (s *GetPageImageOKHeaders) SetResponse(val GetPageImageOK)

SetResponse sets the value of Response.

type GetPageImageParams

type GetPageImageParams struct {
	// ID of book.
	MediaID int
	// Number of page.
	Page int
	// Image format.
	Format string
}

GetPageImageParams is parameters of getPageImage operation.

type GetPageImageRes

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

type GetPageThumbnailImageForbidden

type GetPageThumbnailImageForbidden struct{}

GetPageThumbnailImageForbidden is response for GetPageThumbnailImage operation.

type GetPageThumbnailImageOK

type GetPageThumbnailImageOK struct {
	Data io.Reader
}

func (GetPageThumbnailImageOK) Read

func (s GetPageThumbnailImageOK) Read(p []byte) (n int, err error)

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

type GetPageThumbnailImageOKHeaders

type GetPageThumbnailImageOKHeaders struct {
	ContentType string
	Response    GetPageThumbnailImageOK
}

GetPageThumbnailImageOKHeaders wraps GetPageThumbnailImageOK with response headers.

func (*GetPageThumbnailImageOKHeaders) GetContentType

func (s *GetPageThumbnailImageOKHeaders) GetContentType() string

GetContentType returns the value of ContentType.

func (*GetPageThumbnailImageOKHeaders) GetResponse

GetResponse returns the value of Response.

func (*GetPageThumbnailImageOKHeaders) SetContentType

func (s *GetPageThumbnailImageOKHeaders) SetContentType(val string)

SetContentType sets the value of ContentType.

func (*GetPageThumbnailImageOKHeaders) SetResponse

SetResponse sets the value of Response.

type GetPageThumbnailImageParams

type GetPageThumbnailImageParams struct {
	// ID of book.
	MediaID int
	// Number of page.
	Page int
	// Image format.
	Format string
}

GetPageThumbnailImageParams is parameters of getPageThumbnailImage operation.

type GetPageThumbnailImageRes

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

type Handler

type Handler interface {
	// GetBook implements getBook operation.
	//
	// Gets metadata of book.
	//
	// GET /api/gallery/{book_id}
	GetBook(ctx context.Context, params GetBookParams) (GetBookRes, error)
	// GetPageCoverImage implements getPageCoverImage operation.
	//
	// Gets page cover.
	//
	// GET /galleries/{media_id}/cover.{format}
	GetPageCoverImage(ctx context.Context, params GetPageCoverImageParams) (GetPageCoverImageRes, error)
	// GetPageImage implements getPageImage operation.
	//
	// Gets page.
	//
	// GET /galleries/{media_id}/{page}.{format}
	GetPageImage(ctx context.Context, params GetPageImageParams) (GetPageImageRes, error)
	// GetPageThumbnailImage implements getPageThumbnailImage operation.
	//
	// Gets page thumbnail.
	//
	// GET /galleries/{media_id}/{page}t.{format}
	GetPageThumbnailImage(ctx context.Context, params GetPageThumbnailImageParams) (GetPageThumbnailImageRes, error)
	// Search implements search operation.
	//
	// Search for comics.
	//
	// GET /api/galleries/search
	Search(ctx context.Context, params SearchParams) (SearchRes, error)
	// SearchByTagID implements searchByTagID operation.
	//
	// Search for comics by tag ID.
	//
	// GET /api/galleries/tagged
	SearchByTagID(ctx context.Context, params SearchByTagIDParams) (SearchByTagIDRes, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Image

type Image struct {
	T OptString `json:"t"`
	// Width of image.
	W OptInt `json:"w"`
	// Height of image.
	H OptInt `json:"h"`
}

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

func (s *Image) GetH() OptInt

GetH returns the value of H.

func (*Image) GetT

func (s *Image) GetT() OptString

GetT returns the value of T.

func (*Image) GetW

func (s *Image) GetW() OptInt

GetW returns the value of W.

func (*Image) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Image) SetFake

func (s *Image) SetFake()

SetFake set fake values.

func (*Image) SetH

func (s *Image) SetH(val OptInt)

SetH sets the value of H.

func (*Image) SetT

func (s *Image) SetT(val OptString)

SetT sets the value of T.

func (*Image) SetW

func (s *Image) SetW(val OptInt)

SetW sets the value of W.

func (*Image) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Image) Validate

func (s *Image) Validate() error

type Images

type Images struct {
	Pages     []Image  `json:"pages"`
	Cover     OptImage `json:"cover"`
	Thumbnail OptImage `json:"thumbnail"`
}

Ref: #/components/schemas/Images

func (*Images) Decode

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

Decode decodes Images from json.

func (*Images) Encode

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

Encode implements json.Marshaler.

func (*Images) GetCover

func (s *Images) GetCover() OptImage

GetCover returns the value of Cover.

func (*Images) GetPages

func (s *Images) GetPages() []Image

GetPages returns the value of Pages.

func (*Images) GetThumbnail

func (s *Images) GetThumbnail() OptImage

GetThumbnail returns the value of Thumbnail.

func (*Images) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Images) SetCover

func (s *Images) SetCover(val OptImage)

SetCover sets the value of Cover.

func (*Images) SetFake

func (s *Images) SetFake()

SetFake set fake values.

func (*Images) SetPages

func (s *Images) SetPages(val []Image)

SetPages sets the value of Pages.

func (*Images) SetThumbnail

func (s *Images) SetThumbnail(val OptImage)

SetThumbnail sets the value of Thumbnail.

func (*Images) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Images) Validate

func (s *Images) Validate() error

type Invoker

type Invoker interface {
	// GetBook invokes getBook operation.
	//
	// Gets metadata of book.
	//
	// GET /api/gallery/{book_id}
	GetBook(ctx context.Context, params GetBookParams) (GetBookRes, error)
	// GetPageCoverImage invokes getPageCoverImage operation.
	//
	// Gets page cover.
	//
	// GET /galleries/{media_id}/cover.{format}
	GetPageCoverImage(ctx context.Context, params GetPageCoverImageParams) (GetPageCoverImageRes, error)
	// GetPageImage invokes getPageImage operation.
	//
	// Gets page.
	//
	// GET /galleries/{media_id}/{page}.{format}
	GetPageImage(ctx context.Context, params GetPageImageParams) (GetPageImageRes, error)
	// GetPageThumbnailImage invokes getPageThumbnailImage operation.
	//
	// Gets page thumbnail.
	//
	// GET /galleries/{media_id}/{page}t.{format}
	GetPageThumbnailImage(ctx context.Context, params GetPageThumbnailImageParams) (GetPageThumbnailImageRes, error)
	// Search invokes search operation.
	//
	// Search for comics.
	//
	// GET /api/galleries/search
	Search(ctx context.Context, params SearchParams) (SearchRes, error)
	// SearchByTagID invokes searchByTagID operation.
	//
	// Search for comics by tag ID.
	//
	// GET /api/galleries/tagged
	SearchByTagID(ctx context.Context, params SearchByTagIDParams) (SearchByTagIDRes, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OptImage

type OptImage struct {
	Value Image
	Set   bool
}

OptImage is optional Image.

func NewOptImage

func NewOptImage(v Image) OptImage

NewOptImage returns new OptImage with value set to v.

func (*OptImage) Decode

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

Decode decodes Image from json.

func (OptImage) Encode

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

Encode encodes Image as json.

func (OptImage) Get

func (o OptImage) Get() (v Image, ok bool)

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

func (OptImage) IsSet

func (o OptImage) IsSet() bool

IsSet returns true if OptImage was set.

func (OptImage) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptImage) Or

func (o OptImage) Or(d Image) Image

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

func (*OptImage) Reset

func (o *OptImage) Reset()

Reset unsets value.

func (*OptImage) SetFake

func (s *OptImage) SetFake()

SetFake set fake values.

func (*OptImage) SetTo

func (o *OptImage) SetTo(v Image)

SetTo sets value to v.

func (*OptImage) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptImages

type OptImages struct {
	Value Images
	Set   bool
}

OptImages is optional Images.

func NewOptImages

func NewOptImages(v Images) OptImages

NewOptImages returns new OptImages with value set to v.

func (*OptImages) Decode

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

Decode decodes Images from json.

func (OptImages) Encode

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

Encode encodes Images as json.

func (OptImages) Get

func (o OptImages) Get() (v Images, ok bool)

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

func (OptImages) IsSet

func (o OptImages) IsSet() bool

IsSet returns true if OptImages was set.

func (OptImages) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptImages) Or

func (o OptImages) Or(d Images) Images

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

func (*OptImages) Reset

func (o *OptImages) Reset()

Reset unsets value.

func (*OptImages) SetFake

func (s *OptImages) SetFake()

SetFake set fake values.

func (*OptImages) SetTo

func (o *OptImages) SetTo(v Images)

SetTo sets value to v.

func (*OptImages) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

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

func (s *OptInt) SetFake()

SetFake set fake values.

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

func (s *OptString) SetFake()

SetFake set fake values.

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 OptTagType

type OptTagType struct {
	Value TagType
	Set   bool
}

OptTagType is optional TagType.

func NewOptTagType

func NewOptTagType(v TagType) OptTagType

NewOptTagType returns new OptTagType with value set to v.

func (*OptTagType) Decode

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

Decode decodes TagType from json.

func (OptTagType) Encode

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

Encode encodes TagType as json.

func (OptTagType) Get

func (o OptTagType) Get() (v TagType, ok bool)

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

func (OptTagType) IsSet

func (o OptTagType) IsSet() bool

IsSet returns true if OptTagType was set.

func (OptTagType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptTagType) Or

func (o OptTagType) Or(d TagType) TagType

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

func (*OptTagType) Reset

func (o *OptTagType) Reset()

Reset unsets value.

func (*OptTagType) SetFake

func (s *OptTagType) SetFake()

SetFake set fake values.

func (*OptTagType) SetTo

func (o *OptTagType) SetTo(v TagType)

SetTo sets value to v.

func (*OptTagType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptTitle

type OptTitle struct {
	Value Title
	Set   bool
}

OptTitle is optional Title.

func NewOptTitle

func NewOptTitle(v Title) OptTitle

NewOptTitle returns new OptTitle with value set to v.

func (*OptTitle) Decode

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

Decode decodes Title from json.

func (OptTitle) Encode

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

Encode encodes Title as json.

func (OptTitle) Get

func (o OptTitle) Get() (v Title, ok bool)

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

func (OptTitle) IsSet

func (o OptTitle) IsSet() bool

IsSet returns true if OptTitle was set.

func (OptTitle) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptTitle) Or

func (o OptTitle) Or(d Title) Title

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

func (*OptTitle) Reset

func (o *OptTitle) Reset()

Reset unsets value.

func (*OptTitle) SetFake

func (s *OptTitle) SetFake()

SetFake set fake values.

func (*OptTitle) SetTo

func (o *OptTitle) SetTo(v Title)

SetTo sets value to v.

func (*OptTitle) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the otel.GetMeterProvider() is used.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer.

If none is specified, the global provider is used.

type 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) 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 SearchByTagIDForbidden

type SearchByTagIDForbidden struct{}

SearchByTagIDForbidden is response for SearchByTagID operation.

type SearchByTagIDOKApplicationJSON

type SearchByTagIDOKApplicationJSON []SearchResponse

func (*SearchByTagIDOKApplicationJSON) Decode

Decode decodes SearchByTagIDOKApplicationJSON from json.

func (SearchByTagIDOKApplicationJSON) Encode

Encode encodes SearchByTagIDOKApplicationJSON as json.

func (SearchByTagIDOKApplicationJSON) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*SearchByTagIDOKApplicationJSON) SetFake

func (s *SearchByTagIDOKApplicationJSON) SetFake()

SetFake set fake values.

func (*SearchByTagIDOKApplicationJSON) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (SearchByTagIDOKApplicationJSON) Validate

type SearchByTagIDParams

type SearchByTagIDParams struct {
	// Tag ID.
	TagID int
	// Number of result page.
	Page OptInt
}

SearchByTagIDParams is parameters of searchByTagID operation.

type SearchByTagIDRes

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

type SearchForbidden

type SearchForbidden struct{}

SearchForbidden is response for Search operation.

type SearchOKApplicationJSON

type SearchOKApplicationJSON []SearchResponse

func (*SearchOKApplicationJSON) Decode

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

Decode decodes SearchOKApplicationJSON from json.

func (SearchOKApplicationJSON) Encode

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

Encode encodes SearchOKApplicationJSON as json.

func (SearchOKApplicationJSON) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*SearchOKApplicationJSON) SetFake

func (s *SearchOKApplicationJSON) SetFake()

SetFake set fake values.

func (*SearchOKApplicationJSON) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (SearchOKApplicationJSON) Validate

func (s SearchOKApplicationJSON) Validate() error

type SearchParams

type SearchParams struct {
	// Search query.
	// * You can search for multiple terms at the same time, and this will return only galleries that
	// contain both terms. For example, rust cox finds all galleries that contain both rust and cox.
	// * You can exclude terms by prefixing them with -. For example, rust cox -tokio matches all
	// galleries matching rust and cox but not tokio.
	// * Exact searches can be performed by wrapping terms in double quotes. For example, "big dogs" only
	// matches galleries with "big dogs" somewhere in the title or in tags.
	// * These can be combined with tag namespaces for finer control over the query: parodies:railgun
	// -tag:"big dogs".
	Query string
	// Number of result page.
	Page OptInt
}

SearchParams is parameters of search operation.

type SearchRes

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

type SearchResponse

type SearchResponse struct {
	Result []Book `json:"result"`
	// Total number of pages.
	NumPages OptInt `json:"num_pages"`
	// Elements on one page.
	PerPage OptInt `json:"per_page"`
}

Ref: #/components/schemas/SearchResponse

func (*SearchResponse) Decode

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

Decode decodes SearchResponse from json.

func (*SearchResponse) Encode

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

Encode implements json.Marshaler.

func (*SearchResponse) GetNumPages

func (s *SearchResponse) GetNumPages() OptInt

GetNumPages returns the value of NumPages.

func (*SearchResponse) GetPerPage

func (s *SearchResponse) GetPerPage() OptInt

GetPerPage returns the value of PerPage.

func (*SearchResponse) GetResult

func (s *SearchResponse) GetResult() []Book

GetResult returns the value of Result.

func (*SearchResponse) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*SearchResponse) SetFake

func (s *SearchResponse) SetFake()

SetFake set fake values.

func (*SearchResponse) SetNumPages

func (s *SearchResponse) SetNumPages(val OptInt)

SetNumPages sets the value of NumPages.

func (*SearchResponse) SetPerPage

func (s *SearchResponse) SetPerPage(val OptInt)

SetPerPage sets the value of PerPage.

func (*SearchResponse) SetResult

func (s *SearchResponse) SetResult(val []Book)

SetResult sets the value of Result.

func (*SearchResponse) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SearchResponse) Validate

func (s *SearchResponse) Validate() error

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 (*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 Tag

type Tag struct {
	ID    OptInt     `json:"id"`
	Type  OptTagType `json:"type"`
	Name  OptString  `json:"name"`
	URL   OptString  `json:"url"`
	Count OptInt     `json:"count"`
}

Ref: #/components/schemas/Tag

func (*Tag) Decode

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

Decode decodes Tag from json.

func (*Tag) Encode

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

Encode implements json.Marshaler.

func (*Tag) GetCount

func (s *Tag) GetCount() OptInt

GetCount returns the value of Count.

func (*Tag) GetID

func (s *Tag) GetID() OptInt

GetID returns the value of ID.

func (*Tag) GetName

func (s *Tag) GetName() OptString

GetName returns the value of Name.

func (*Tag) GetType

func (s *Tag) GetType() OptTagType

GetType returns the value of Type.

func (*Tag) GetURL

func (s *Tag) GetURL() OptString

GetURL returns the value of URL.

func (*Tag) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Tag) SetCount

func (s *Tag) SetCount(val OptInt)

SetCount sets the value of Count.

func (*Tag) SetFake

func (s *Tag) SetFake()

SetFake set fake values.

func (*Tag) SetID

func (s *Tag) SetID(val OptInt)

SetID sets the value of ID.

func (*Tag) SetName

func (s *Tag) SetName(val OptString)

SetName sets the value of Name.

func (*Tag) SetType

func (s *Tag) SetType(val OptTagType)

SetType sets the value of Type.

func (*Tag) SetURL

func (s *Tag) SetURL(val OptString)

SetURL sets the value of URL.

func (*Tag) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Tag) Validate

func (s *Tag) Validate() error

type TagType

type TagType string
const (
	TagTypeParody    TagType = "parody"
	TagTypeCharacter TagType = "character"
	TagTypeTag       TagType = "tag"
	TagTypeArtist    TagType = "artist"
	TagTypeGroup     TagType = "group"
	TagTypeCategory  TagType = "category"
	TagTypeLanguage  TagType = "language"
)

func (TagType) AllValues

func (TagType) AllValues() []TagType

AllValues returns all TagType values.

func (*TagType) Decode

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

Decode decodes TagType from json.

func (TagType) Encode

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

Encode encodes TagType as json.

func (TagType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (TagType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*TagType) SetFake

func (s *TagType) SetFake()

SetFake set fake values.

func (*TagType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TagType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (TagType) Validate

func (s TagType) Validate() error

type Title

type Title struct {
	English  OptString `json:"english"`
	Japanese OptString `json:"japanese"`
	Pretty   OptString `json:"pretty"`
}

Ref: #/components/schemas/Title

func (*Title) Decode

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

Decode decodes Title from json.

func (*Title) Encode

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

Encode implements json.Marshaler.

func (*Title) GetEnglish

func (s *Title) GetEnglish() OptString

GetEnglish returns the value of English.

func (*Title) GetJapanese

func (s *Title) GetJapanese() OptString

GetJapanese returns the value of Japanese.

func (*Title) GetPretty

func (s *Title) GetPretty() OptString

GetPretty returns the value of Pretty.

func (*Title) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Title) SetEnglish

func (s *Title) SetEnglish(val OptString)

SetEnglish sets the value of English.

func (*Title) SetFake

func (s *Title) SetFake()

SetFake set fake values.

func (*Title) SetJapanese

func (s *Title) SetJapanese(val OptString)

SetJapanese sets the value of Japanese.

func (*Title) SetPretty

func (s *Title) SetPretty(val OptString)

SetPretty sets the value of Pretty.

func (*Title) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UnimplementedHandler

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) GetBook

func (UnimplementedHandler) GetBook(ctx context.Context, params GetBookParams) (r GetBookRes, _ error)

GetBook implements getBook operation.

Gets metadata of book.

GET /api/gallery/{book_id}

func (UnimplementedHandler) GetPageCoverImage

GetPageCoverImage implements getPageCoverImage operation.

Gets page cover.

GET /galleries/{media_id}/cover.{format}

func (UnimplementedHandler) GetPageImage

GetPageImage implements getPageImage operation.

Gets page.

GET /galleries/{media_id}/{page}.{format}

func (UnimplementedHandler) GetPageThumbnailImage

GetPageThumbnailImage implements getPageThumbnailImage operation.

Gets page thumbnail.

GET /galleries/{media_id}/{page}t.{format}

func (UnimplementedHandler) Search

func (UnimplementedHandler) Search(ctx context.Context, params SearchParams) (r SearchRes, _ error)

Search implements search operation.

Search for comics.

GET /api/galleries/search

func (UnimplementedHandler) SearchByTagID

SearchByTagID implements searchByTagID operation.

Search for comics by tag ID.

GET /api/galleries/tagged

Jump to

Keyboard shortcuts

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