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: 27 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 APICaptcha2chcaptchaIDGetParams

type APICaptcha2chcaptchaIDGetParams struct {
	// ID доски, например, b.
	Board OptString
	// Номер треда.
	Thread OptInt
}

APICaptcha2chcaptchaIDGetParams is parameters of GET /api/captcha/2chcaptcha/id operation.

type APICaptcha2chcaptchaShowGetNotFound

type APICaptcha2chcaptchaShowGetNotFound struct{}

APICaptcha2chcaptchaShowGetNotFound is response for APICaptcha2chcaptchaShowGet operation.

type APICaptcha2chcaptchaShowGetOK

type APICaptcha2chcaptchaShowGetOK struct{}

APICaptcha2chcaptchaShowGetOK is response for APICaptcha2chcaptchaShowGet operation.

type APICaptcha2chcaptchaShowGetParams

type APICaptcha2chcaptchaShowGetParams struct {
	// ID капчи.
	ID string
}

APICaptcha2chcaptchaShowGetParams is parameters of GET /api/captcha/2chcaptcha/show operation.

type APICaptcha2chcaptchaShowGetRes

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

type APICaptchaAppIDPublicKeyGetParams

type APICaptchaAppIDPublicKeyGetParams struct {
	// Публичный ключ, для получения напишите admin@2ch.hk с темой
	// письма "Получение ключа для приложения" и ссылкой на
	// ваш клиент.
	PublicKey string
	// ID доски, например, b.
	Board OptString
	// Номер треда.
	Thread OptInt
}

APICaptchaAppIDPublicKeyGetParams is parameters of GET /api/captcha/app/id/{public_key} operation.

type APICaptchaInvisibleRecaptchaIDGetParams

type APICaptchaInvisibleRecaptchaIDGetParams struct {
	// ID доски, например, b.
	Board OptString
	// Номер треда.
	Thread OptInt
}

APICaptchaInvisibleRecaptchaIDGetParams is parameters of GET /api/captcha/invisible_recaptcha/id operation.

type APICaptchaInvisibleRecaptchaMobileGetOK

type APICaptchaInvisibleRecaptchaMobileGetOK struct{}

APICaptchaInvisibleRecaptchaMobileGetOK is response for APICaptchaInvisibleRecaptchaMobileGet operation.

type APICaptchaRecaptchaIDGetParams

type APICaptchaRecaptchaIDGetParams struct {
	// ID доски, например, b.
	Board OptString
	// Номер треда.
	Thread OptInt
}

APICaptchaRecaptchaIDGetParams is parameters of GET /api/captcha/recaptcha/id operation.

type APICaptchaRecaptchaMobileGetOK

type APICaptchaRecaptchaMobileGetOK struct{}

APICaptchaRecaptchaMobileGetOK is response for APICaptchaRecaptchaMobileGet operation.

type APIDislikeGetParams

type APIDislikeGetParams struct {
	// ID доски, например, b.
	Board string
	// Номер поста.
	Num int
}

APIDislikeGetParams is parameters of GET /api/dislike operation.

type APILikeGetParams

type APILikeGetParams struct {
	// ID доски, например, b.
	Board string
	// Номер поста.
	Num int
}

APILikeGetParams is parameters of GET /api/like operation.

type APIMobileV2AfterBoardThreadNumGetParams

type APIMobileV2AfterBoardThreadNumGetParams struct {
	// ID доски, например, b.
	Board string
	// Номер треда.
	Thread int
	// Номер поста.
	Num int
}

APIMobileV2AfterBoardThreadNumGetParams is parameters of GET /api/mobile/v2/after/{board}/{thread}/{num} operation.

type APIMobileV2InfoBoardThreadGetParams

type APIMobileV2InfoBoardThreadGetParams struct {
	// ID доски, например, b.
	Board string
	// Номер треда.
	Thread int
}

APIMobileV2InfoBoardThreadGetParams is parameters of GET /api/mobile/v2/info/{board}/{thread} operation.

type APIMobileV2PostBoardNumGetParams

type APIMobileV2PostBoardNumGetParams struct {
	// ID доски, например, b.
	Board string
	// Номер поста.
	Num int
}

APIMobileV2PostBoardNumGetParams is parameters of GET /api/mobile/v2/post/{board}/{num} operation.

type Board

type Board struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Category string `json:"category"`
	// Информация о доске.
	Info string `json:"info"`
	// Информация о доске для главной.
	InfoOuter        string   `json:"info_outer"`
	ThreadsPerPage   int      `json:"threads_per_page"`
	BumpLimit        int      `json:"bump_limit"`
	MaxPages         int      `json:"max_pages"`
	DefaultName      string   `json:"default_name"`
	EnableNames      bool     `json:"enable_names"`
	EnableTrips      bool     `json:"enable_trips"`
	EnableSubject    bool     `json:"enable_subject"`
	EnableSage       bool     `json:"enable_sage"`
	EnableIcons      bool     `json:"enable_icons"`
	EnableFlags      bool     `json:"enable_flags"`
	EnableDices      bool     `json:"enable_dices"`
	EnableShield     bool     `json:"enable_shield"`
	EnableThreadTags bool     `json:"enable_thread_tags"`
	EnablePosting    bool     `json:"enable_posting"`
	EnableLikes      bool     `json:"enable_likes"`
	EnableOekaki     bool     `json:"enable_oekaki"`
	FileTypes        []string `json:"file_types"`
	MaxComment       int      `json:"max_comment"`
	MaxFilesSize     int      `json:"max_files_size"`
	// Массив тегов, которые доступны на этой доске, если они
	// включены.
	Tags []string `json:"tags"`
	// Массив иконок, которые доступны на этой доске, если
	// они включены.
	Icons []BoardIconsItem `json:"icons"`
}

Модель доски. Ref: #/components/schemas/Board

func (*Board) Decode

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

Decode decodes Board from json.

func (*Board) Encode

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

Encode implements json.Marshaler.

func (*Board) GetBumpLimit

func (s *Board) GetBumpLimit() int

GetBumpLimit returns the value of BumpLimit.

func (*Board) GetCategory

func (s *Board) GetCategory() string

GetCategory returns the value of Category.

func (*Board) GetDefaultName

func (s *Board) GetDefaultName() string

GetDefaultName returns the value of DefaultName.

func (*Board) GetEnableDices

func (s *Board) GetEnableDices() bool

GetEnableDices returns the value of EnableDices.

func (*Board) GetEnableFlags

func (s *Board) GetEnableFlags() bool

GetEnableFlags returns the value of EnableFlags.

func (*Board) GetEnableIcons

func (s *Board) GetEnableIcons() bool

GetEnableIcons returns the value of EnableIcons.

func (*Board) GetEnableLikes

func (s *Board) GetEnableLikes() bool

GetEnableLikes returns the value of EnableLikes.

func (*Board) GetEnableNames

func (s *Board) GetEnableNames() bool

GetEnableNames returns the value of EnableNames.

func (*Board) GetEnableOekaki

func (s *Board) GetEnableOekaki() bool

GetEnableOekaki returns the value of EnableOekaki.

func (*Board) GetEnablePosting

func (s *Board) GetEnablePosting() bool

GetEnablePosting returns the value of EnablePosting.

func (*Board) GetEnableSage

func (s *Board) GetEnableSage() bool

GetEnableSage returns the value of EnableSage.

func (*Board) GetEnableShield

func (s *Board) GetEnableShield() bool

GetEnableShield returns the value of EnableShield.

func (*Board) GetEnableSubject

func (s *Board) GetEnableSubject() bool

GetEnableSubject returns the value of EnableSubject.

func (*Board) GetEnableThreadTags

func (s *Board) GetEnableThreadTags() bool

GetEnableThreadTags returns the value of EnableThreadTags.

func (*Board) GetEnableTrips

func (s *Board) GetEnableTrips() bool

GetEnableTrips returns the value of EnableTrips.

func (*Board) GetFileTypes

func (s *Board) GetFileTypes() []string

GetFileTypes returns the value of FileTypes.

func (*Board) GetID

func (s *Board) GetID() string

GetID returns the value of ID.

func (*Board) GetIcons

func (s *Board) GetIcons() []BoardIconsItem

GetIcons returns the value of Icons.

func (*Board) GetInfo

func (s *Board) GetInfo() string

GetInfo returns the value of Info.

func (*Board) GetInfoOuter

func (s *Board) GetInfoOuter() string

GetInfoOuter returns the value of InfoOuter.

func (*Board) GetMaxComment

func (s *Board) GetMaxComment() int

GetMaxComment returns the value of MaxComment.

func (*Board) GetMaxFilesSize

func (s *Board) GetMaxFilesSize() int

GetMaxFilesSize returns the value of MaxFilesSize.

func (*Board) GetMaxPages

func (s *Board) GetMaxPages() int

GetMaxPages returns the value of MaxPages.

func (*Board) GetName

func (s *Board) GetName() string

GetName returns the value of Name.

func (*Board) GetTags

func (s *Board) GetTags() []string

GetTags returns the value of Tags.

func (*Board) GetThreadsPerPage

func (s *Board) GetThreadsPerPage() int

GetThreadsPerPage returns the value of ThreadsPerPage.

func (*Board) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Board) SetBumpLimit

func (s *Board) SetBumpLimit(val int)

SetBumpLimit sets the value of BumpLimit.

func (*Board) SetCategory

func (s *Board) SetCategory(val string)

SetCategory sets the value of Category.

func (*Board) SetDefaultName

func (s *Board) SetDefaultName(val string)

SetDefaultName sets the value of DefaultName.

func (*Board) SetEnableDices

func (s *Board) SetEnableDices(val bool)

SetEnableDices sets the value of EnableDices.

func (*Board) SetEnableFlags

func (s *Board) SetEnableFlags(val bool)

SetEnableFlags sets the value of EnableFlags.

func (*Board) SetEnableIcons

func (s *Board) SetEnableIcons(val bool)

SetEnableIcons sets the value of EnableIcons.

func (*Board) SetEnableLikes

func (s *Board) SetEnableLikes(val bool)

SetEnableLikes sets the value of EnableLikes.

func (*Board) SetEnableNames

func (s *Board) SetEnableNames(val bool)

SetEnableNames sets the value of EnableNames.

func (*Board) SetEnableOekaki

func (s *Board) SetEnableOekaki(val bool)

SetEnableOekaki sets the value of EnableOekaki.

func (*Board) SetEnablePosting

func (s *Board) SetEnablePosting(val bool)

SetEnablePosting sets the value of EnablePosting.

func (*Board) SetEnableSage

func (s *Board) SetEnableSage(val bool)

SetEnableSage sets the value of EnableSage.

func (*Board) SetEnableShield

func (s *Board) SetEnableShield(val bool)

SetEnableShield sets the value of EnableShield.

func (*Board) SetEnableSubject

func (s *Board) SetEnableSubject(val bool)

SetEnableSubject sets the value of EnableSubject.

func (*Board) SetEnableThreadTags

func (s *Board) SetEnableThreadTags(val bool)

SetEnableThreadTags sets the value of EnableThreadTags.

func (*Board) SetEnableTrips

func (s *Board) SetEnableTrips(val bool)

SetEnableTrips sets the value of EnableTrips.

func (*Board) SetFake

func (s *Board) SetFake()

SetFake set fake values.

func (*Board) SetFileTypes

func (s *Board) SetFileTypes(val []string)

SetFileTypes sets the value of FileTypes.

func (*Board) SetID

func (s *Board) SetID(val string)

SetID sets the value of ID.

func (*Board) SetIcons

func (s *Board) SetIcons(val []BoardIconsItem)

SetIcons sets the value of Icons.

func (*Board) SetInfo

func (s *Board) SetInfo(val string)

SetInfo sets the value of Info.

func (*Board) SetInfoOuter

func (s *Board) SetInfoOuter(val string)

SetInfoOuter sets the value of InfoOuter.

func (*Board) SetMaxComment

func (s *Board) SetMaxComment(val int)

SetMaxComment sets the value of MaxComment.

func (*Board) SetMaxFilesSize

func (s *Board) SetMaxFilesSize(val int)

SetMaxFilesSize sets the value of MaxFilesSize.

func (*Board) SetMaxPages

func (s *Board) SetMaxPages(val int)

SetMaxPages sets the value of MaxPages.

func (*Board) SetName

func (s *Board) SetName(val string)

SetName sets the value of Name.

func (*Board) SetTags

func (s *Board) SetTags(val []string)

SetTags sets the value of Tags.

func (*Board) SetThreadsPerPage

func (s *Board) SetThreadsPerPage(val int)

SetThreadsPerPage sets the value of ThreadsPerPage.

func (*Board) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Board) Validate

func (s *Board) Validate() error

type BoardIconsItem

type BoardIconsItem struct {
	Num  OptInt    `json:"num"`
	Name OptString `json:"name"`
	URL  OptString `json:"url"`
}

func (*BoardIconsItem) Decode

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

Decode decodes BoardIconsItem from json.

func (*BoardIconsItem) Encode

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

Encode implements json.Marshaler.

func (*BoardIconsItem) GetName

func (s *BoardIconsItem) GetName() OptString

GetName returns the value of Name.

func (*BoardIconsItem) GetNum

func (s *BoardIconsItem) GetNum() OptInt

GetNum returns the value of Num.

func (*BoardIconsItem) GetURL

func (s *BoardIconsItem) GetURL() OptString

GetURL returns the value of URL.

func (*BoardIconsItem) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*BoardIconsItem) SetFake

func (s *BoardIconsItem) SetFake()

SetFake set fake values.

func (*BoardIconsItem) SetName

func (s *BoardIconsItem) SetName(val OptString)

SetName sets the value of Name.

func (*BoardIconsItem) SetNum

func (s *BoardIconsItem) SetNum(val OptInt)

SetNum sets the value of Num.

func (*BoardIconsItem) SetURL

func (s *BoardIconsItem) SetURL(val OptString)

SetURL sets the value of URL.

func (*BoardIconsItem) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Boards

type Boards []Board

func (*Boards) Decode

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

Decode decodes Boards from json.

func (Boards) Encode

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

Encode encodes Boards as json.

func (Boards) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Boards) SetFake

func (s *Boards) SetFake()

SetFake set fake values.

func (*Boards) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (Boards) Validate

func (s Boards) Validate() error

type Captcha

type Captcha struct {
	Result int         `json:"result"`
	Error  OptError    `json:"error"`
	Type   CaptchaType `json:"type"`
	ID     string      `json:"id"`
	// Время в секундах после которого id перестанет
	// действовать.
	Expires OptInt `json:"expires"`
	// Тип текста, изображённого на картинке капчи.
	// Возможные варианты:
	// * numeric - только цифры. (0123456789)
	// * english - цифры и английские буквы. (0123456789abcdefghijklmnopqrstuvwxyz)
	// * russian - цифры и русские буквы.
	// (0123456789абвгдеёжзийклмнопрстуфхцчшщъыьэюя)
	// * all - цифры, русские и английские буквы.
	// (0123456789abcdefghijklmnopqrstuvwxyzабвгдеёжзийклмнопрстуфхцчшщъыьэюя).
	Input OptString `json:"input"`
}

Ref: #/components/schemas/Captcha

func (*Captcha) Decode

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

Decode decodes Captcha from json.

func (*Captcha) Encode

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

Encode implements json.Marshaler.

func (*Captcha) GetError

func (s *Captcha) GetError() OptError

GetError returns the value of Error.

func (*Captcha) GetExpires

func (s *Captcha) GetExpires() OptInt

GetExpires returns the value of Expires.

func (*Captcha) GetID

func (s *Captcha) GetID() string

GetID returns the value of ID.

func (*Captcha) GetInput

func (s *Captcha) GetInput() OptString

GetInput returns the value of Input.

func (*Captcha) GetResult

func (s *Captcha) GetResult() int

GetResult returns the value of Result.

func (*Captcha) GetType

func (s *Captcha) GetType() CaptchaType

GetType returns the value of Type.

func (*Captcha) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Captcha) SetError

func (s *Captcha) SetError(val OptError)

SetError sets the value of Error.

func (*Captcha) SetExpires

func (s *Captcha) SetExpires(val OptInt)

SetExpires sets the value of Expires.

func (*Captcha) SetFake

func (s *Captcha) SetFake()

SetFake set fake values.

func (*Captcha) SetID

func (s *Captcha) SetID(val string)

SetID sets the value of ID.

func (*Captcha) SetInput

func (s *Captcha) SetInput(val OptString)

SetInput sets the value of Input.

func (*Captcha) SetResult

func (s *Captcha) SetResult(val int)

SetResult sets the value of Result.

func (*Captcha) SetType

func (s *Captcha) SetType(val CaptchaType)

SetType sets the value of Type.

func (*Captcha) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Captcha) Validate

func (s *Captcha) Validate() error

type CaptchaType

type CaptchaType string

Каждый тип капчи так же требует дополнительные параметры для её валидации: * recaptcha: g-recaptcha-response * invisible_recaptcha: g-recaptcha-response * recaptcha3: g-recaptcha-response * 2chcaptcha: Два.ч капча 2chcaptcha_id - идентификатор Два.ч капчи. 2chcaptcha_value - строка, которую пользователь увидел на картинке. * appid: app_response_id и app_response app_response_id - результат запроса к этому методу с публичным ключём приложения: /api/captcha/app/id/{public_key} app_response - sha256(app_response_id + '|' + private_key) * passcode: cookie passcode_auth * nocaptcha: капча не требуется, никакие дополнительные параметры тоже. Ref: #/components/schemas/CaptchaType

const (
	CaptchaTypeRecaptcha          CaptchaType = "recaptcha"
	CaptchaTypeInvisibleRecaptcha CaptchaType = "invisible_recaptcha"
	CaptchaTypeRecaptcha3         CaptchaType = "recaptcha3"
	CaptchaType2chcaptcha         CaptchaType = "2chcaptcha"
	CaptchaTypeAppid              CaptchaType = "appid"
	CaptchaTypePasscode           CaptchaType = "passcode"
	CaptchaTypeNocaptcha          CaptchaType = "nocaptcha"
)

func (CaptchaType) AllValues

func (CaptchaType) AllValues() []CaptchaType

AllValues returns all CaptchaType values.

func (*CaptchaType) Decode

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

Decode decodes CaptchaType from json.

func (CaptchaType) Encode

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

Encode encodes CaptchaType as json.

func (CaptchaType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (CaptchaType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*CaptchaType) SetFake

func (s *CaptchaType) SetFake()

SetFake set fake values.

func (*CaptchaType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CaptchaType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (CaptchaType) Validate

func (s CaptchaType) 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) APICaptcha2chcaptchaIDGet

func (c *Client) APICaptcha2chcaptchaIDGet(ctx context.Context, params APICaptcha2chcaptchaIDGetParams) (*Captcha, error)

APICaptcha2chcaptchaIDGet invokes GET /api/captcha/2chcaptcha/id operation.

Получение ид для использования 2chcaptcha.

GET /api/captcha/2chcaptcha/id

func (*Client) APICaptcha2chcaptchaShowGet

func (c *Client) APICaptcha2chcaptchaShowGet(ctx context.Context, params APICaptcha2chcaptchaShowGetParams) (APICaptcha2chcaptchaShowGetRes, error)

APICaptcha2chcaptchaShowGet invokes GET /api/captcha/2chcaptcha/show operation.

Отображение 2chcaptcha по id.

GET /api/captcha/2chcaptcha/show

func (*Client) APICaptchaAppIDPublicKeyGet

func (c *Client) APICaptchaAppIDPublicKeyGet(ctx context.Context, params APICaptchaAppIDPublicKeyGetParams) (*Captcha, error)

APICaptchaAppIDPublicKeyGet invokes GET /api/captcha/app/id/{public_key} operation.

Полученный id вам нужно отправить вместе с постом как app_response_id. При этом нужно отправить app_response = sha256(app_response_id + '|' + private key). Срок жизни id: 180 секунд.

GET /api/captcha/app/id/{public_key}

func (*Client) APICaptchaInvisibleRecaptchaIDGet

func (c *Client) APICaptchaInvisibleRecaptchaIDGet(ctx context.Context, params APICaptchaInvisibleRecaptchaIDGetParams) (*Captcha, error)

APICaptchaInvisibleRecaptchaIDGet invokes GET /api/captcha/invisible_recaptcha/id operation.

Получение публичного ключа invisible recaptcha.

GET /api/captcha/invisible_recaptcha/id

func (*Client) APICaptchaInvisibleRecaptchaMobileGet

func (c *Client) APICaptchaInvisibleRecaptchaMobileGet(ctx context.Context) error

APICaptchaInvisibleRecaptchaMobileGet invokes GET /api/captcha/invisible_recaptcha/mobile operation.

Получение html страницы для решения капчи, CORS отключён.

GET /api/captcha/invisible_recaptcha/mobile

func (*Client) APICaptchaRecaptchaIDGet

func (c *Client) APICaptchaRecaptchaIDGet(ctx context.Context, params APICaptchaRecaptchaIDGetParams) (*Captcha, error)

APICaptchaRecaptchaIDGet invokes GET /api/captcha/recaptcha/id operation.

Получение публичного ключа recaptcha v2.

GET /api/captcha/recaptcha/id

func (*Client) APICaptchaRecaptchaMobileGet

func (c *Client) APICaptchaRecaptchaMobileGet(ctx context.Context) error

APICaptchaRecaptchaMobileGet invokes GET /api/captcha/recaptcha/mobile operation.

Получение html страницы для решения капчи, CORS отключён.

GET /api/captcha/recaptcha/mobile

func (*Client) APIDislikeGet

func (c *Client) APIDislikeGet(ctx context.Context, params APIDislikeGetParams) (*Like, error)

APIDislikeGet invokes GET /api/dislike operation.

Добавление дизлайка на пост.

GET /api/dislike

func (*Client) APILikeGet

func (c *Client) APILikeGet(ctx context.Context, params APILikeGetParams) (*Like, error)

APILikeGet invokes GET /api/like operation.

Добавление лайка на пост.

GET /api/like

func (*Client) APIMobileV2AfterBoardThreadNumGet

func (c *Client) APIMobileV2AfterBoardThreadNumGet(ctx context.Context, params APIMobileV2AfterBoardThreadNumGetParams) (*MobileThreadPostsAfter, error)

APIMobileV2AfterBoardThreadNumGet invokes GET /api/mobile/v2/after/{board}/{thread}/{num} operation.

Получение постов в треде >= указанного. Не рекомендуется использовать для получения треда целиком, только для проверки новых постов.

GET /api/mobile/v2/after/{board}/{thread}/{num}

func (*Client) APIMobileV2BoardsGet

func (c *Client) APIMobileV2BoardsGet(ctx context.Context) (Boards, error)

APIMobileV2BoardsGet invokes GET /api/mobile/v2/boards operation.

Получение списка досок и их настроек.

GET /api/mobile/v2/boards

func (*Client) APIMobileV2InfoBoardThreadGet

func (c *Client) APIMobileV2InfoBoardThreadGet(ctx context.Context, params APIMobileV2InfoBoardThreadGetParams) (*MobileThreadLastInfo, error)

APIMobileV2InfoBoardThreadGet invokes GET /api/mobile/v2/info/{board}/{thread} operation.

Получение информации о треде.

GET /api/mobile/v2/info/{board}/{thread}

func (*Client) APIMobileV2PostBoardNumGet

func (c *Client) APIMobileV2PostBoardNumGet(ctx context.Context, params APIMobileV2PostBoardNumGetParams) (*MobilePost, error)

APIMobileV2PostBoardNumGet invokes GET /api/mobile/v2/post/{board}/{num} operation.

Получение информации о посте.

GET /api/mobile/v2/post/{board}/{num}

func (*Client) UserPassloginPost

func (c *Client) UserPassloginPost(ctx context.Context, request OptUserPassloginPostReq, params UserPassloginPostParams) (*Passcode, error)

UserPassloginPost invokes POST /user/passlogin operation.

Авторизация пасскода.

POST /user/passlogin

func (*Client) UserPostingPost

func (c *Client) UserPostingPost(ctx context.Context, request OptUserPostingPostReq) (UserPostingPostOK, error)

UserPostingPost invokes POST /user/posting operation.

Создание нового поста или треда.

POST /user/posting

func (*Client) UserReportPost

func (c *Client) UserReportPost(ctx context.Context, request OptUserReportPostReq) (*Report, error)

UserReportPost invokes POST /user/report operation.

Отправка жалобы.

POST /user/report

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

type Error struct {
	Code OptErrorCode `json:"code"`
	// Описание ошибки на русском языке.
	Message OptString `json:"message"`
}

Ошибка запроса. Ref: #/components/schemas/Error

func (*Error) Decode

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

Decode decodes Error from json.

func (*Error) Encode

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

Encode implements json.Marshaler.

func (*Error) GetCode

func (s *Error) GetCode() OptErrorCode

GetCode returns the value of Code.

func (*Error) GetMessage

func (s *Error) GetMessage() OptString

GetMessage returns the value of Message.

func (*Error) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Error) SetCode

func (s *Error) SetCode(val OptErrorCode)

SetCode sets the value of Code.

func (*Error) SetFake

func (s *Error) SetFake()

SetFake set fake values.

func (*Error) SetMessage

func (s *Error) SetMessage(val OptString)

SetMessage sets the value of Message.

func (*Error) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Error) Validate

func (s *Error) Validate() error

type ErrorCode

type ErrorCode int

* 0 NoError, ошибки нет. * 403 ErrorForbidden, ошибка доступа. * 666 ErrorInternal, внутренняя ошибка. * 667 ErrorNotFound, используется для совместимости, если запрос не существует. * -2 ErrorNoBoard, доска не существует. * -3 ErrorNoParent, тред не существует. * -31 ErrorNoPost, пост не существует. * -4 ErrorNoAccess, контент существует, но у вас нет доступа. * -41 ErrorBoardClosed, доска закрыта. * -42 ErrorBoardOnlyVIP, доступ к доске возможен только с пасскодом. * -5 ErrorCaptchaNotValid, капча не валидна. * -6 ErrorBanned, вы были забанены. Сообщение содержит причину и номер бана. * -7 ErrorThreadClosed, тред закрыт. * -8 ErrorPostingToFast, вы постите слишком быстро ИЛИ установлен лимит на создание тредов на доске. * -9 ErrorFieldTooBig, поле слишком большое. Например, комментарий превысил лимит. * -10 ErrorFileSimilar, похожий файл уже был загружен. * -11 ErrorFileNotSupported, файл не поддерживается. * -12 ErrorFileTooBig, слишком большой файл. * -13 ErrorFilesTooMuch, вы загрузили больше файлов, чем разрешено на доске. * -14 ErrorTripBanned, трипкод был забанен. * -15 ErrorWordBanned, в комментарии недопустимое выражение. * -16 ErrorSpamList, в комментарии выражение из спамлиста. * -19 ErrorEmptyOp, при создании треда необходимо загрузить файл. * -20 ErrorEmptyPost, пост не может быть пустым, необходим комментарий/файл/etc. * -21 ErrorPasscodeNotExist, пасскод не существует. * -22 ErrorLimitReached, достигнут лимит запросов, попробуйте позже. * -23 ErrorFieldTooSmall, слишком короткое сообщение. (используется в поиске). * -50 ErrorReportTooManyPostsm, слишком много постов для жалобы. * -51 ErrorReportEmpty, вы ничего не написали в жалобе. * -52 ErrorReportExist, вы уже отправляли жалобу. * -300 ErrorAppNotExist, приложение не существует или было отключено. * -301 ErrorAppIDWrong, некорректный идентификатор приложения. * -302 ErrorAppIDExpired, идентификатор приложения истёк. * -303 ErrorAppIDSignature, неверная подпись поста с помощью идентификатора. * -304 ErrorAppIDUsed, указанный идентификатор уже был использован. * -24 ErrorWrongStickerID, некорректный идентификатор стикера. * -25 ErrorStickerNotFound, стикер не найден. Ref: #/components/schemas/ErrorCode

const (
	ErrorCode0        ErrorCode = 0
	ErrorCode403      ErrorCode = 403
	ErrorCode666      ErrorCode = 666
	ErrorCode667      ErrorCode = 667
	ErrorCodeMinus2   ErrorCode = -2
	ErrorCodeMinus3   ErrorCode = -3
	ErrorCodeMinus31  ErrorCode = -31
	ErrorCodeMinus4   ErrorCode = -4
	ErrorCodeMinus41  ErrorCode = -41
	ErrorCodeMinus42  ErrorCode = -42
	ErrorCodeMinus5   ErrorCode = -5
	ErrorCodeMinus6   ErrorCode = -6
	ErrorCodeMinus7   ErrorCode = -7
	ErrorCodeMinus8   ErrorCode = -8
	ErrorCodeMinus9   ErrorCode = -9
	ErrorCodeMinus10  ErrorCode = -10
	ErrorCodeMinus11  ErrorCode = -11
	ErrorCodeMinus12  ErrorCode = -12
	ErrorCodeMinus13  ErrorCode = -13
	ErrorCodeMinus14  ErrorCode = -14
	ErrorCodeMinus15  ErrorCode = -15
	ErrorCodeMinus16  ErrorCode = -16
	ErrorCodeMinus19  ErrorCode = -19
	ErrorCodeMinus20  ErrorCode = -20
	ErrorCodeMinus21  ErrorCode = -21
	ErrorCodeMinus22  ErrorCode = -22
	ErrorCodeMinus23  ErrorCode = -23
	ErrorCodeMinus300 ErrorCode = -300
	ErrorCodeMinus301 ErrorCode = -301
	ErrorCodeMinus302 ErrorCode = -302
	ErrorCodeMinus303 ErrorCode = -303
	ErrorCodeMinus304 ErrorCode = -304
	ErrorCodeMinus24  ErrorCode = -24
	ErrorCodeMinus25  ErrorCode = -25
)

func (ErrorCode) AllValues

func (ErrorCode) AllValues() []ErrorCode

AllValues returns all ErrorCode values.

func (*ErrorCode) Decode

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

Decode decodes ErrorCode from json.

func (ErrorCode) Encode

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

Encode encodes ErrorCode as json.

func (ErrorCode) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ErrorCode) SetFake

func (s *ErrorCode) SetFake()

SetFake set fake values.

func (*ErrorCode) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (ErrorCode) Validate

func (s ErrorCode) Validate() error

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type File

type File struct {
	Name        string    `json:"name"`
	Fullname    string    `json:"fullname"`
	Displayname string    `json:"displayname"`
	Path        string    `json:"path"`
	Thumbnail   string    `json:"thumbnail"`
	MD5         OptString `json:"md5"`
	Type        FileType  `json:"type"`
	// Размер файла, в КБ.
	Size     int `json:"size"`
	Width    int `json:"width"`
	Height   int `json:"height"`
	TnWidth  int `json:"tn_width"`
	TnHeight int `json:"tn_height"`
	// Если >= 0, файл содержит NSFW контент, в данный момент
	// реализовано не на всех досках.
	Nsfw OptInt `json:"nsfw"`
	// В случае видео/аудио файла, содержит
	// продолжительность в формате XX:XX:XX.
	Duration OptString `json:"duration"`
	// В случае видео/аудио файла, содержит
	// продолжительность в секундах.
	DurationSecs OptInt `json:"duration_secs"`
	// В случае стикера, содержит ID стикер пака.
	Pack OptString `json:"pack"`
	// В случае стикера, содержит ID стикера.
	Sticker OptString `json:"sticker"`
	// В случае стикера, содержит ссылку на установку.
	Install OptString `json:"install"`
}

Модель файла. Ref: #/components/schemas/File

func (*File) Decode

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

Decode decodes File from json.

func (*File) Encode

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

Encode implements json.Marshaler.

func (*File) GetDisplayname

func (s *File) GetDisplayname() string

GetDisplayname returns the value of Displayname.

func (*File) GetDuration

func (s *File) GetDuration() OptString

GetDuration returns the value of Duration.

func (*File) GetDurationSecs

func (s *File) GetDurationSecs() OptInt

GetDurationSecs returns the value of DurationSecs.

func (*File) GetFullname

func (s *File) GetFullname() string

GetFullname returns the value of Fullname.

func (*File) GetHeight

func (s *File) GetHeight() int

GetHeight returns the value of Height.

func (*File) GetInstall

func (s *File) GetInstall() OptString

GetInstall returns the value of Install.

func (*File) GetMD5

func (s *File) GetMD5() OptString

GetMD5 returns the value of MD5.

func (*File) GetName

func (s *File) GetName() string

GetName returns the value of Name.

func (*File) GetNsfw

func (s *File) GetNsfw() OptInt

GetNsfw returns the value of Nsfw.

func (*File) GetPack

func (s *File) GetPack() OptString

GetPack returns the value of Pack.

func (*File) GetPath

func (s *File) GetPath() string

GetPath returns the value of Path.

func (*File) GetSize

func (s *File) GetSize() int

GetSize returns the value of Size.

func (*File) GetSticker

func (s *File) GetSticker() OptString

GetSticker returns the value of Sticker.

func (*File) GetThumbnail

func (s *File) GetThumbnail() string

GetThumbnail returns the value of Thumbnail.

func (*File) GetTnHeight

func (s *File) GetTnHeight() int

GetTnHeight returns the value of TnHeight.

func (*File) GetTnWidth

func (s *File) GetTnWidth() int

GetTnWidth returns the value of TnWidth.

func (*File) GetType

func (s *File) GetType() FileType

GetType returns the value of Type.

func (*File) GetWidth

func (s *File) GetWidth() int

GetWidth returns the value of Width.

func (*File) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*File) SetDisplayname

func (s *File) SetDisplayname(val string)

SetDisplayname sets the value of Displayname.

func (*File) SetDuration

func (s *File) SetDuration(val OptString)

SetDuration sets the value of Duration.

func (*File) SetDurationSecs

func (s *File) SetDurationSecs(val OptInt)

SetDurationSecs sets the value of DurationSecs.

func (*File) SetFake

func (s *File) SetFake()

SetFake set fake values.

func (*File) SetFullname

func (s *File) SetFullname(val string)

SetFullname sets the value of Fullname.

func (*File) SetHeight

func (s *File) SetHeight(val int)

SetHeight sets the value of Height.

func (*File) SetInstall

func (s *File) SetInstall(val OptString)

SetInstall sets the value of Install.

func (*File) SetMD5

func (s *File) SetMD5(val OptString)

SetMD5 sets the value of MD5.

func (*File) SetName

func (s *File) SetName(val string)

SetName sets the value of Name.

func (*File) SetNsfw

func (s *File) SetNsfw(val OptInt)

SetNsfw sets the value of Nsfw.

func (*File) SetPack

func (s *File) SetPack(val OptString)

SetPack sets the value of Pack.

func (*File) SetPath

func (s *File) SetPath(val string)

SetPath sets the value of Path.

func (*File) SetSize

func (s *File) SetSize(val int)

SetSize sets the value of Size.

func (*File) SetSticker

func (s *File) SetSticker(val OptString)

SetSticker sets the value of Sticker.

func (*File) SetThumbnail

func (s *File) SetThumbnail(val string)

SetThumbnail sets the value of Thumbnail.

func (*File) SetTnHeight

func (s *File) SetTnHeight(val int)

SetTnHeight sets the value of TnHeight.

func (*File) SetTnWidth

func (s *File) SetTnWidth(val int)

SetTnWidth sets the value of TnWidth.

func (*File) SetType

func (s *File) SetType(val FileType)

SetType sets the value of Type.

func (*File) SetWidth

func (s *File) SetWidth(val int)

SetWidth sets the value of Width.

func (*File) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*File) Validate

func (s *File) Validate() error

type FileType

type FileType int

* 0 FileTypeNone * 1 FileTypeJpg * 2 FileTypePng * 3 FileTypeAPng * 4 FileTypeGif * 5 FileTypeBmp * 6 FileTypeWebm * 7 FileTypeMp3, не используется в данный момент. * 8 FileTypeOgg, не используется в данный момент. * 10 FileTypeMp4 * 100 FileTypeSticker. Ref: #/components/schemas/FileType

const (
	FileType0   FileType = 0
	FileType1   FileType = 1
	FileType2   FileType = 2
	FileType3   FileType = 3
	FileType4   FileType = 4
	FileType5   FileType = 5
	FileType6   FileType = 6
	FileType7   FileType = 7
	FileType8   FileType = 8
	FileType10  FileType = 10
	FileType100 FileType = 100
)

func (FileType) AllValues

func (FileType) AllValues() []FileType

AllValues returns all FileType values.

func (*FileType) Decode

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

Decode decodes FileType from json.

func (FileType) Encode

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

Encode encodes FileType as json.

func (FileType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*FileType) SetFake

func (s *FileType) SetFake()

SetFake set fake values.

func (*FileType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (FileType) Validate

func (s FileType) Validate() error

type Handler

type Handler interface {
	// APICaptcha2chcaptchaIDGet implements GET /api/captcha/2chcaptcha/id operation.
	//
	// Получение ид для использования 2chcaptcha.
	//
	// GET /api/captcha/2chcaptcha/id
	APICaptcha2chcaptchaIDGet(ctx context.Context, params APICaptcha2chcaptchaIDGetParams) (*Captcha, error)
	// APICaptcha2chcaptchaShowGet implements GET /api/captcha/2chcaptcha/show operation.
	//
	// Отображение 2chcaptcha по id.
	//
	// GET /api/captcha/2chcaptcha/show
	APICaptcha2chcaptchaShowGet(ctx context.Context, params APICaptcha2chcaptchaShowGetParams) (APICaptcha2chcaptchaShowGetRes, error)
	// APICaptchaAppIDPublicKeyGet implements GET /api/captcha/app/id/{public_key} operation.
	//
	// Полученный id вам нужно отправить вместе с постом как
	// app_response_id.
	// При этом нужно отправить app_response = sha256(app_response_id + '|' +
	// private key).
	// Срок жизни id: 180 секунд.
	//
	// GET /api/captcha/app/id/{public_key}
	APICaptchaAppIDPublicKeyGet(ctx context.Context, params APICaptchaAppIDPublicKeyGetParams) (*Captcha, error)
	// APICaptchaInvisibleRecaptchaIDGet implements GET /api/captcha/invisible_recaptcha/id operation.
	//
	// Получение публичного ключа invisible recaptcha.
	//
	// GET /api/captcha/invisible_recaptcha/id
	APICaptchaInvisibleRecaptchaIDGet(ctx context.Context, params APICaptchaInvisibleRecaptchaIDGetParams) (*Captcha, error)
	// APICaptchaInvisibleRecaptchaMobileGet implements GET /api/captcha/invisible_recaptcha/mobile operation.
	//
	// Получение html страницы для решения капчи, CORS отключён.
	//
	// GET /api/captcha/invisible_recaptcha/mobile
	APICaptchaInvisibleRecaptchaMobileGet(ctx context.Context) error
	// APICaptchaRecaptchaIDGet implements GET /api/captcha/recaptcha/id operation.
	//
	// Получение публичного ключа recaptcha v2.
	//
	// GET /api/captcha/recaptcha/id
	APICaptchaRecaptchaIDGet(ctx context.Context, params APICaptchaRecaptchaIDGetParams) (*Captcha, error)
	// APICaptchaRecaptchaMobileGet implements GET /api/captcha/recaptcha/mobile operation.
	//
	// Получение html страницы для решения капчи, CORS отключён.
	//
	// GET /api/captcha/recaptcha/mobile
	APICaptchaRecaptchaMobileGet(ctx context.Context) error
	// APIDislikeGet implements GET /api/dislike operation.
	//
	// Добавление дизлайка на пост.
	//
	// GET /api/dislike
	APIDislikeGet(ctx context.Context, params APIDislikeGetParams) (*Like, error)
	// APILikeGet implements GET /api/like operation.
	//
	// Добавление лайка на пост.
	//
	// GET /api/like
	APILikeGet(ctx context.Context, params APILikeGetParams) (*Like, error)
	// APIMobileV2AfterBoardThreadNumGet implements GET /api/mobile/v2/after/{board}/{thread}/{num} operation.
	//
	// Получение постов в треде >= указанного. Не
	// рекомендуется использовать для получения треда
	// целиком, только для проверки новых постов.
	//
	// GET /api/mobile/v2/after/{board}/{thread}/{num}
	APIMobileV2AfterBoardThreadNumGet(ctx context.Context, params APIMobileV2AfterBoardThreadNumGetParams) (*MobileThreadPostsAfter, error)
	// APIMobileV2BoardsGet implements GET /api/mobile/v2/boards operation.
	//
	// Получение списка досок и их настроек.
	//
	// GET /api/mobile/v2/boards
	APIMobileV2BoardsGet(ctx context.Context) (Boards, error)
	// APIMobileV2InfoBoardThreadGet implements GET /api/mobile/v2/info/{board}/{thread} operation.
	//
	// Получение информации о треде.
	//
	// GET /api/mobile/v2/info/{board}/{thread}
	APIMobileV2InfoBoardThreadGet(ctx context.Context, params APIMobileV2InfoBoardThreadGetParams) (*MobileThreadLastInfo, error)
	// APIMobileV2PostBoardNumGet implements GET /api/mobile/v2/post/{board}/{num} operation.
	//
	// Получение информации о посте.
	//
	// GET /api/mobile/v2/post/{board}/{num}
	APIMobileV2PostBoardNumGet(ctx context.Context, params APIMobileV2PostBoardNumGetParams) (*MobilePost, error)
	// UserPassloginPost implements POST /user/passlogin operation.
	//
	// Авторизация пасскода.
	//
	// POST /user/passlogin
	UserPassloginPost(ctx context.Context, req OptUserPassloginPostReq, params UserPassloginPostParams) (*Passcode, error)
	// UserPostingPost implements POST /user/posting operation.
	//
	// Создание нового поста или треда.
	//
	// POST /user/posting
	UserPostingPost(ctx context.Context, req OptUserPostingPostReq) (UserPostingPostOK, error)
	// UserReportPost implements POST /user/report operation.
	//
	// Отправка жалобы.
	//
	// POST /user/report
	UserReportPost(ctx context.Context, req OptUserReportPostReq) (*Report, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Invoker

type Invoker interface {
	// APICaptcha2chcaptchaIDGet invokes GET /api/captcha/2chcaptcha/id operation.
	//
	// Получение ид для использования 2chcaptcha.
	//
	// GET /api/captcha/2chcaptcha/id
	APICaptcha2chcaptchaIDGet(ctx context.Context, params APICaptcha2chcaptchaIDGetParams) (*Captcha, error)
	// APICaptcha2chcaptchaShowGet invokes GET /api/captcha/2chcaptcha/show operation.
	//
	// Отображение 2chcaptcha по id.
	//
	// GET /api/captcha/2chcaptcha/show
	APICaptcha2chcaptchaShowGet(ctx context.Context, params APICaptcha2chcaptchaShowGetParams) (APICaptcha2chcaptchaShowGetRes, error)
	// APICaptchaAppIDPublicKeyGet invokes GET /api/captcha/app/id/{public_key} operation.
	//
	// Полученный id вам нужно отправить вместе с постом как
	// app_response_id.
	// При этом нужно отправить app_response = sha256(app_response_id + '|' +
	// private key).
	// Срок жизни id: 180 секунд.
	//
	// GET /api/captcha/app/id/{public_key}
	APICaptchaAppIDPublicKeyGet(ctx context.Context, params APICaptchaAppIDPublicKeyGetParams) (*Captcha, error)
	// APICaptchaInvisibleRecaptchaIDGet invokes GET /api/captcha/invisible_recaptcha/id operation.
	//
	// Получение публичного ключа invisible recaptcha.
	//
	// GET /api/captcha/invisible_recaptcha/id
	APICaptchaInvisibleRecaptchaIDGet(ctx context.Context, params APICaptchaInvisibleRecaptchaIDGetParams) (*Captcha, error)
	// APICaptchaInvisibleRecaptchaMobileGet invokes GET /api/captcha/invisible_recaptcha/mobile operation.
	//
	// Получение html страницы для решения капчи, CORS отключён.
	//
	// GET /api/captcha/invisible_recaptcha/mobile
	APICaptchaInvisibleRecaptchaMobileGet(ctx context.Context) error
	// APICaptchaRecaptchaIDGet invokes GET /api/captcha/recaptcha/id operation.
	//
	// Получение публичного ключа recaptcha v2.
	//
	// GET /api/captcha/recaptcha/id
	APICaptchaRecaptchaIDGet(ctx context.Context, params APICaptchaRecaptchaIDGetParams) (*Captcha, error)
	// APICaptchaRecaptchaMobileGet invokes GET /api/captcha/recaptcha/mobile operation.
	//
	// Получение html страницы для решения капчи, CORS отключён.
	//
	// GET /api/captcha/recaptcha/mobile
	APICaptchaRecaptchaMobileGet(ctx context.Context) error
	// APIDislikeGet invokes GET /api/dislike operation.
	//
	// Добавление дизлайка на пост.
	//
	// GET /api/dislike
	APIDislikeGet(ctx context.Context, params APIDislikeGetParams) (*Like, error)
	// APILikeGet invokes GET /api/like operation.
	//
	// Добавление лайка на пост.
	//
	// GET /api/like
	APILikeGet(ctx context.Context, params APILikeGetParams) (*Like, error)
	// APIMobileV2AfterBoardThreadNumGet invokes GET /api/mobile/v2/after/{board}/{thread}/{num} operation.
	//
	// Получение постов в треде >= указанного. Не
	// рекомендуется использовать для получения треда
	// целиком, только для проверки новых постов.
	//
	// GET /api/mobile/v2/after/{board}/{thread}/{num}
	APIMobileV2AfterBoardThreadNumGet(ctx context.Context, params APIMobileV2AfterBoardThreadNumGetParams) (*MobileThreadPostsAfter, error)
	// APIMobileV2BoardsGet invokes GET /api/mobile/v2/boards operation.
	//
	// Получение списка досок и их настроек.
	//
	// GET /api/mobile/v2/boards
	APIMobileV2BoardsGet(ctx context.Context) (Boards, error)
	// APIMobileV2InfoBoardThreadGet invokes GET /api/mobile/v2/info/{board}/{thread} operation.
	//
	// Получение информации о треде.
	//
	// GET /api/mobile/v2/info/{board}/{thread}
	APIMobileV2InfoBoardThreadGet(ctx context.Context, params APIMobileV2InfoBoardThreadGetParams) (*MobileThreadLastInfo, error)
	// APIMobileV2PostBoardNumGet invokes GET /api/mobile/v2/post/{board}/{num} operation.
	//
	// Получение информации о посте.
	//
	// GET /api/mobile/v2/post/{board}/{num}
	APIMobileV2PostBoardNumGet(ctx context.Context, params APIMobileV2PostBoardNumGetParams) (*MobilePost, error)
	// UserPassloginPost invokes POST /user/passlogin operation.
	//
	// Авторизация пасскода.
	//
	// POST /user/passlogin
	UserPassloginPost(ctx context.Context, request OptUserPassloginPostReq, params UserPassloginPostParams) (*Passcode, error)
	// UserPostingPost invokes POST /user/posting operation.
	//
	// Создание нового поста или треда.
	//
	// POST /user/posting
	UserPostingPost(ctx context.Context, request OptUserPostingPostReq) (UserPostingPostOK, error)
	// UserReportPost invokes POST /user/report operation.
	//
	// Отправка жалобы.
	//
	// POST /user/report
	UserReportPost(ctx context.Context, request OptUserReportPostReq) (*Report, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type Like

type Like struct {
	Result OptInt   `json:"result"`
	Error  OptError `json:"error"`
}

Ref: #/components/schemas/Like

func (*Like) Decode

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

Decode decodes Like from json.

func (*Like) Encode

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

Encode implements json.Marshaler.

func (*Like) GetError

func (s *Like) GetError() OptError

GetError returns the value of Error.

func (*Like) GetResult

func (s *Like) GetResult() OptInt

GetResult returns the value of Result.

func (*Like) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Like) SetError

func (s *Like) SetError(val OptError)

SetError sets the value of Error.

func (*Like) SetFake

func (s *Like) SetFake()

SetFake set fake values.

func (*Like) SetResult

func (s *Like) SetResult(val OptInt)

SetResult sets the value of Result.

func (*Like) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Like) Validate

func (s *Like) Validate() error

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type MobilePost

type MobilePost struct {
	Result OptInt   `json:"result"`
	Error  OptError `json:"error"`
	Post   OptPost  `json:"post"`
}

Ref: #/components/schemas/MobilePost

func (*MobilePost) Decode

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

Decode decodes MobilePost from json.

func (*MobilePost) Encode

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

Encode implements json.Marshaler.

func (*MobilePost) GetError

func (s *MobilePost) GetError() OptError

GetError returns the value of Error.

func (*MobilePost) GetPost

func (s *MobilePost) GetPost() OptPost

GetPost returns the value of Post.

func (*MobilePost) GetResult

func (s *MobilePost) GetResult() OptInt

GetResult returns the value of Result.

func (*MobilePost) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*MobilePost) SetError

func (s *MobilePost) SetError(val OptError)

SetError sets the value of Error.

func (*MobilePost) SetFake

func (s *MobilePost) SetFake()

SetFake set fake values.

func (*MobilePost) SetPost

func (s *MobilePost) SetPost(val OptPost)

SetPost sets the value of Post.

func (*MobilePost) SetResult

func (s *MobilePost) SetResult(val OptInt)

SetResult sets the value of Result.

func (*MobilePost) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MobilePost) Validate

func (s *MobilePost) Validate() error

type MobileThreadLastInfo

type MobileThreadLastInfo struct {
	Result OptInt                        `json:"result"`
	Error  OptError                      `json:"error"`
	Thread OptMobileThreadLastInfoThread `json:"thread"`
}

Ref: #/components/schemas/MobileThreadLastInfo

func (*MobileThreadLastInfo) Decode

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

Decode decodes MobileThreadLastInfo from json.

func (*MobileThreadLastInfo) Encode

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

Encode implements json.Marshaler.

func (*MobileThreadLastInfo) GetError

func (s *MobileThreadLastInfo) GetError() OptError

GetError returns the value of Error.

func (*MobileThreadLastInfo) GetResult

func (s *MobileThreadLastInfo) GetResult() OptInt

GetResult returns the value of Result.

func (*MobileThreadLastInfo) GetThread

GetThread returns the value of Thread.

func (*MobileThreadLastInfo) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*MobileThreadLastInfo) SetError

func (s *MobileThreadLastInfo) SetError(val OptError)

SetError sets the value of Error.

func (*MobileThreadLastInfo) SetFake

func (s *MobileThreadLastInfo) SetFake()

SetFake set fake values.

func (*MobileThreadLastInfo) SetResult

func (s *MobileThreadLastInfo) SetResult(val OptInt)

SetResult sets the value of Result.

func (*MobileThreadLastInfo) SetThread

SetThread sets the value of Thread.

func (*MobileThreadLastInfo) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MobileThreadLastInfo) Validate

func (s *MobileThreadLastInfo) Validate() error

type MobileThreadLastInfoThread

type MobileThreadLastInfoThread struct {
	Num       OptInt `json:"num"`
	Timestamp OptInt `json:"timestamp"`
	Posts     OptInt `json:"posts"`
}

func (*MobileThreadLastInfoThread) Decode

Decode decodes MobileThreadLastInfoThread from json.

func (*MobileThreadLastInfoThread) Encode

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

Encode implements json.Marshaler.

func (*MobileThreadLastInfoThread) GetNum

func (s *MobileThreadLastInfoThread) GetNum() OptInt

GetNum returns the value of Num.

func (*MobileThreadLastInfoThread) GetPosts

func (s *MobileThreadLastInfoThread) GetPosts() OptInt

GetPosts returns the value of Posts.

func (*MobileThreadLastInfoThread) GetTimestamp

func (s *MobileThreadLastInfoThread) GetTimestamp() OptInt

GetTimestamp returns the value of Timestamp.

func (*MobileThreadLastInfoThread) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*MobileThreadLastInfoThread) SetFake

func (s *MobileThreadLastInfoThread) SetFake()

SetFake set fake values.

func (*MobileThreadLastInfoThread) SetNum

func (s *MobileThreadLastInfoThread) SetNum(val OptInt)

SetNum sets the value of Num.

func (*MobileThreadLastInfoThread) SetPosts

func (s *MobileThreadLastInfoThread) SetPosts(val OptInt)

SetPosts sets the value of Posts.

func (*MobileThreadLastInfoThread) SetTimestamp

func (s *MobileThreadLastInfoThread) SetTimestamp(val OptInt)

SetTimestamp sets the value of Timestamp.

func (*MobileThreadLastInfoThread) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type MobileThreadPostsAfter

type MobileThreadPostsAfter struct {
	Result        OptInt   `json:"result"`
	Error         OptError `json:"error"`
	UniquePosters OptInt   `json:"unique_posters"`
	Posts         []Post   `json:"posts"`
}

Ref: #/components/schemas/MobileThreadPostsAfter

func (*MobileThreadPostsAfter) Decode

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

Decode decodes MobileThreadPostsAfter from json.

func (*MobileThreadPostsAfter) Encode

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

Encode implements json.Marshaler.

func (*MobileThreadPostsAfter) GetError

func (s *MobileThreadPostsAfter) GetError() OptError

GetError returns the value of Error.

func (*MobileThreadPostsAfter) GetPosts

func (s *MobileThreadPostsAfter) GetPosts() []Post

GetPosts returns the value of Posts.

func (*MobileThreadPostsAfter) GetResult

func (s *MobileThreadPostsAfter) GetResult() OptInt

GetResult returns the value of Result.

func (*MobileThreadPostsAfter) GetUniquePosters

func (s *MobileThreadPostsAfter) GetUniquePosters() OptInt

GetUniquePosters returns the value of UniquePosters.

func (*MobileThreadPostsAfter) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*MobileThreadPostsAfter) SetError

func (s *MobileThreadPostsAfter) SetError(val OptError)

SetError sets the value of Error.

func (*MobileThreadPostsAfter) SetFake

func (s *MobileThreadPostsAfter) SetFake()

SetFake set fake values.

func (*MobileThreadPostsAfter) SetPosts

func (s *MobileThreadPostsAfter) SetPosts(val []Post)

SetPosts sets the value of Posts.

func (*MobileThreadPostsAfter) SetResult

func (s *MobileThreadPostsAfter) SetResult(val OptInt)

SetResult sets the value of Result.

func (*MobileThreadPostsAfter) SetUniquePosters

func (s *MobileThreadPostsAfter) SetUniquePosters(val OptInt)

SetUniquePosters sets the value of UniquePosters.

func (*MobileThreadPostsAfter) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MobileThreadPostsAfter) Validate

func (s *MobileThreadPostsAfter) Validate() error

type OptError

type OptError struct {
	Value Error
	Set   bool
}

OptError is optional Error.

func NewOptError

func NewOptError(v Error) OptError

NewOptError returns new OptError with value set to v.

func (*OptError) Decode

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

Decode decodes Error from json.

func (OptError) Encode

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

Encode encodes Error as json.

func (OptError) Get

func (o OptError) Get() (v Error, ok bool)

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

func (OptError) IsSet

func (o OptError) IsSet() bool

IsSet returns true if OptError was set.

func (OptError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptError) Or

func (o OptError) Or(d Error) Error

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

func (*OptError) Reset

func (o *OptError) Reset()

Reset unsets value.

func (*OptError) SetFake

func (s *OptError) SetFake()

SetFake set fake values.

func (*OptError) SetTo

func (o *OptError) SetTo(v Error)

SetTo sets value to v.

func (*OptError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptErrorCode

type OptErrorCode struct {
	Value ErrorCode
	Set   bool
}

OptErrorCode is optional ErrorCode.

func NewOptErrorCode

func NewOptErrorCode(v ErrorCode) OptErrorCode

NewOptErrorCode returns new OptErrorCode with value set to v.

func (*OptErrorCode) Decode

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

Decode decodes ErrorCode from json.

func (OptErrorCode) Encode

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

Encode encodes ErrorCode as json.

func (OptErrorCode) Get

func (o OptErrorCode) Get() (v ErrorCode, ok bool)

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

func (OptErrorCode) IsSet

func (o OptErrorCode) IsSet() bool

IsSet returns true if OptErrorCode was set.

func (OptErrorCode) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptErrorCode) Or

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

func (*OptErrorCode) Reset

func (o *OptErrorCode) Reset()

Reset unsets value.

func (*OptErrorCode) SetFake

func (s *OptErrorCode) SetFake()

SetFake set fake values.

func (*OptErrorCode) SetTo

func (o *OptErrorCode) SetTo(v ErrorCode)

SetTo sets value to v.

func (*OptErrorCode) UnmarshalJSON

func (s *OptErrorCode) 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 OptMobileThreadLastInfoThread

type OptMobileThreadLastInfoThread struct {
	Value MobileThreadLastInfoThread
	Set   bool
}

OptMobileThreadLastInfoThread is optional MobileThreadLastInfoThread.

func NewOptMobileThreadLastInfoThread

func NewOptMobileThreadLastInfoThread(v MobileThreadLastInfoThread) OptMobileThreadLastInfoThread

NewOptMobileThreadLastInfoThread returns new OptMobileThreadLastInfoThread with value set to v.

func (*OptMobileThreadLastInfoThread) Decode

Decode decodes MobileThreadLastInfoThread from json.

func (OptMobileThreadLastInfoThread) Encode

Encode encodes MobileThreadLastInfoThread as json.

func (OptMobileThreadLastInfoThread) Get

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

func (OptMobileThreadLastInfoThread) IsSet

IsSet returns true if OptMobileThreadLastInfoThread was set.

func (OptMobileThreadLastInfoThread) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptMobileThreadLastInfoThread) Or

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

func (*OptMobileThreadLastInfoThread) Reset

func (o *OptMobileThreadLastInfoThread) Reset()

Reset unsets value.

func (*OptMobileThreadLastInfoThread) SetFake

func (s *OptMobileThreadLastInfoThread) SetFake()

SetFake set fake values.

func (*OptMobileThreadLastInfoThread) SetTo

SetTo sets value to v.

func (*OptMobileThreadLastInfoThread) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptPasscodePasscode

type OptPasscodePasscode struct {
	Value PasscodePasscode
	Set   bool
}

OptPasscodePasscode is optional PasscodePasscode.

func NewOptPasscodePasscode

func NewOptPasscodePasscode(v PasscodePasscode) OptPasscodePasscode

NewOptPasscodePasscode returns new OptPasscodePasscode with value set to v.

func (*OptPasscodePasscode) Decode

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

Decode decodes PasscodePasscode from json.

func (OptPasscodePasscode) Encode

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

Encode encodes PasscodePasscode as json.

func (OptPasscodePasscode) Get

func (o OptPasscodePasscode) Get() (v PasscodePasscode, ok bool)

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

func (OptPasscodePasscode) IsSet

func (o OptPasscodePasscode) IsSet() bool

IsSet returns true if OptPasscodePasscode was set.

func (OptPasscodePasscode) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptPasscodePasscode) Or

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

func (*OptPasscodePasscode) Reset

func (o *OptPasscodePasscode) Reset()

Reset unsets value.

func (*OptPasscodePasscode) SetFake

func (s *OptPasscodePasscode) SetFake()

SetFake set fake values.

func (*OptPasscodePasscode) SetTo

SetTo sets value to v.

func (*OptPasscodePasscode) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptPost

type OptPost struct {
	Value Post
	Set   bool
}

OptPost is optional Post.

func NewOptPost

func NewOptPost(v Post) OptPost

NewOptPost returns new OptPost with value set to v.

func (*OptPost) Decode

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

Decode decodes Post from json.

func (OptPost) Encode

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

Encode encodes Post as json.

func (OptPost) Get

func (o OptPost) Get() (v Post, ok bool)

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

func (OptPost) IsSet

func (o OptPost) IsSet() bool

IsSet returns true if OptPost was set.

func (OptPost) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptPost) Or

func (o OptPost) Or(d Post) Post

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

func (*OptPost) Reset

func (o *OptPost) Reset()

Reset unsets value.

func (*OptPost) SetFake

func (s *OptPost) SetFake()

SetFake set fake values.

func (*OptPost) SetTo

func (o *OptPost) SetTo(v Post)

SetTo sets value to v.

func (*OptPost) UnmarshalJSON

func (s *OptPost) 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 OptUserPassloginPostReq

type OptUserPassloginPostReq struct {
	Value UserPassloginPostReq
	Set   bool
}

OptUserPassloginPostReq is optional UserPassloginPostReq.

func NewOptUserPassloginPostReq

func NewOptUserPassloginPostReq(v UserPassloginPostReq) OptUserPassloginPostReq

NewOptUserPassloginPostReq returns new OptUserPassloginPostReq with value set to v.

func (OptUserPassloginPostReq) Get

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

func (OptUserPassloginPostReq) IsSet

func (o OptUserPassloginPostReq) IsSet() bool

IsSet returns true if OptUserPassloginPostReq was set.

func (OptUserPassloginPostReq) Or

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

func (*OptUserPassloginPostReq) Reset

func (o *OptUserPassloginPostReq) Reset()

Reset unsets value.

func (*OptUserPassloginPostReq) SetTo

SetTo sets value to v.

type OptUserPostingPostReq

type OptUserPostingPostReq struct {
	Value UserPostingPostReq
	Set   bool
}

OptUserPostingPostReq is optional UserPostingPostReq.

func NewOptUserPostingPostReq

func NewOptUserPostingPostReq(v UserPostingPostReq) OptUserPostingPostReq

NewOptUserPostingPostReq returns new OptUserPostingPostReq with value set to v.

func (OptUserPostingPostReq) Get

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

func (OptUserPostingPostReq) IsSet

func (o OptUserPostingPostReq) IsSet() bool

IsSet returns true if OptUserPostingPostReq was set.

func (OptUserPostingPostReq) Or

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

func (*OptUserPostingPostReq) Reset

func (o *OptUserPostingPostReq) Reset()

Reset unsets value.

func (*OptUserPostingPostReq) SetTo

SetTo sets value to v.

type OptUserReportPostReq

type OptUserReportPostReq struct {
	Value UserReportPostReq
	Set   bool
}

OptUserReportPostReq is optional UserReportPostReq.

func NewOptUserReportPostReq

func NewOptUserReportPostReq(v UserReportPostReq) OptUserReportPostReq

NewOptUserReportPostReq returns new OptUserReportPostReq with value set to v.

func (OptUserReportPostReq) Get

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

func (OptUserReportPostReq) IsSet

func (o OptUserReportPostReq) IsSet() bool

IsSet returns true if OptUserReportPostReq was set.

func (OptUserReportPostReq) Or

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

func (*OptUserReportPostReq) Reset

func (o *OptUserReportPostReq) Reset()

Reset unsets value.

func (*OptUserReportPostReq) SetTo

SetTo sets value to v.

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 Passcode

type Passcode struct {
	Result   OptInt              `json:"result"`
	Error    OptError            `json:"error"`
	Passcode OptPasscodePasscode `json:"passcode"`
}

Ref: #/components/schemas/Passcode

func (*Passcode) Decode

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

Decode decodes Passcode from json.

func (*Passcode) Encode

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

Encode implements json.Marshaler.

func (*Passcode) GetError

func (s *Passcode) GetError() OptError

GetError returns the value of Error.

func (*Passcode) GetPasscode

func (s *Passcode) GetPasscode() OptPasscodePasscode

GetPasscode returns the value of Passcode.

func (*Passcode) GetResult

func (s *Passcode) GetResult() OptInt

GetResult returns the value of Result.

func (*Passcode) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Passcode) SetError

func (s *Passcode) SetError(val OptError)

SetError sets the value of Error.

func (*Passcode) SetFake

func (s *Passcode) SetFake()

SetFake set fake values.

func (*Passcode) SetPasscode

func (s *Passcode) SetPasscode(val OptPasscodePasscode)

SetPasscode sets the value of Passcode.

func (*Passcode) SetResult

func (s *Passcode) SetResult(val OptInt)

SetResult sets the value of Result.

func (*Passcode) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Passcode) Validate

func (s *Passcode) Validate() error

type PasscodePasscode

type PasscodePasscode struct {
	Type    OptString `json:"type"`
	Expires OptInt    `json:"expires"`
}

func (*PasscodePasscode) Decode

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

Decode decodes PasscodePasscode from json.

func (*PasscodePasscode) Encode

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

Encode implements json.Marshaler.

func (*PasscodePasscode) GetExpires

func (s *PasscodePasscode) GetExpires() OptInt

GetExpires returns the value of Expires.

func (*PasscodePasscode) GetType

func (s *PasscodePasscode) GetType() OptString

GetType returns the value of Type.

func (*PasscodePasscode) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PasscodePasscode) SetExpires

func (s *PasscodePasscode) SetExpires(val OptInt)

SetExpires sets the value of Expires.

func (*PasscodePasscode) SetFake

func (s *PasscodePasscode) SetFake()

SetFake set fake values.

func (*PasscodePasscode) SetType

func (s *PasscodePasscode) SetType(val OptString)

SetType sets the value of Type.

func (*PasscodePasscode) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Post

type Post struct {
	Num       int       `json:"num"`
	Parent    int       `json:"parent"`
	Board     string    `json:"board"`
	Timestamp int       `json:"timestamp"`
	Lasthit   int       `json:"lasthit"`
	Date      string    `json:"date"`
	Email     OptString `json:"email"`
	Subject   OptString `json:"subject"`
	Comment   string    `json:"comment"`
	Files     []File    `json:"files"`
	Views     int       `json:"views"`
	Sticky    int       `json:"sticky"`
	Endless   int       `json:"endless"`
	Closed    int       `json:"closed"`
	Banned    int       `json:"banned"`
	Op        int       `json:"op"`
	Name      OptString `json:"name"`
	Icon      OptString `json:"icon"`
	Trip      OptString `json:"trip"`
	TripStyle OptString `json:"trip_style"`
	Tags      OptString `json:"tags"`
	Likes     OptInt    `json:"likes"`
	Dislikes  OptInt    `json:"dislikes"`
}

Модель поста. Ref: #/components/schemas/Post

func (*Post) Decode

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

Decode decodes Post from json.

func (*Post) Encode

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

Encode implements json.Marshaler.

func (*Post) GetBanned

func (s *Post) GetBanned() int

GetBanned returns the value of Banned.

func (*Post) GetBoard

func (s *Post) GetBoard() string

GetBoard returns the value of Board.

func (*Post) GetClosed

func (s *Post) GetClosed() int

GetClosed returns the value of Closed.

func (*Post) GetComment

func (s *Post) GetComment() string

GetComment returns the value of Comment.

func (*Post) GetDate

func (s *Post) GetDate() string

GetDate returns the value of Date.

func (*Post) GetDislikes

func (s *Post) GetDislikes() OptInt

GetDislikes returns the value of Dislikes.

func (*Post) GetEmail

func (s *Post) GetEmail() OptString

GetEmail returns the value of Email.

func (*Post) GetEndless

func (s *Post) GetEndless() int

GetEndless returns the value of Endless.

func (*Post) GetFiles

func (s *Post) GetFiles() []File

GetFiles returns the value of Files.

func (*Post) GetIcon

func (s *Post) GetIcon() OptString

GetIcon returns the value of Icon.

func (*Post) GetLasthit

func (s *Post) GetLasthit() int

GetLasthit returns the value of Lasthit.

func (*Post) GetLikes

func (s *Post) GetLikes() OptInt

GetLikes returns the value of Likes.

func (*Post) GetName

func (s *Post) GetName() OptString

GetName returns the value of Name.

func (*Post) GetNum

func (s *Post) GetNum() int

GetNum returns the value of Num.

func (*Post) GetOp

func (s *Post) GetOp() int

GetOp returns the value of Op.

func (*Post) GetParent

func (s *Post) GetParent() int

GetParent returns the value of Parent.

func (*Post) GetSticky

func (s *Post) GetSticky() int

GetSticky returns the value of Sticky.

func (*Post) GetSubject

func (s *Post) GetSubject() OptString

GetSubject returns the value of Subject.

func (*Post) GetTags

func (s *Post) GetTags() OptString

GetTags returns the value of Tags.

func (*Post) GetTimestamp

func (s *Post) GetTimestamp() int

GetTimestamp returns the value of Timestamp.

func (*Post) GetTrip

func (s *Post) GetTrip() OptString

GetTrip returns the value of Trip.

func (*Post) GetTripStyle

func (s *Post) GetTripStyle() OptString

GetTripStyle returns the value of TripStyle.

func (*Post) GetViews

func (s *Post) GetViews() int

GetViews returns the value of Views.

func (*Post) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Post) SetBanned

func (s *Post) SetBanned(val int)

SetBanned sets the value of Banned.

func (*Post) SetBoard

func (s *Post) SetBoard(val string)

SetBoard sets the value of Board.

func (*Post) SetClosed

func (s *Post) SetClosed(val int)

SetClosed sets the value of Closed.

func (*Post) SetComment

func (s *Post) SetComment(val string)

SetComment sets the value of Comment.

func (*Post) SetDate

func (s *Post) SetDate(val string)

SetDate sets the value of Date.

func (*Post) SetDislikes

func (s *Post) SetDislikes(val OptInt)

SetDislikes sets the value of Dislikes.

func (*Post) SetEmail

func (s *Post) SetEmail(val OptString)

SetEmail sets the value of Email.

func (*Post) SetEndless

func (s *Post) SetEndless(val int)

SetEndless sets the value of Endless.

func (*Post) SetFake

func (s *Post) SetFake()

SetFake set fake values.

func (*Post) SetFiles

func (s *Post) SetFiles(val []File)

SetFiles sets the value of Files.

func (*Post) SetIcon

func (s *Post) SetIcon(val OptString)

SetIcon sets the value of Icon.

func (*Post) SetLasthit

func (s *Post) SetLasthit(val int)

SetLasthit sets the value of Lasthit.

func (*Post) SetLikes

func (s *Post) SetLikes(val OptInt)

SetLikes sets the value of Likes.

func (*Post) SetName

func (s *Post) SetName(val OptString)

SetName sets the value of Name.

func (*Post) SetNum

func (s *Post) SetNum(val int)

SetNum sets the value of Num.

func (*Post) SetOp

func (s *Post) SetOp(val int)

SetOp sets the value of Op.

func (*Post) SetParent

func (s *Post) SetParent(val int)

SetParent sets the value of Parent.

func (*Post) SetSticky

func (s *Post) SetSticky(val int)

SetSticky sets the value of Sticky.

func (*Post) SetSubject

func (s *Post) SetSubject(val OptString)

SetSubject sets the value of Subject.

func (*Post) SetTags

func (s *Post) SetTags(val OptString)

SetTags sets the value of Tags.

func (*Post) SetTimestamp

func (s *Post) SetTimestamp(val int)

SetTimestamp sets the value of Timestamp.

func (*Post) SetTrip

func (s *Post) SetTrip(val OptString)

SetTrip sets the value of Trip.

func (*Post) SetTripStyle

func (s *Post) SetTripStyle(val OptString)

SetTripStyle sets the value of TripStyle.

func (*Post) SetViews

func (s *Post) SetViews(val int)

SetViews sets the value of Views.

func (*Post) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Post) Validate

func (s *Post) Validate() error

type PostingNewPost

type PostingNewPost struct {
	Result OptInt   `json:"result"`
	Error  OptError `json:"error"`
	// Номер нового поста.
	Num OptInt `json:"num"`
}

Ref: #/components/schemas/PostingNewPost

func (*PostingNewPost) Decode

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

Decode decodes PostingNewPost from json.

func (*PostingNewPost) Encode

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

Encode implements json.Marshaler.

func (*PostingNewPost) GetError

func (s *PostingNewPost) GetError() OptError

GetError returns the value of Error.

func (*PostingNewPost) GetNum

func (s *PostingNewPost) GetNum() OptInt

GetNum returns the value of Num.

func (*PostingNewPost) GetResult

func (s *PostingNewPost) GetResult() OptInt

GetResult returns the value of Result.

func (*PostingNewPost) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PostingNewPost) SetError

func (s *PostingNewPost) SetError(val OptError)

SetError sets the value of Error.

func (*PostingNewPost) SetFake

func (s *PostingNewPost) SetFake()

SetFake set fake values.

func (*PostingNewPost) SetNum

func (s *PostingNewPost) SetNum(val OptInt)

SetNum sets the value of Num.

func (*PostingNewPost) SetResult

func (s *PostingNewPost) SetResult(val OptInt)

SetResult sets the value of Result.

func (*PostingNewPost) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PostingNewPost) Validate

func (s *PostingNewPost) Validate() error

type PostingNewThread

type PostingNewThread struct {
	Result OptInt   `json:"result"`
	Error  OptError `json:"error"`
	// Номер нового треда.
	Thread OptInt `json:"thread"`
}

Ref: #/components/schemas/PostingNewThread

func (*PostingNewThread) Decode

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

Decode decodes PostingNewThread from json.

func (*PostingNewThread) Encode

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

Encode implements json.Marshaler.

func (*PostingNewThread) GetError

func (s *PostingNewThread) GetError() OptError

GetError returns the value of Error.

func (*PostingNewThread) GetResult

func (s *PostingNewThread) GetResult() OptInt

GetResult returns the value of Result.

func (*PostingNewThread) GetThread

func (s *PostingNewThread) GetThread() OptInt

GetThread returns the value of Thread.

func (*PostingNewThread) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PostingNewThread) SetError

func (s *PostingNewThread) SetError(val OptError)

SetError sets the value of Error.

func (*PostingNewThread) SetFake

func (s *PostingNewThread) SetFake()

SetFake set fake values.

func (*PostingNewThread) SetResult

func (s *PostingNewThread) SetResult(val OptInt)

SetResult sets the value of Result.

func (*PostingNewThread) SetThread

func (s *PostingNewThread) SetThread(val OptInt)

SetThread sets the value of Thread.

func (*PostingNewThread) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PostingNewThread) Validate

func (s *PostingNewThread) Validate() error

type Report

type Report struct {
	Result OptInt   `json:"result"`
	Error  OptError `json:"error"`
}

Ref: #/components/schemas/Report

func (*Report) Decode

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

Decode decodes Report from json.

func (*Report) Encode

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

Encode implements json.Marshaler.

func (*Report) GetError

func (s *Report) GetError() OptError

GetError returns the value of Error.

func (*Report) GetResult

func (s *Report) GetResult() OptInt

GetResult returns the value of Result.

func (*Report) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Report) SetError

func (s *Report) SetError(val OptError)

SetError sets the value of Error.

func (*Report) SetFake

func (s *Report) SetFake()

SetFake set fake values.

func (*Report) SetResult

func (s *Report) SetResult(val OptInt)

SetResult sets the value of Result.

func (*Report) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Report) Validate

func (s *Report) 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) 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 (*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) APICaptcha2chcaptchaIDGet

func (UnimplementedHandler) APICaptcha2chcaptchaIDGet(ctx context.Context, params APICaptcha2chcaptchaIDGetParams) (r *Captcha, _ error)

APICaptcha2chcaptchaIDGet implements GET /api/captcha/2chcaptcha/id operation.

Получение ид для использования 2chcaptcha.

GET /api/captcha/2chcaptcha/id

func (UnimplementedHandler) APICaptcha2chcaptchaShowGet

APICaptcha2chcaptchaShowGet implements GET /api/captcha/2chcaptcha/show operation.

Отображение 2chcaptcha по id.

GET /api/captcha/2chcaptcha/show

func (UnimplementedHandler) APICaptchaAppIDPublicKeyGet

func (UnimplementedHandler) APICaptchaAppIDPublicKeyGet(ctx context.Context, params APICaptchaAppIDPublicKeyGetParams) (r *Captcha, _ error)

APICaptchaAppIDPublicKeyGet implements GET /api/captcha/app/id/{public_key} operation.

Полученный id вам нужно отправить вместе с постом как app_response_id. При этом нужно отправить app_response = sha256(app_response_id + '|' + private key). Срок жизни id: 180 секунд.

GET /api/captcha/app/id/{public_key}

func (UnimplementedHandler) APICaptchaInvisibleRecaptchaIDGet

func (UnimplementedHandler) APICaptchaInvisibleRecaptchaIDGet(ctx context.Context, params APICaptchaInvisibleRecaptchaIDGetParams) (r *Captcha, _ error)

APICaptchaInvisibleRecaptchaIDGet implements GET /api/captcha/invisible_recaptcha/id operation.

Получение публичного ключа invisible recaptcha.

GET /api/captcha/invisible_recaptcha/id

func (UnimplementedHandler) APICaptchaInvisibleRecaptchaMobileGet

func (UnimplementedHandler) APICaptchaInvisibleRecaptchaMobileGet(ctx context.Context) error

APICaptchaInvisibleRecaptchaMobileGet implements GET /api/captcha/invisible_recaptcha/mobile operation.

Получение html страницы для решения капчи, CORS отключён.

GET /api/captcha/invisible_recaptcha/mobile

func (UnimplementedHandler) APICaptchaRecaptchaIDGet

func (UnimplementedHandler) APICaptchaRecaptchaIDGet(ctx context.Context, params APICaptchaRecaptchaIDGetParams) (r *Captcha, _ error)

APICaptchaRecaptchaIDGet implements GET /api/captcha/recaptcha/id operation.

Получение публичного ключа recaptcha v2.

GET /api/captcha/recaptcha/id

func (UnimplementedHandler) APICaptchaRecaptchaMobileGet

func (UnimplementedHandler) APICaptchaRecaptchaMobileGet(ctx context.Context) error

APICaptchaRecaptchaMobileGet implements GET /api/captcha/recaptcha/mobile operation.

Получение html страницы для решения капчи, CORS отключён.

GET /api/captcha/recaptcha/mobile

func (UnimplementedHandler) APIDislikeGet

func (UnimplementedHandler) APIDislikeGet(ctx context.Context, params APIDislikeGetParams) (r *Like, _ error)

APIDislikeGet implements GET /api/dislike operation.

Добавление дизлайка на пост.

GET /api/dislike

func (UnimplementedHandler) APILikeGet

func (UnimplementedHandler) APILikeGet(ctx context.Context, params APILikeGetParams) (r *Like, _ error)

APILikeGet implements GET /api/like operation.

Добавление лайка на пост.

GET /api/like

func (UnimplementedHandler) APIMobileV2AfterBoardThreadNumGet

func (UnimplementedHandler) APIMobileV2AfterBoardThreadNumGet(ctx context.Context, params APIMobileV2AfterBoardThreadNumGetParams) (r *MobileThreadPostsAfter, _ error)

APIMobileV2AfterBoardThreadNumGet implements GET /api/mobile/v2/after/{board}/{thread}/{num} operation.

Получение постов в треде >= указанного. Не рекомендуется использовать для получения треда целиком, только для проверки новых постов.

GET /api/mobile/v2/after/{board}/{thread}/{num}

func (UnimplementedHandler) APIMobileV2BoardsGet

func (UnimplementedHandler) APIMobileV2BoardsGet(ctx context.Context) (r Boards, _ error)

APIMobileV2BoardsGet implements GET /api/mobile/v2/boards operation.

Получение списка досок и их настроек.

GET /api/mobile/v2/boards

func (UnimplementedHandler) APIMobileV2InfoBoardThreadGet

func (UnimplementedHandler) APIMobileV2InfoBoardThreadGet(ctx context.Context, params APIMobileV2InfoBoardThreadGetParams) (r *MobileThreadLastInfo, _ error)

APIMobileV2InfoBoardThreadGet implements GET /api/mobile/v2/info/{board}/{thread} operation.

Получение информации о треде.

GET /api/mobile/v2/info/{board}/{thread}

func (UnimplementedHandler) APIMobileV2PostBoardNumGet

func (UnimplementedHandler) APIMobileV2PostBoardNumGet(ctx context.Context, params APIMobileV2PostBoardNumGetParams) (r *MobilePost, _ error)

APIMobileV2PostBoardNumGet implements GET /api/mobile/v2/post/{board}/{num} operation.

Получение информации о посте.

GET /api/mobile/v2/post/{board}/{num}

func (UnimplementedHandler) UserPassloginPost

UserPassloginPost implements POST /user/passlogin operation.

Авторизация пасскода.

POST /user/passlogin

func (UnimplementedHandler) UserPostingPost

UserPostingPost implements POST /user/posting operation.

Создание нового поста или треда.

POST /user/posting

func (UnimplementedHandler) UserReportPost

func (UnimplementedHandler) UserReportPost(ctx context.Context, req OptUserReportPostReq) (r *Report, _ error)

UserReportPost implements POST /user/report operation.

Отправка жалобы.

POST /user/report

type UserPassloginPostParams

type UserPassloginPostParams struct {
	// Параметр, указывающий что запрос выполняется не
	// пользователем и ответ нужен в формате json.
	JSON int
}

UserPassloginPostParams is parameters of POST /user/passlogin operation.

type UserPassloginPostReq

type UserPassloginPostReq struct {
	Passcode string `json:"passcode"`
}

func (*UserPassloginPostReq) GetPasscode

func (s *UserPassloginPostReq) GetPasscode() string

GetPasscode returns the value of Passcode.

func (*UserPassloginPostReq) SetPasscode

func (s *UserPassloginPostReq) SetPasscode(val string)

SetPasscode sets the value of Passcode.

type UserPostingPostOK

type UserPostingPostOK struct {
	Type             UserPostingPostOKType // switch on this field
	PostingNewThread PostingNewThread
	PostingNewPost   PostingNewPost
}

UserPostingPostOK represents sum type.

func NewPostingNewPostUserPostingPostOK

func NewPostingNewPostUserPostingPostOK(v PostingNewPost) UserPostingPostOK

NewPostingNewPostUserPostingPostOK returns new UserPostingPostOK from PostingNewPost.

func NewPostingNewThreadUserPostingPostOK

func NewPostingNewThreadUserPostingPostOK(v PostingNewThread) UserPostingPostOK

NewPostingNewThreadUserPostingPostOK returns new UserPostingPostOK from PostingNewThread.

func (*UserPostingPostOK) Decode

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

Decode decodes UserPostingPostOK from json.

func (UserPostingPostOK) Encode

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

Encode encodes UserPostingPostOK as json.

func (UserPostingPostOK) GetPostingNewPost

func (s UserPostingPostOK) GetPostingNewPost() (v PostingNewPost, ok bool)

GetPostingNewPost returns PostingNewPost and true boolean if UserPostingPostOK is PostingNewPost.

func (UserPostingPostOK) GetPostingNewThread

func (s UserPostingPostOK) GetPostingNewThread() (v PostingNewThread, ok bool)

GetPostingNewThread returns PostingNewThread and true boolean if UserPostingPostOK is PostingNewThread.

func (UserPostingPostOK) IsPostingNewPost

func (s UserPostingPostOK) IsPostingNewPost() bool

IsPostingNewPost reports whether UserPostingPostOK is PostingNewPost.

func (UserPostingPostOK) IsPostingNewThread

func (s UserPostingPostOK) IsPostingNewThread() bool

IsPostingNewThread reports whether UserPostingPostOK is PostingNewThread.

func (UserPostingPostOK) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UserPostingPostOK) SetFake

func (s *UserPostingPostOK) SetFake()

SetFake set fake values.

func (*UserPostingPostOK) SetPostingNewPost

func (s *UserPostingPostOK) SetPostingNewPost(v PostingNewPost)

SetPostingNewPost sets UserPostingPostOK to PostingNewPost.

func (*UserPostingPostOK) SetPostingNewThread

func (s *UserPostingPostOK) SetPostingNewThread(v PostingNewThread)

SetPostingNewThread sets UserPostingPostOK to PostingNewThread.

func (*UserPostingPostOK) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (UserPostingPostOK) Validate

func (s UserPostingPostOK) Validate() error

type UserPostingPostOKType

type UserPostingPostOKType string

UserPostingPostOKType is oneOf type of UserPostingPostOK.

const (
	PostingNewThreadUserPostingPostOK UserPostingPostOKType = "PostingNewThread"
	PostingNewPostUserPostingPostOK   UserPostingPostOKType = "PostingNewPost"
)

Possible values for UserPostingPostOKType.

type UserPostingPostReq

type UserPostingPostReq struct {
	CaptchaType CaptchaType `json:"captcha_type"`
	Board       string      `json:"board"`
	// Если не указано, будет создан тред.
	Thread OptInt `json:"thread"`
	// Если не включено в настройках доски - поле будет
	// проигнорировано.
	Name OptString `json:"name"`
	// Если не включено в настройках доски - поле будет
	// проигнорировано.
	Email OptString `json:"email"`
	// Если не включено в настройках доски - поле будет
	// проигнорировано.
	Tags OptString `json:"tags"`
	// Если не включено в настройках доски - поле будет
	// проигнорировано.
	Subject OptString `json:"subject"`
	Comment OptString `json:"comment"`
	Icon    OptInt    `json:"icon"`
	// Если не включено в настройках доски - поле будет
	// проигнорировано.
	OpMark OptInt             `json:"op_mark"`
	File   []ht.MultipartFile `json:"file[]"`
}

func (*UserPostingPostReq) GetBoard

func (s *UserPostingPostReq) GetBoard() string

GetBoard returns the value of Board.

func (*UserPostingPostReq) GetCaptchaType

func (s *UserPostingPostReq) GetCaptchaType() CaptchaType

GetCaptchaType returns the value of CaptchaType.

func (*UserPostingPostReq) GetComment

func (s *UserPostingPostReq) GetComment() OptString

GetComment returns the value of Comment.

func (*UserPostingPostReq) GetEmail

func (s *UserPostingPostReq) GetEmail() OptString

GetEmail returns the value of Email.

func (*UserPostingPostReq) GetFile

func (s *UserPostingPostReq) GetFile() []ht.MultipartFile

GetFile returns the value of File.

func (*UserPostingPostReq) GetIcon

func (s *UserPostingPostReq) GetIcon() OptInt

GetIcon returns the value of Icon.

func (*UserPostingPostReq) GetName

func (s *UserPostingPostReq) GetName() OptString

GetName returns the value of Name.

func (*UserPostingPostReq) GetOpMark

func (s *UserPostingPostReq) GetOpMark() OptInt

GetOpMark returns the value of OpMark.

func (*UserPostingPostReq) GetSubject

func (s *UserPostingPostReq) GetSubject() OptString

GetSubject returns the value of Subject.

func (*UserPostingPostReq) GetTags

func (s *UserPostingPostReq) GetTags() OptString

GetTags returns the value of Tags.

func (*UserPostingPostReq) GetThread

func (s *UserPostingPostReq) GetThread() OptInt

GetThread returns the value of Thread.

func (*UserPostingPostReq) SetBoard

func (s *UserPostingPostReq) SetBoard(val string)

SetBoard sets the value of Board.

func (*UserPostingPostReq) SetCaptchaType

func (s *UserPostingPostReq) SetCaptchaType(val CaptchaType)

SetCaptchaType sets the value of CaptchaType.

func (*UserPostingPostReq) SetComment

func (s *UserPostingPostReq) SetComment(val OptString)

SetComment sets the value of Comment.

func (*UserPostingPostReq) SetEmail

func (s *UserPostingPostReq) SetEmail(val OptString)

SetEmail sets the value of Email.

func (*UserPostingPostReq) SetFile

func (s *UserPostingPostReq) SetFile(val []ht.MultipartFile)

SetFile sets the value of File.

func (*UserPostingPostReq) SetIcon

func (s *UserPostingPostReq) SetIcon(val OptInt)

SetIcon sets the value of Icon.

func (*UserPostingPostReq) SetName

func (s *UserPostingPostReq) SetName(val OptString)

SetName sets the value of Name.

func (*UserPostingPostReq) SetOpMark

func (s *UserPostingPostReq) SetOpMark(val OptInt)

SetOpMark sets the value of OpMark.

func (*UserPostingPostReq) SetSubject

func (s *UserPostingPostReq) SetSubject(val OptString)

SetSubject sets the value of Subject.

func (*UserPostingPostReq) SetTags

func (s *UserPostingPostReq) SetTags(val OptString)

SetTags sets the value of Tags.

func (*UserPostingPostReq) SetThread

func (s *UserPostingPostReq) SetThread(val OptInt)

SetThread sets the value of Thread.

func (*UserPostingPostReq) Validate

func (s *UserPostingPostReq) Validate() error

type UserReportPostReq

type UserReportPostReq struct {
	Board   string `json:"board"`
	Thread  int    `json:"thread"`
	Post    []int  `json:"post"`
	Comment string `json:"comment"`
}

func (*UserReportPostReq) GetBoard

func (s *UserReportPostReq) GetBoard() string

GetBoard returns the value of Board.

func (*UserReportPostReq) GetComment

func (s *UserReportPostReq) GetComment() string

GetComment returns the value of Comment.

func (*UserReportPostReq) GetPost

func (s *UserReportPostReq) GetPost() []int

GetPost returns the value of Post.

func (*UserReportPostReq) GetThread

func (s *UserReportPostReq) GetThread() int

GetThread returns the value of Thread.

func (*UserReportPostReq) SetBoard

func (s *UserReportPostReq) SetBoard(val string)

SetBoard sets the value of Board.

func (*UserReportPostReq) SetComment

func (s *UserReportPostReq) SetComment(val string)

SetComment sets the value of Comment.

func (*UserReportPostReq) SetPost

func (s *UserReportPostReq) SetPost(val []int)

SetPost sets the value of Post.

func (*UserReportPostReq) SetThread

func (s *UserReportPostReq) SetThread(val int)

SetThread sets the value of Thread.

Jump to

Keyboard shortcuts

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