webapi

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWebBase = protocol.WebAPIBase
)

Variables

View Source
var ErrMalformedResponse = protocol.ErrMalformedResponse

ErrMalformedResponse 标识成功 HTTP 响应无法构成约定 JSON,不包含原始响应体。

View Source
var ErrUnrepresentablePagination = errors.New("web api pagination cannot represent cursor offset")

ErrUnrepresentablePagination 标识 cursor offset 无法安全换算为 Web 页码和下一页边界。

Functions

This section is empty.

Types

type APIError

type APIError = protocol.Failure

type Client

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

func New

func New(opts ...Option) *Client

func (*Client) IllustDetail

func (c *Client) IllustDetail(ctx context.Context, id int64) (*model.IllustDetail, error)

func (*Client) IllustPages

func (c *Client) IllustPages(ctx context.Context, id int64) ([]model.MetaPage, error)

func (*Client) IllustRanking

func (c *Client) IllustRanking(ctx context.Context, mode, date string, offset int) (*model.IllustList, error)

func (*Client) SearchIllust

func (c *Client) SearchIllust(ctx context.Context, word, target, sort, duration string, offset int, filterOptions ...model.SearchIllustFilters) (*model.IllustList, error)

func (*Client) SearchUser

func (c *Client) SearchUser(ctx context.Context, word string, offset int) (*model.UserPreviewList, error)

func (*Client) UgoiraMetadata

func (c *Client) UgoiraMetadata(ctx context.Context, id int64) (*model.UgoiraMetadataResult, error)

type EnvelopeError

type EnvelopeError = protocol.Failure

EnvelopeError 保留内部兼容名称;message 不得越过 Web adapter。

type IllustPagesError

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

IllustPagesError 保留匿名详情流程中 pages 子阶段,供 facade 精确标注 operation。

func (*IllustPagesError) Error

func (e *IllustPagesError) Error() string

func (*IllustPagesError) Unwrap

func (e *IllustPagesError) Unwrap() error

type Option

type Option func(*Client)

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

func WithWebBase

func WithWebBase(base string) Option

Jump to

Keyboard shortcuts

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