Documentation ¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type AddPageBadRequest
- func (s *AddPageBadRequest) Decode(d *jx.Decoder) error
- func (s *AddPageBadRequest) Encode(e *jx.Encoder)
- func (s *AddPageBadRequest) GetError() string
- func (s *AddPageBadRequest) GetField() string
- func (s *AddPageBadRequest) MarshalJSON() ([]byte, error)
- func (s *AddPageBadRequest) SetError(val string)
- func (s *AddPageBadRequest) SetField(val string)
- func (s *AddPageBadRequest) UnmarshalJSON(data []byte) error
- type AddPageParams
- type AddPageReq
- func (s *AddPageReq) Decode(d *jx.Decoder) error
- func (s *AddPageReq) Encode(e *jx.Encoder)
- func (s *AddPageReq) GetDescription() OptString
- func (s *AddPageReq) GetFormats() []Format
- func (s *AddPageReq) GetURL() string
- func (s *AddPageReq) MarshalJSON() ([]byte, error)
- func (s *AddPageReq) SetDescription(val OptString)
- func (s *AddPageReq) SetFormats(val []Format)
- func (s *AddPageReq) SetURL(val string)
- func (s *AddPageReq) UnmarshalJSON(data []byte) error
- func (s *AddPageReq) Validate() error
- type AddPageRes
- type Client
- func (c *Client) AddPage(ctx context.Context, request OptAddPageReq, params AddPageParams) (AddPageRes, error)
- func (c *Client) GetFile(ctx context.Context, params GetFileParams) (GetFileRes, error)
- func (c *Client) GetPage(ctx context.Context, params GetPageParams) (GetPageRes, error)
- func (c *Client) GetPages(ctx context.Context) (Pages, error)
- type ClientOption
- type Error
- func (s *Error) Decode(d *jx.Decoder) error
- func (s *Error) Encode(e *jx.Encoder)
- func (s *Error) GetLocalized() OptString
- func (s *Error) GetMessage() string
- func (s *Error) MarshalJSON() ([]byte, error)
- func (s *Error) SetLocalized(val OptString)
- func (s *Error) SetMessage(val string)
- func (s *Error) UnmarshalJSON(data []byte) error
- type ErrorHandler
- type ErrorStatusCode
- type Format
- func (s *Format) Decode(d *jx.Decoder) error
- func (s Format) Encode(e *jx.Encoder)
- func (s Format) MarshalJSON() ([]byte, error)
- func (s Format) MarshalText() ([]byte, error)
- func (s *Format) UnmarshalJSON(data []byte) error
- func (s *Format) UnmarshalText(data []byte) error
- func (s Format) Validate() error
- type GetFileNotFound
- type GetFileOKApplicationPdf
- type GetFileOKTextHTML
- type GetFileOKTextPlain
- type GetFileParams
- type GetFileRes
- type GetPageNotFound
- type GetPageParams
- type GetPageRes
- type Handler
- type Middleware
- type OptAddPageReq
- func (o *OptAddPageReq) Decode(d *jx.Decoder) error
- func (o OptAddPageReq) Encode(e *jx.Encoder)
- func (o OptAddPageReq) Get() (v AddPageReq, ok bool)
- func (o OptAddPageReq) IsSet() bool
- func (s OptAddPageReq) MarshalJSON() ([]byte, error)
- func (o OptAddPageReq) Or(d AddPageReq) AddPageReq
- func (o *OptAddPageReq) Reset()
- func (o *OptAddPageReq) SetTo(v AddPageReq)
- func (s *OptAddPageReq) UnmarshalJSON(data []byte) error
- type OptString
- func (o *OptString) Decode(d *jx.Decoder) error
- func (o OptString) Encode(e *jx.Encoder)
- func (o OptString) Get() (v string, ok bool)
- func (o OptString) IsSet() bool
- func (s OptString) MarshalJSON() ([]byte, error)
- func (o OptString) Or(d string) string
- func (o *OptString) Reset()
- func (o *OptString) SetTo(v string)
- func (s *OptString) UnmarshalJSON(data []byte) error
- type Option
- type Page
- func (s *Page) Decode(d *jx.Decoder) error
- func (s *Page) Encode(e *jx.Encoder)
- func (s *Page) GetCreated() time.Time
- func (s *Page) GetFormats() []Format
- func (s *Page) GetID() uuid.UUID
- func (s *Page) GetMeta() PageMeta
- func (s *Page) GetStatus() Status
- func (s *Page) GetURL() string
- func (s *Page) MarshalJSON() ([]byte, error)
- func (s *Page) SetCreated(val time.Time)
- func (s *Page) SetFormats(val []Format)
- func (s *Page) SetID(val uuid.UUID)
- func (s *Page) SetMeta(val PageMeta)
- func (s *Page) SetStatus(val Status)
- func (s *Page) SetURL(val string)
- func (s *Page) UnmarshalJSON(data []byte) error
- func (s *Page) Validate() error
- type PageMeta
- func (s *PageMeta) Decode(d *jx.Decoder) error
- func (s *PageMeta) Encode(e *jx.Encoder)
- func (s *PageMeta) GetDescription() string
- func (s *PageMeta) GetError() OptString
- func (s *PageMeta) GetTitle() string
- func (s *PageMeta) MarshalJSON() ([]byte, error)
- func (s *PageMeta) SetDescription(val string)
- func (s *PageMeta) SetError(val OptString)
- func (s *PageMeta) SetTitle(val string)
- func (s *PageMeta) UnmarshalJSON(data []byte) error
- type PageWithResults
- func (s *PageWithResults) Decode(d *jx.Decoder) error
- func (s *PageWithResults) Encode(e *jx.Encoder)
- func (s *PageWithResults) GetCreated() time.Time
- func (s *PageWithResults) GetFormats() []Format
- func (s *PageWithResults) GetID() uuid.UUID
- func (s *PageWithResults) GetMeta() PageWithResultsMeta
- func (s *PageWithResults) GetResults() []Result
- func (s *PageWithResults) GetStatus() Status
- func (s *PageWithResults) GetURL() string
- func (s *PageWithResults) MarshalJSON() ([]byte, error)
- func (s *PageWithResults) SetCreated(val time.Time)
- func (s *PageWithResults) SetFormats(val []Format)
- func (s *PageWithResults) SetID(val uuid.UUID)
- func (s *PageWithResults) SetMeta(val PageWithResultsMeta)
- func (s *PageWithResults) SetResults(val []Result)
- func (s *PageWithResults) SetStatus(val Status)
- func (s *PageWithResults) SetURL(val string)
- func (s *PageWithResults) UnmarshalJSON(data []byte) error
- func (s *PageWithResults) Validate() error
- type PageWithResultsMeta
- func (s *PageWithResultsMeta) Decode(d *jx.Decoder) error
- func (s *PageWithResultsMeta) Encode(e *jx.Encoder)
- func (s *PageWithResultsMeta) GetDescription() string
- func (s *PageWithResultsMeta) GetError() OptString
- func (s *PageWithResultsMeta) GetTitle() string
- func (s *PageWithResultsMeta) MarshalJSON() ([]byte, error)
- func (s *PageWithResultsMeta) SetDescription(val string)
- func (s *PageWithResultsMeta) SetError(val OptString)
- func (s *PageWithResultsMeta) SetTitle(val string)
- func (s *PageWithResultsMeta) UnmarshalJSON(data []byte) error
- type Pages
- type Result
- func (s *Result) Decode(d *jx.Decoder) error
- func (s *Result) Encode(e *jx.Encoder)
- func (s *Result) GetError() OptString
- func (s *Result) GetFiles() []ResultFilesItem
- func (s *Result) GetFormat() Format
- func (s *Result) MarshalJSON() ([]byte, error)
- func (s *Result) SetError(val OptString)
- func (s *Result) SetFiles(val []ResultFilesItem)
- func (s *Result) SetFormat(val Format)
- func (s *Result) UnmarshalJSON(data []byte) error
- func (s *Result) Validate() error
- type ResultFilesItem
- func (s *ResultFilesItem) Decode(d *jx.Decoder) error
- func (s *ResultFilesItem) Encode(e *jx.Encoder)
- func (s *ResultFilesItem) GetID() uuid.UUID
- func (s *ResultFilesItem) GetMimetype() string
- func (s *ResultFilesItem) GetName() string
- func (s *ResultFilesItem) GetSize() int64
- func (s *ResultFilesItem) MarshalJSON() ([]byte, error)
- func (s *ResultFilesItem) SetID(val uuid.UUID)
- func (s *ResultFilesItem) SetMimetype(val string)
- func (s *ResultFilesItem) SetName(val string)
- func (s *ResultFilesItem) SetSize(val int64)
- func (s *ResultFilesItem) UnmarshalJSON(data []byte) error
- type Route
- type Server
- type ServerOption
- func WithErrorHandler(h ErrorHandler) ServerOption
- func WithMaxMultipartMemory(max int64) ServerOption
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
- func WithMiddleware(m ...Middleware) ServerOption
- func WithNotFound(notFound http.HandlerFunc) ServerOption
- func WithPathPrefix(prefix string) ServerOption
- type Status
- func (s *Status) Decode(d *jx.Decoder) error
- func (s Status) Encode(e *jx.Encoder)
- func (s Status) MarshalJSON() ([]byte, error)
- func (s Status) MarshalText() ([]byte, error)
- func (s *Status) UnmarshalJSON(data []byte) error
- func (s *Status) UnmarshalText(data []byte) error
- func (s Status) Validate() error
- type UnimplementedHandler
- func (UnimplementedHandler) AddPage(ctx context.Context, req OptAddPageReq, params AddPageParams) (r AddPageRes, _ error)
- func (UnimplementedHandler) GetFile(ctx context.Context, params GetFileParams) (r GetFileRes, _ error)
- func (UnimplementedHandler) GetPage(ctx context.Context, params GetPageParams) (r GetPageRes, _ error)
- func (UnimplementedHandler) GetPages(ctx context.Context) (r Pages, _ error)
- func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddPageBadRequest ¶
func (*AddPageBadRequest) Decode ¶
func (s *AddPageBadRequest) Decode(d *jx.Decoder) error
Decode decodes AddPageBadRequest from json.
func (*AddPageBadRequest) Encode ¶
func (s *AddPageBadRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*AddPageBadRequest) GetError ¶
func (s *AddPageBadRequest) GetError() string
GetError returns the value of Error.
func (*AddPageBadRequest) GetField ¶
func (s *AddPageBadRequest) GetField() string
GetField returns the value of Field.
func (*AddPageBadRequest) MarshalJSON ¶
func (s *AddPageBadRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*AddPageBadRequest) SetError ¶
func (s *AddPageBadRequest) SetError(val string)
SetError sets the value of Error.
func (*AddPageBadRequest) SetField ¶
func (s *AddPageBadRequest) SetField(val string)
SetField sets the value of Field.
func (*AddPageBadRequest) UnmarshalJSON ¶
func (s *AddPageBadRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type AddPageParams ¶
AddPageParams is parameters of addPage operation.
type AddPageReq ¶
type AddPageReq struct { URL string `json:"url"` Description OptString `json:"description"` Formats []Format `json:"formats"` }
func (*AddPageReq) Decode ¶
func (s *AddPageReq) Decode(d *jx.Decoder) error
Decode decodes AddPageReq from json.
func (*AddPageReq) Encode ¶
func (s *AddPageReq) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*AddPageReq) GetDescription ¶
func (s *AddPageReq) GetDescription() OptString
GetDescription returns the value of Description.
func (*AddPageReq) GetFormats ¶
func (s *AddPageReq) GetFormats() []Format
GetFormats returns the value of Formats.
func (*AddPageReq) MarshalJSON ¶
func (s *AddPageReq) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*AddPageReq) SetDescription ¶
func (s *AddPageReq) SetDescription(val OptString)
SetDescription sets the value of Description.
func (*AddPageReq) SetFormats ¶
func (s *AddPageReq) SetFormats(val []Format)
SetFormats sets the value of Formats.
func (*AddPageReq) UnmarshalJSON ¶
func (s *AddPageReq) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*AddPageReq) Validate ¶
func (s *AddPageReq) Validate() error
type AddPageRes ¶
type AddPageRes interface {
// contains filtered or unexported methods
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements OAS client.
func NewClient ¶
func NewClient(serverURL string, opts ...ClientOption) (*Client, error)
NewClient initializes new Client defined by OAS.
func (*Client) AddPage ¶
func (c *Client) AddPage(ctx context.Context, request OptAddPageReq, params AddPageParams) (AddPageRes, error)
AddPage invokes addPage operation.
Add new page.
POST /pages
func (*Client) GetFile ¶
func (c *Client) GetFile(ctx context.Context, params GetFileParams) (GetFileRes, error)
GetFile invokes getFile operation.
Get file content.
GET /pages/{id}/file/{file_id}
func (*Client) GetPage ¶
func (c *Client) GetPage(ctx context.Context, params GetPageParams) (GetPageRes, error)
GetPage invokes getPage operation.
Get page details.
GET /pages/{id}
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption is client config option.
func WithClient ¶
func WithClient(client ht.Client) ClientOption
WithClient specifies http client to use.
type Error ¶
Ref: #/components/schemas/error
func (*Error) GetLocalized ¶
GetLocalized returns the value of Localized.
func (*Error) GetMessage ¶
GetMessage returns the value of Message.
func (*Error) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Error) SetLocalized ¶
SetLocalized sets the value of Localized.
func (*Error) SetMessage ¶
SetMessage sets the value of Message.
func (*Error) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type ErrorStatusCode ¶
ErrorStatusCode wraps Error with StatusCode.
func (*ErrorStatusCode) Error ¶
func (s *ErrorStatusCode) Error() string
func (*ErrorStatusCode) GetResponse ¶
func (s *ErrorStatusCode) GetResponse() Error
GetResponse returns the value of Response.
func (*ErrorStatusCode) GetStatusCode ¶
func (s *ErrorStatusCode) GetStatusCode() int
GetStatusCode returns the value of StatusCode.
func (*ErrorStatusCode) SetResponse ¶
func (s *ErrorStatusCode) SetResponse(val Error)
SetResponse sets the value of Response.
func (*ErrorStatusCode) SetStatusCode ¶
func (s *ErrorStatusCode) SetStatusCode(val int)
SetStatusCode sets the value of StatusCode.
type Format ¶
type Format string
Ref: #/components/schemas/format
func (Format) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (Format) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Format) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
func (*Format) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type GetFileNotFound ¶
type GetFileNotFound struct{}
GetFileNotFound is response for GetFile operation.
type GetFileOKApplicationPdf ¶
type GetFileOKTextHTML ¶
type GetFileOKTextPlain ¶
type GetFileParams ¶
GetFileParams is parameters of getFile operation.
type GetFileRes ¶
type GetFileRes interface {
// contains filtered or unexported methods
}
type GetPageNotFound ¶
type GetPageNotFound struct{}
GetPageNotFound is response for GetPage operation.
type GetPageParams ¶
GetPageParams is parameters of getPage operation.
type GetPageRes ¶
type GetPageRes interface {
// contains filtered or unexported methods
}
type Handler ¶
type Handler interface { // AddPage implements addPage operation. // // Add new page. // // POST /pages AddPage(ctx context.Context, req OptAddPageReq, params AddPageParams) (AddPageRes, error) // GetFile implements getFile operation. // // Get file content. // // GET /pages/{id}/file/{file_id} GetFile(ctx context.Context, params GetFileParams) (GetFileRes, error) // GetPage implements getPage operation. // // Get page details. // // GET /pages/{id} GetPage(ctx context.Context, params GetPageParams) (GetPageRes, error) // GetPages implements getPages operation. // // Get all pages. // // GET /pages GetPages(ctx context.Context) (Pages, error) // NewError creates *ErrorStatusCode from error returned by handler. // // Used for common default response. NewError(ctx context.Context, err error) *ErrorStatusCode }
Handler handles operations described by OpenAPI v3 specification.
type OptAddPageReq ¶
type OptAddPageReq struct { Value AddPageReq Set bool }
OptAddPageReq is optional AddPageReq.
func NewOptAddPageReq ¶
func NewOptAddPageReq(v AddPageReq) OptAddPageReq
NewOptAddPageReq returns new OptAddPageReq with value set to v.
func (*OptAddPageReq) Decode ¶
func (o *OptAddPageReq) Decode(d *jx.Decoder) error
Decode decodes AddPageReq from json.
func (OptAddPageReq) Encode ¶
func (o OptAddPageReq) Encode(e *jx.Encoder)
Encode encodes AddPageReq as json.
func (OptAddPageReq) Get ¶
func (o OptAddPageReq) Get() (v AddPageReq, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptAddPageReq) IsSet ¶
func (o OptAddPageReq) IsSet() bool
IsSet returns true if OptAddPageReq was set.
func (OptAddPageReq) MarshalJSON ¶
func (s OptAddPageReq) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptAddPageReq) Or ¶
func (o OptAddPageReq) Or(d AddPageReq) AddPageReq
Or returns value if set, or given parameter if does not.
func (*OptAddPageReq) UnmarshalJSON ¶
func (s *OptAddPageReq) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptString ¶
OptString is optional string.
func NewOptString ¶
NewOptString returns new OptString with value set to v.
func (OptString) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptString) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type 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 metric.NewNoopMeterProvider 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 Page ¶
type Page struct { ID uuid.UUID `json:"id"` URL string `json:"url"` Created time.Time `json:"created"` Formats []Format `json:"formats"` Status Status `json:"status"` Meta PageMeta `json:"meta"` }
Ref: #/components/schemas/page
func (*Page) GetCreated ¶
GetCreated returns the value of Created.
func (*Page) GetFormats ¶
GetFormats returns the value of Formats.
func (*Page) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Page) SetCreated ¶
SetCreated sets the value of Created.
func (*Page) SetFormats ¶
SetFormats sets the value of Formats.
func (*Page) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type PageMeta ¶ added in v0.1.3
type PageMeta struct { Title string `json:"title"` Description string `json:"description"` Error OptString `json:"error"` }
func (*PageMeta) GetDescription ¶ added in v0.1.3
GetDescription returns the value of Description.
func (*PageMeta) MarshalJSON ¶ added in v0.1.3
MarshalJSON implements stdjson.Marshaler.
func (*PageMeta) SetDescription ¶ added in v0.1.3
SetDescription sets the value of Description.
func (*PageMeta) UnmarshalJSON ¶ added in v0.1.3
UnmarshalJSON implements stdjson.Unmarshaler.
type PageWithResults ¶
type PageWithResults struct { ID uuid.UUID `json:"id"` URL string `json:"url"` Created time.Time `json:"created"` Formats []Format `json:"formats"` Status Status `json:"status"` Meta PageWithResultsMeta `json:"meta"` Results []Result `json:"results"` }
Merged schema. Ref: #/components/schemas/pageWithResults
func (*PageWithResults) Decode ¶
func (s *PageWithResults) Decode(d *jx.Decoder) error
Decode decodes PageWithResults from json.
func (*PageWithResults) Encode ¶
func (s *PageWithResults) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*PageWithResults) GetCreated ¶
func (s *PageWithResults) GetCreated() time.Time
GetCreated returns the value of Created.
func (*PageWithResults) GetFormats ¶
func (s *PageWithResults) GetFormats() []Format
GetFormats returns the value of Formats.
func (*PageWithResults) GetID ¶
func (s *PageWithResults) GetID() uuid.UUID
GetID returns the value of ID.
func (*PageWithResults) GetMeta ¶ added in v0.1.3
func (s *PageWithResults) GetMeta() PageWithResultsMeta
GetMeta returns the value of Meta.
func (*PageWithResults) GetResults ¶
func (s *PageWithResults) GetResults() []Result
GetResults returns the value of Results.
func (*PageWithResults) GetStatus ¶
func (s *PageWithResults) GetStatus() Status
GetStatus returns the value of Status.
func (*PageWithResults) GetURL ¶
func (s *PageWithResults) GetURL() string
GetURL returns the value of URL.
func (*PageWithResults) MarshalJSON ¶
func (s *PageWithResults) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PageWithResults) SetCreated ¶
func (s *PageWithResults) SetCreated(val time.Time)
SetCreated sets the value of Created.
func (*PageWithResults) SetFormats ¶
func (s *PageWithResults) SetFormats(val []Format)
SetFormats sets the value of Formats.
func (*PageWithResults) SetID ¶
func (s *PageWithResults) SetID(val uuid.UUID)
SetID sets the value of ID.
func (*PageWithResults) SetMeta ¶ added in v0.1.3
func (s *PageWithResults) SetMeta(val PageWithResultsMeta)
SetMeta sets the value of Meta.
func (*PageWithResults) SetResults ¶
func (s *PageWithResults) SetResults(val []Result)
SetResults sets the value of Results.
func (*PageWithResults) SetStatus ¶
func (s *PageWithResults) SetStatus(val Status)
SetStatus sets the value of Status.
func (*PageWithResults) SetURL ¶
func (s *PageWithResults) SetURL(val string)
SetURL sets the value of URL.
func (*PageWithResults) UnmarshalJSON ¶
func (s *PageWithResults) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*PageWithResults) Validate ¶
func (s *PageWithResults) Validate() error
type PageWithResultsMeta ¶ added in v0.1.3
type PageWithResultsMeta struct { Title string `json:"title"` Description string `json:"description"` Error OptString `json:"error"` }
func (*PageWithResultsMeta) Decode ¶ added in v0.1.3
func (s *PageWithResultsMeta) Decode(d *jx.Decoder) error
Decode decodes PageWithResultsMeta from json.
func (*PageWithResultsMeta) Encode ¶ added in v0.1.3
func (s *PageWithResultsMeta) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*PageWithResultsMeta) GetDescription ¶ added in v0.1.3
func (s *PageWithResultsMeta) GetDescription() string
GetDescription returns the value of Description.
func (*PageWithResultsMeta) GetError ¶ added in v0.1.3
func (s *PageWithResultsMeta) GetError() OptString
GetError returns the value of Error.
func (*PageWithResultsMeta) GetTitle ¶ added in v0.1.3
func (s *PageWithResultsMeta) GetTitle() string
GetTitle returns the value of Title.
func (*PageWithResultsMeta) MarshalJSON ¶ added in v0.1.3
func (s *PageWithResultsMeta) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*PageWithResultsMeta) SetDescription ¶ added in v0.1.3
func (s *PageWithResultsMeta) SetDescription(val string)
SetDescription sets the value of Description.
func (*PageWithResultsMeta) SetError ¶ added in v0.1.3
func (s *PageWithResultsMeta) SetError(val OptString)
SetError sets the value of Error.
func (*PageWithResultsMeta) SetTitle ¶ added in v0.1.3
func (s *PageWithResultsMeta) SetTitle(val string)
SetTitle sets the value of Title.
func (*PageWithResultsMeta) UnmarshalJSON ¶ added in v0.1.3
func (s *PageWithResultsMeta) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type Pages ¶
type Pages []Page
func (Pages) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Pages) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Result ¶
type Result struct { Format Format `json:"format"` Error OptString `json:"error"` Files []ResultFilesItem `json:"files"` }
Ref: #/components/schemas/result
func (*Result) GetFiles ¶
func (s *Result) GetFiles() []ResultFilesItem
GetFiles returns the value of Files.
func (*Result) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Result) SetFiles ¶
func (s *Result) SetFiles(val []ResultFilesItem)
SetFiles sets the value of Files.
func (*Result) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type ResultFilesItem ¶
type ResultFilesItem struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Mimetype string `json:"mimetype"` Size int64 `json:"size"` }
func (*ResultFilesItem) Decode ¶
func (s *ResultFilesItem) Decode(d *jx.Decoder) error
Decode decodes ResultFilesItem from json.
func (*ResultFilesItem) Encode ¶
func (s *ResultFilesItem) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ResultFilesItem) GetID ¶
func (s *ResultFilesItem) GetID() uuid.UUID
GetID returns the value of ID.
func (*ResultFilesItem) GetMimetype ¶
func (s *ResultFilesItem) GetMimetype() string
GetMimetype returns the value of Mimetype.
func (*ResultFilesItem) GetName ¶
func (s *ResultFilesItem) GetName() string
GetName returns the value of Name.
func (*ResultFilesItem) GetSize ¶
func (s *ResultFilesItem) GetSize() int64
GetSize returns the value of Size.
func (*ResultFilesItem) MarshalJSON ¶
func (s *ResultFilesItem) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ResultFilesItem) SetID ¶
func (s *ResultFilesItem) SetID(val uuid.UUID)
SetID sets the value of ID.
func (*ResultFilesItem) SetMimetype ¶
func (s *ResultFilesItem) SetMimetype(val string)
SetMimetype sets the value of Mimetype.
func (*ResultFilesItem) SetName ¶
func (s *ResultFilesItem) SetName(val string)
SetName sets the value of Name.
func (*ResultFilesItem) SetSize ¶
func (s *ResultFilesItem) SetSize(val int64)
SetSize sets the value of Size.
func (*ResultFilesItem) UnmarshalJSON ¶
func (s *ResultFilesItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.
func NewServer ¶
func NewServer(h Handler, opts ...ServerOption) (*Server, error)
NewServer creates new Server.
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
ServerOption is server config option.
func WithErrorHandler ¶
func WithErrorHandler(h ErrorHandler) ServerOption
WithErrorHandler specifies error handler to use.
func WithMaxMultipartMemory ¶
func WithMaxMultipartMemory(max int64) ServerOption
WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.
func WithMethodNotAllowed ¶
func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
WithMethodNotAllowed specifies Method Not Allowed handler to use.
func WithMiddleware ¶
func WithMiddleware(m ...Middleware) ServerOption
WithMiddleware specifies middlewares to use.
func WithNotFound ¶
func WithNotFound(notFound http.HandlerFunc) ServerOption
WithNotFound specifies Not Found handler to use.
func WithPathPrefix ¶
func WithPathPrefix(prefix string) ServerOption
WithPathPrefix specifies server path prefix.
type Status ¶
type Status string
Ref: #/components/schemas/status
func (Status) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (Status) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Status) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
func (*Status) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) AddPage ¶
func (UnimplementedHandler) AddPage(ctx context.Context, req OptAddPageReq, params AddPageParams) (r AddPageRes, _ error)
AddPage implements addPage operation.
Add new page.
POST /pages
func (UnimplementedHandler) GetFile ¶
func (UnimplementedHandler) GetFile(ctx context.Context, params GetFileParams) (r GetFileRes, _ error)
GetFile implements getFile operation.
Get file content.
GET /pages/{id}/file/{file_id}
func (UnimplementedHandler) GetPage ¶
func (UnimplementedHandler) GetPage(ctx context.Context, params GetPageParams) (r GetPageRes, _ error)
GetPage implements getPage operation.
Get page details.
GET /pages/{id}
func (UnimplementedHandler) GetPages ¶
func (UnimplementedHandler) GetPages(ctx context.Context) (r Pages, _ error)
GetPages implements getPages operation.
Get all pages.
GET /pages
func (UnimplementedHandler) NewError ¶
func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)
NewError creates *ErrorStatusCode from error returned by handler.
Used for common default response.
Source Files ¶
- oas_cfg_gen.go
- oas_client_gen.go
- oas_handlers_gen.go
- oas_interfaces_gen.go
- oas_json_gen.go
- oas_middleware_gen.go
- oas_parameters_gen.go
- oas_request_decoders_gen.go
- oas_request_encoders_gen.go
- oas_response_decoders_gen.go
- oas_response_encoders_gen.go
- oas_router_gen.go
- oas_schemas_gen.go
- oas_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go