api

package
v0.0.0-...-ebdd93a Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 35 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingAppHeader = errors.New("missing " + appRequestHeader + " request header")

ErrMissingAppHeader is returned when a state-changing request lacks the SPA's appRequestHeader — a likely cross-origin/CSRF attempt. It's a sentinel (like pixiv.ErrNotAuthenticated): registered in sentinelErrors so classify maps it to 403 and the frontend localizes it by code (error_forbidden).

Functions

func GetSpec

func GetSpec() (swagger *openapi3.T, err error)

GetSpec returns the OpenAPI specification corresponding to the generated code in this file. External references in the spec are resolved through PathToRawSpec; externally-referenced files must be embedded in their corresponding Go packages (via the import-mapping feature). URL-based external refs are not supported.

func GetSpecJSON

func GetSpecJSON() ([]byte, error)

GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI specification: decompressed but not unmarshaled. External references are not resolved here; the bytes are the spec exactly as embedded by codegen. The result is cached at package init time, so repeated calls are cheap.

func GetSwagger deprecated

func GetSwagger() (*openapi3.T, error)

GetSwagger returns the OpenAPI specification corresponding to the generated code in this file.

Deprecated: GetSwagger predates kin-openapi renaming openapi3.Swagger to openapi3.T. Use GetSpec instead. This wrapper is retained for backwards compatibility.

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func WriteError

func WriteError(w http.ResponseWriter, r *http.Request, err error)

WriteError classifies err into a wire-safe Error body and writes it. The full Go error always flows into the request's httplog entry (so operators see it in logs) but never into the JSON body: classify only emits compile-time constants or strings authored via UserError, so internal Go text and upstream response bodies cannot leak to the client through this path.

Types

type APIHandler

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

func NewHandler

func NewHandler(svc *pixiv.Service, hub *inbox.Hub, dl *download.Manager, pkce *auth.Store, heartbeat *atomic.Int64, searchSamplePages *atomic.Int64, searchSampleConcurrency *atomic.Int64, cfgMgr *config.Manager, restart func(), upd *update.Service, img *imgcache.Proxy, version string) *APIHandler

func (*APIHandler) AddBookmark

func (h *APIHandler) AddBookmark(w http.ResponseWriter, r *http.Request, id IllustIdPath)

func (*APIHandler) AddFollow

func (h *APIHandler) AddFollow(w http.ResponseWriter, r *http.Request, id UserIdPath)

func (*APIHandler) ApplyUpdate

func (h *APIHandler) ApplyUpdate(w http.ResponseWriter, r *http.Request)

ApplyUpdate downloads, verifies, and applies the latest release, then triggers a graceful self-restart — mirroring RestartConfig: the 202 is flushed before the restart fires so the client sees it before its connection drops. It requires the app's CSRF header (requireAppRequest) because it replaces the binary, and Apply itself rejects a concurrent run (409). Other failures are categorized by updateFailure: authored refusals (dev build, no asset, checksum mismatch, already up-to-date) surface as a 400 with the message; feed/download failures as a 502; local apply failures as a 500.

func (*APIHandler) CancelDownload

func (h *APIHandler) CancelDownload(w http.ResponseWriter, r *http.Request, id DownloadIdPath)

func (*APIHandler) CheckConnectivity

func (h *APIHandler) CheckConnectivity(w http.ResponseWriter, r *http.Request)

CheckConnectivity probes whether Pixiv is reachable over the backend's current network path, optionally testing a candidate proxy. It is deliberately unauthenticated: the login onboarding calls it before sign-in so a user on a restricted network can discover — and fix, via a proxy — a dead connection before wrestling with the OAuth popup.

reachable=false is a normal 200 result (the answer to the question), not an error. When a supplied proxy works AND there's no Pixiv session yet, the proxy is persisted so the imminent OAuth login uses it. That write is bounded to the pre-login window: once authenticated, proxy changes belong on the (auth-gated) Settings page, so we skip persisting here.

func (*APIHandler) CheckForUpdate

func (h *APIHandler) CheckForUpdate(w http.ResponseWriter, r *http.Request)

CheckForUpdate forces a fresh check against the release feed and returns the result. Categorized failures are mapped by updateFailure: a refusal (e.g. no applicable release, or a feed that fails signature verification) is a 400, a feed reachability failure is a 502. The cached status (with last_error set) is also updated so a subsequent GET reflects it.

func (*APIHandler) ClearDownloads

func (h *APIHandler) ClearDownloads(w http.ResponseWriter, r *http.Request, params ClearDownloadsParams)

func (*APIHandler) DeleteBookmark

func (h *APIHandler) DeleteBookmark(w http.ResponseWriter, r *http.Request, id IllustIdPath)

func (*APIHandler) DeleteFollow

func (h *APIHandler) DeleteFollow(w http.ResponseWriter, r *http.Request, id UserIdPath)

func (*APIHandler) DetectProxies

func (h *APIHandler) DetectProxies(w http.ResponseWriter, r *http.Request)

DetectProxies reports the proxy candidates discovered from the operating system — the GUI system proxy (macOS scutil / Windows registry) plus the HTTP(S)_PROXY / ALL_PROXY env vars — ordered system-first. Login onboarding calls it after a direct connectivity probe fails, so it can offer and auto-test a system proxy the user enabled without TUN mode (which env vars never expose) instead of making them type it. This reads local config only: no network I/O and nothing persisted — testing/persisting a candidate is the job of CheckConnectivity. Unauthenticated, matching CheckConnectivity, since it's part of the pre-login flow.

func (*APIHandler) ExchangeOAuth

func (h *APIHandler) ExchangeOAuth(w http.ResponseWriter, r *http.Request)

ExchangeOAuth completes the OAuth flow: it pulls the verifier the server stored under `state`, asks Pixiv to trade the authorisation code for tokens, and persists the result through the same path as plain refresh-token login. `code` may be either the bare code or the full callback URL the user pasted from the popup's address bar.

func (*APIHandler) GetAuthStatus

func (h *APIHandler) GetAuthStatus(w http.ResponseWriter, r *http.Request)

func (*APIHandler) GetBookmarkDetail

func (h *APIHandler) GetBookmarkDetail(w http.ResponseWriter, r *http.Request, id IllustIdPath)

func (*APIHandler) GetConfig

func (h *APIHandler) GetConfig(w http.ResponseWriter, r *http.Request)

GetConfig returns the current effective config, the persisted overrides, and the per-key source labels. Sensitive fields are masked in both views.

func (*APIHandler) GetConfigSchema

func (h *APIHandler) GetConfigSchema(w http.ResponseWriter, r *http.Request)

GetConfigSchema returns the reflected JSON Schema. The body is passed through as-is; the openapi spec types it as a free-form object.

func (*APIHandler) GetDownload

func (h *APIHandler) GetDownload(w http.ResponseWriter, r *http.Request, id DownloadIdPath)

func (*APIHandler) GetEvents

func (h *APIHandler) GetEvents(w http.ResponseWriter, r *http.Request, _ GetEventsParams)

GetEvents opens an SSE subscription. The `topics` query parameter is parsed inside inbox.ServeSSE (comma-separated, empty = all).

func (*APIHandler) GetHealth

func (h *APIHandler) GetHealth(w http.ResponseWriter, r *http.Request)

func (*APIHandler) GetIllust

func (h *APIHandler) GetIllust(w http.ResponseWriter, r *http.Request, id IllustIdPath)

func (*APIHandler) GetSystemVersion

func (h *APIHandler) GetSystemVersion(w http.ResponseWriter, r *http.Request)

GetSystemVersion reports the running binary's version and build target. Open (no auth) — it's the same value already printed in the boot banner.

func (*APIHandler) GetUgoiraMetadata

func (h *APIHandler) GetUgoiraMetadata(w http.ResponseWriter, r *http.Request, id IllustIdPath)

func (*APIHandler) GetUpdateStatus

func (h *APIHandler) GetUpdateStatus(w http.ResponseWriter, r *http.Request)

GetUpdateStatus returns the cached update-check result without hitting the network. Open (no auth) so the About panel can show the version freely.

func (*APIHandler) GetUser

func (h *APIHandler) GetUser(w http.ResponseWriter, r *http.Request, id UserIdPath, params GetUserParams)

func (*APIHandler) ListDownloads

func (h *APIHandler) ListDownloads(w http.ResponseWriter, r *http.Request, params ListDownloadsParams)

func (*APIHandler) ListFollowingIllusts

func (h *APIHandler) ListFollowingIllusts(w http.ResponseWriter, r *http.Request, params ListFollowingIllustsParams)

func (*APIHandler) ListRanking

func (h *APIHandler) ListRanking(w http.ResponseWriter, r *http.Request, params ListRankingParams)

func (*APIHandler) ListRecommended

func (h *APIHandler) ListRecommended(w http.ResponseWriter, r *http.Request, params ListRecommendedParams)

func (*APIHandler) ListUserBookmarkTags

func (h *APIHandler) ListUserBookmarkTags(w http.ResponseWriter, r *http.Request, id UserIdPath, params ListUserBookmarkTagsParams)

func (*APIHandler) ListUserBookmarks

func (h *APIHandler) ListUserBookmarks(w http.ResponseWriter, r *http.Request, id UserIdPath, params ListUserBookmarksParams)

func (*APIHandler) ListUserFollowing

func (h *APIHandler) ListUserFollowing(w http.ResponseWriter, r *http.Request, id UserIdPath, params ListUserFollowingParams)

func (*APIHandler) ListUserIllusts

func (h *APIHandler) ListUserIllusts(w http.ResponseWriter, r *http.Request, id UserIdPath, params ListUserIllustsParams)

func (*APIHandler) Login

func (h *APIHandler) Login(w http.ResponseWriter, r *http.Request)

func (*APIHandler) Logout

func (h *APIHandler) Logout(w http.ResponseWriter, r *http.Request)

func (*APIHandler) PatchConfig

func (h *APIHandler) PatchConfig(w http.ResponseWriter, r *http.Request)

PatchConfig merges the incoming map into the file layer. On validation failure it returns 400 with per-key messages.

func (*APIHandler) PreviewNaming

func (h *APIHandler) PreviewNaming(w http.ResponseWriter, r *http.Request)

PreviewNaming renders the three download naming templates against a fixed sample work for the settings-UI live preview. It persists nothing; per-template parse/exec errors come back in the body (still 200) so the editor can show inline errors mid-edit without an HTTP error. Authoritative validation still happens on PATCH.

func (*APIHandler) ProxyImage

func (h *APIHandler) ProxyImage(w http.ResponseWriter, r *http.Request, params ProxyImageParams)

ProxyImage relays an i.pximg.net image through the same-origin backend, caching it on disk. The url query parameter must be an https i.pximg.net URL; any other host/scheme is rejected (SSRF guard) before a fetch is attempted. The endpoint is intentionally open (no requireAuth): it only proxies public Pixiv image-CDN URLs and the server binds 127.0.0.1 by default. The frontend points its pximg URLs here.

func (*APIHandler) RemoveDownload

func (h *APIHandler) RemoveDownload(w http.ResponseWriter, r *http.Request, id DownloadIdPath)

func (*APIHandler) ResetConfig

func (h *APIHandler) ResetConfig(w http.ResponseWriter, r *http.Request)

ResetConfig drops keys (or the entire file layer) and returns the refreshed view.

func (*APIHandler) RestartConfig

func (h *APIHandler) RestartConfig(w http.ResponseWriter, r *http.Request)

RestartConfig drains in-flight work and re-executes the process so settings.json is reloaded — how restart-required keys take effect. The 202 is flushed before the trigger fires so the client receives it before its connection (and any SSE streams) drop.

func (*APIHandler) SearchIllusts

func (h *APIHandler) SearchIllusts(w http.ResponseWriter, r *http.Request, params SearchIllustsParams)

func (*APIHandler) SearchUsers

func (h *APIHandler) SearchUsers(w http.ResponseWriter, r *http.Request, params SearchUsersParams)

func (*APIHandler) StartOAuth

func (h *APIHandler) StartOAuth(w http.ResponseWriter, r *http.Request)

StartOAuth issues a fresh PKCE state + verifier and hands the client back the hosted Pixiv login URL. The verifier stays server-side; the client only needs `state` to call ExchangeOAuth.

func (*APIHandler) SubmitDownload

func (h *APIHandler) SubmitDownload(w http.ResponseWriter, r *http.Request)

type AddBookmarkJSONRequestBody

type AddBookmarkJSONRequestBody = BookmarkRequest

AddBookmarkJSONRequestBody defines body for AddBookmark for application/json ContentType.

type AddFollowJSONRequestBody

type AddFollowJSONRequestBody = FollowRequest

AddFollowJSONRequestBody defines body for AddFollow for application/json ContentType.

type AuthStatus

type AuthStatus struct {
	Authenticated bool       `json:"authenticated"`
	ExpiresAt     *time.Time `json:"expires_at,omitempty"`

	// SessionExpired True when the previous session was cleared because Pixiv rejected the refresh token (invalid_grant) — distinct from a first-run "never logged in" state. The login page surfaces a "session expired, please sign in again" hint when set. Only meaningful while unauthenticated; false or absent otherwise.
	SessionExpired *bool   `json:"session_expired,omitempty"`
	UserId         *int64  `json:"user_id,omitempty"`
	UserName       *string `json:"user_name,omitempty"`
}

AuthStatus defines model for AuthStatus.

type BadRequest

type BadRequest = Error

BadRequest defines model for BadRequest.

type BookmarkDetail

type BookmarkDetail = pixivgo.BookmarkDetail

BookmarkDetail defines model for BookmarkDetail.

type BookmarkRequest

type BookmarkRequest struct {
	// Restrict Preserve an existing bookmark's visibility when omitted; new bookmarks default to public.
	Restrict *Restrict `json:"restrict,omitempty"`

	// Tags Complete replacement tag set. Omit to preserve existing registered tags; an empty array clears them. Tag names cannot contain whitespace because the App-API uses a space-separated field.
	Tags *[]string `json:"tags,omitempty"`
}

BookmarkRequest defines model for BookmarkRequest.

type BookmarkTag

type BookmarkTag = pixivgo.BookmarkTag

BookmarkTag defines model for BookmarkTag.

type BookmarkTagQuery

type BookmarkTagQuery = string

BookmarkTagQuery defines model for BookmarkTagQuery.

type BookmarkTagsPage

type BookmarkTagsPage struct {
	BookmarkTags []UserBookmarkTag `json:"bookmark_tags"`
	NextOffset   *int64            `json:"next_offset"`
}

BookmarkTagsPage defines model for BookmarkTagsPage.

type CheckConnectivityJSONRequestBody

type CheckConnectivityJSONRequestBody = ConnectivityRequest

CheckConnectivityJSONRequestBody defines body for CheckConnectivity for application/json ContentType.

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type ClearDownloadsParams

type ClearDownloadsParams struct {
	// Status Comma-separated subset of `DownloadStatus` to include. Omit for no
	// filter. Example: `queued,running`.
	Status *DownloadStatusListQuery `form:"status,omitempty" json:"status,omitempty"`
}

ClearDownloadsParams defines parameters for ClearDownloads.

type ClearDownloadsResponse

type ClearDownloadsResponse struct {
	// Removed Number of jobs deleted from history.
	Removed int `json:"removed"`
}

ClearDownloadsResponse defines model for ClearDownloadsResponse.

type ClientMode

type ClientMode string

ClientMode Pixiv `filter` knob — controls iOS-app-style content gating. `for_ios` applies Pixiv's iOS-client policy filter; `none` disables it. Named `client_mode` here to avoid collision with the generic notion of "filtering".

const (
	ForIos ClientMode = "for_ios"
	None   ClientMode = "none"
)

Defines values for ClientMode.

func (ClientMode) Valid

func (e ClientMode) Valid() bool

Valid indicates whether the value is a known member of the ClientMode enum.

type ClientModeQuery

type ClientModeQuery = ClientMode

ClientModeQuery Pixiv `filter` knob — controls iOS-app-style content gating. `for_ios` applies Pixiv's iOS-client policy filter; `none` disables it. Named `client_mode` here to avoid collision with the generic notion of "filtering".

type ConfigPatch

type ConfigPatch map[string]interface{}

ConfigPatch Free-form map of writes. Keys are either nested (matching the struct shape) or flat dotted paths (e.g. `"download.max_concurrent": 8`); both forms are accepted. Sending the sensitive mask sentinel (`***`) or `""` for a sensitive field is a no-op.

type ConfigResetRequest

type ConfigResetRequest struct {
	// All When true, clear the entire file layer. Mutually exclusive
	// with `keys`; sending both is rejected with 400.
	All *bool `json:"all,omitempty"`

	// Keys Dotted-path keys to drop from the file layer.
	Keys *[]string `json:"keys,omitempty"`
}

ConfigResetRequest defines model for ConfigResetRequest.

type ConfigRestartAccepted

type ConfigRestartAccepted struct {
	// Status Always `restarting`.
	Status string `json:"status"`
}

ConfigRestartAccepted defines model for ConfigRestartAccepted.

type ConfigSource

type ConfigSource string

ConfigSource Which config layer supplied the effective value for a key. `env` always wins; `file` overrides `defaults`.

const (
	ConfigSourceDefaults ConfigSource = "defaults"
	ConfigSourceEnv      ConfigSource = "env"
	ConfigSourceFile     ConfigSource = "file"
)

Defines values for ConfigSource.

func (ConfigSource) Valid

func (e ConfigSource) Valid() bool

Valid indicates whether the value is a known member of the ConfigSource enum.

type ConfigView

type ConfigView struct {
	// Effective Nested map of the values the running process is actually using.
	// Hot-reloadable keys advance immediately on PATCH/RESET;
	// restart-required keys stay pinned to the startup value until
	// the process restarts (and meanwhile appear in `pending_restart`).
	// Sensitive fields masked.
	Effective map[string]interface{} `json:"effective"`

	// File Nested map of overrides currently persisted in settings.json.
	// Advances on every successful PATCH/RESET. Sensitive fields masked.
	File map[string]interface{} `json:"file"`

	// PendingRestart Restart-required dotted keys whose persisted value differs from
	// the value the process started with — i.e. changes saved but not
	// yet in effect. Empty when nothing is awaiting a restart. Apply
	// them with `POST /config/restart`.
	PendingRestart []string `json:"pending_restart"`

	// SchemaVersion Bumps when the shape of settings.json changes incompatibly.
	// Frontend can refuse / migrate when its compiled schema doesn't match.
	SchemaVersion string `json:"schema_version"`

	// Sources Per dotted-key origin label; each value is one of `defaults`, `file`, `env`.
	Sources map[string]ConfigSource `json:"sources"`
}

ConfigView defines model for ConfigView.

type Conflict

type Conflict = Error

Conflict defines model for Conflict.

type ConnectivityRequest

type ConnectivityRequest struct {
	// Proxy Optional proxy URL to test (e.g. `http://127.0.0.1:7890` or
	// `socks5://127.0.0.1:1080`). Omit to probe the current
	// configuration as-is. When the probe succeeds with a supplied
	// proxy and there's no Pixiv session yet, the proxy is persisted
	// to settings so the subsequent login uses it.
	Proxy *string `json:"proxy,omitempty"`
}

ConnectivityRequest defines model for ConnectivityRequest.

type ConnectivityStatus

type ConnectivityStatus struct {
	// LatencyMs Round-trip time of the probe request, in milliseconds.
	LatencyMs *int `json:"latency_ms,omitempty"`

	// Reachable Whether any HTTP response came back from Pixiv over the tested path.
	Reachable bool `json:"reachable"`
}

ConnectivityStatus defines model for ConnectivityStatus.

type DetectedProxies

type DetectedProxies struct {
	// Candidates Proxy candidates ordered most-specific first (system before env),
	// deduplicated. Empty when nothing usable was detected.
	Candidates []ProxyCandidate `json:"candidates"`
}

DetectedProxies defines model for DetectedProxies.

type DownloadIdPath

type DownloadIdPath = string

DownloadIdPath defines model for DownloadIdPath.

type DownloadIllustType

type DownloadIllustType string

DownloadIllustType Pixiv artwork type the job was created for.

const (
	DownloadIllustTypeIllust DownloadIllustType = "illust"
	DownloadIllustTypeManga  DownloadIllustType = "manga"
	DownloadIllustTypeUgoira DownloadIllustType = "ugoira"
)

Defines values for DownloadIllustType.

func (DownloadIllustType) Valid

func (e DownloadIllustType) Valid() bool

Valid indicates whether the value is a known member of the DownloadIllustType enum.

type DownloadJob

type DownloadJob struct {
	CreatedAt time.Time `json:"created_at"`
	Id        string    `json:"id"`
	IllustId  int64     `json:"illust_id"`

	// IllustType Pixiv artwork type the job was created for.
	IllustType DownloadIllustType `json:"illust_type"`

	// PreviewUrl Thumbnail (square_medium → medium → large). Absent on jobs persisted before this field existed.
	PreviewUrl *string `json:"preview_url,omitempty"`

	// Status Lifecycle state of a download job or task.
	Status    DownloadStatus `json:"status"`
	Tasks     []DownloadTask `json:"tasks"`
	Title     *string        `json:"title,omitempty"`
	UpdatedAt time.Time      `json:"updated_at"`
}

DownloadJob defines model for DownloadJob.

type DownloadJobList

type DownloadJobList struct {
	// ActiveCount Global count of `queued` + `running` jobs (independent of filter).
	// Drives the sidebar badge.
	ActiveCount int `json:"active_count"`

	// DoneCount Global count of `completed` jobs (independent of filter).
	DoneCount int           `json:"done_count"`
	Jobs      []DownloadJob `json:"jobs"`

	// Page Echo of the requested 1-based page index after clamping.
	Page int `json:"page"`

	// PerPage Echo of the effective page size after clamping.
	PerPage int `json:"per_page"`

	// Total Total jobs matching the filter (status + updated_since).
	Total int `json:"total"`
}

DownloadJobList defines model for DownloadJobList.

type DownloadPageQuery

type DownloadPageQuery = int

DownloadPageQuery defines model for DownloadPageQuery.

type DownloadPerPageQuery

type DownloadPerPageQuery = int

DownloadPerPageQuery defines model for DownloadPerPageQuery.

type DownloadStatus

type DownloadStatus string

DownloadStatus Lifecycle state of a download job or task.

const (
	Cancelled DownloadStatus = "cancelled"
	Completed DownloadStatus = "completed"
	Failed    DownloadStatus = "failed"
	Queued    DownloadStatus = "queued"
	Running   DownloadStatus = "running"
)

Defines values for DownloadStatus.

func (DownloadStatus) Valid

func (e DownloadStatus) Valid() bool

Valid indicates whether the value is a known member of the DownloadStatus enum.

type DownloadStatusListQuery

type DownloadStatusListQuery = string

DownloadStatusListQuery defines model for DownloadStatusListQuery.

type DownloadTask

type DownloadTask struct {
	DownloadedBytes int64   `json:"downloaded_bytes"`
	Error           *string `json:"error,omitempty"`

	// FilePath Target path on disk.
	FilePath   string     `json:"file_path"`
	FinishedAt *time.Time `json:"finished_at,omitempty"`
	Id         string     `json:"id"`
	JobId      string     `json:"job_id"`

	// SizeBytes Content-Length, or -1 if unknown.
	SizeBytes int64      `json:"size_bytes"`
	StartedAt *time.Time `json:"started_at,omitempty"`

	// Status Lifecycle state of a download job or task.
	Status DownloadStatus `json:"status"`

	// Url Final request URL.
	Url string `json:"url"`
}

DownloadTask defines model for DownloadTask.

type DownloadUpdatedSinceQuery

type DownloadUpdatedSinceQuery = time.Time

DownloadUpdatedSinceQuery defines model for DownloadUpdatedSinceQuery.

type DurationQuery

type DurationQuery = SearchDuration

DurationQuery defines model for DurationQuery.

type Error

type Error struct {
	// Code Machine-readable error code.
	Code ErrorCode `json:"code"`

	// Fields Populated only when `kind=validation`. Per-key validation
	// messages keyed by dotted config path. The reserved key `_`
	// carries a non-field general message.
	Fields *map[string]string `json:"fields,omitempty"`

	// Kind Rendering discriminator. Tells the client what's in `message`
	// and which optional fields are populated:
	//   - `validation`: client supplied bad input; `message` is a
	//     generic summary, `fields` carries per-key validation
	//     messages.
	//   - `app`: backend-authored, safe to show verbatim.
	//   - `upstream`: Pixiv rejected the request; `message` is a
	//     generic phrase and `upstream.reason` carries a stable
	//     token for i18n. The raw upstream body is never on the
	//     wire.
	//   - `internal`: unexpected server failure; `message` is a
	//     fixed generic string and `request_id` should be surfaced
	//     so the user can quote it.
	Kind ErrorKind `json:"kind"`

	// Message Always safe to display verbatim. Authored by the backend's
	// `classify` function only; never contains `err.Error()` text
	// or upstream response body.
	Message string `json:"message"`

	// RequestId Per-request identifier from the chi RequestID middleware.
	// Set on every backend-produced error so users can quote it
	// for log lookup. Absent for client-side synthetic errors.
	RequestId *string `json:"request_id,omitempty"`

	// Upstream Populated only when `kind=upstream`.
	Upstream *struct {
		// Reason Backend-classified stable token for the upstream failure.
		// `generic` is the fallback for any Pixiv error we don't
		// yet distinguish; the raw body is logged server-side and
		// never forwarded.
		Reason ErrorUpstreamReason `json:"reason"`

		// Status HTTP status returned by Pixiv.
		Status int `json:"status"`
	} `json:"upstream,omitempty"`
}

Error defines model for Error.

type ErrorCode

type ErrorCode string

ErrorCode Machine-readable error code.

const (
	ErrorCodeBadRequest      ErrorCode = "bad_request"
	ErrorCodeConflict        ErrorCode = "conflict"
	ErrorCodeForbidden       ErrorCode = "forbidden"
	ErrorCodeInternalError   ErrorCode = "internal_error"
	ErrorCodeNotFound        ErrorCode = "not_found"
	ErrorCodeRateLimited     ErrorCode = "rate_limited"
	ErrorCodeUnauthenticated ErrorCode = "unauthenticated"
	ErrorCodeUpstreamError   ErrorCode = "upstream_error"
)

Defines values for ErrorCode.

func (ErrorCode) Valid

func (e ErrorCode) Valid() bool

Valid indicates whether the value is a known member of the ErrorCode enum.

type ErrorKind

type ErrorKind string

ErrorKind Rendering discriminator. Tells the client what's in `message` and which optional fields are populated:

  • `validation`: client supplied bad input; `message` is a generic summary, `fields` carries per-key validation messages.
  • `app`: backend-authored, safe to show verbatim.
  • `upstream`: Pixiv rejected the request; `message` is a generic phrase and `upstream.reason` carries a stable token for i18n. The raw upstream body is never on the wire.
  • `internal`: unexpected server failure; `message` is a fixed generic string and `request_id` should be surfaced so the user can quote it.
const (
	ErrorKindApp        ErrorKind = "app"
	ErrorKindInternal   ErrorKind = "internal"
	ErrorKindUpstream   ErrorKind = "upstream"
	ErrorKindValidation ErrorKind = "validation"
)

Defines values for ErrorKind.

func (ErrorKind) Valid

func (e ErrorKind) Valid() bool

Valid indicates whether the value is a known member of the ErrorKind enum.

type ErrorUpstreamReason

type ErrorUpstreamReason string

ErrorUpstreamReason Backend-classified stable token for the upstream failure. `generic` is the fallback for any Pixiv error we don't yet distinguish; the raw body is logged server-side and never forwarded.

const (
	Generic      ErrorUpstreamReason = "generic"
	InvalidGrant ErrorUpstreamReason = "invalid_grant"
	RateLimit    ErrorUpstreamReason = "rate_limit"
)

Defines values for ErrorUpstreamReason.

func (ErrorUpstreamReason) Valid

func (e ErrorUpstreamReason) Valid() bool

Valid indicates whether the value is a known member of the ErrorUpstreamReason enum.

type ExchangeOAuthJSONRequestBody

type ExchangeOAuthJSONRequestBody = OAuthExchangeRequest

ExchangeOAuthJSONRequestBody defines body for ExchangeOAuth for application/json ContentType.

type ExcludeAiQuery

type ExcludeAiQuery = bool

ExcludeAiQuery defines model for ExcludeAiQuery.

type FollowRequest

type FollowRequest struct {
	Restrict *Restrict `json:"restrict,omitempty"`
}

FollowRequest defines model for FollowRequest.

type Forbidden

type Forbidden = Error

Forbidden defines model for Forbidden.

type GetEventsParams

type GetEventsParams struct {
	// Topics Comma-separated topic filter (e.g. `download,system`).
	// Omit for all topics.
	Topics *string `form:"topics,omitempty" json:"topics,omitempty"`
}

GetEventsParams defines parameters for GetEvents.

type GetUserParams

type GetUserParams struct {
	// ClientMode Client emulation mode (Pixiv's `filter` query). Omit (= `for_ios`)
	// to apply the same policy filter as the official iOS client;
	// pass `none` to disable.
	ClientMode *ClientModeQuery `form:"client_mode,omitempty" json:"client_mode,omitempty"`
}

GetUserParams defines parameters for GetUser.

type HealthStatus

type HealthStatus struct {
	Status string `json:"status"`
}

HealthStatus defines model for HealthStatus.

type Illust

type Illust = pixivgo.IllustrationInfo

Illust Pixiv illustration metadata. Shape mirrors pixivgo.IllustrationInfo.

type IllustDetailResponse

type IllustDetailResponse = pixivgo.IllustDetailResponse

IllustDetailResponse Wrapper for a single illust detail. Mirrors pixivgo.IllustDetailResponse.

type IllustIdPath

type IllustIdPath = int64

IllustIdPath defines model for IllustIdPath.

type IllustPage

type IllustPage struct {
	Illusts []Illust `json:"illusts"`

	// NextMaxBookmarkId Set only by `/users/{id}/bookmarks`; pass back as `max_bookmark_id`.
	NextMaxBookmarkId *int64 `json:"next_max_bookmark_id,omitempty"`

	// NextOffset Next offset to pass back, or null if no further page.
	NextOffset *int64 `json:"next_offset,omitempty"`
}

IllustPage defines model for IllustPage.

type IllustType

type IllustType string

IllustType defines model for IllustType.

const (
	IllustTypeIllust IllustType = "illust"
	IllustTypeManga  IllustType = "manga"
)

Defines values for IllustType.

func (IllustType) Valid

func (e IllustType) Valid() bool

Valid indicates whether the value is a known member of the IllustType enum.

type IllustTypeQuery

type IllustTypeQuery = IllustType

IllustTypeQuery defines model for IllustTypeQuery.

type IllustrationTag

type IllustrationTag = pixivgo.IllustrationTag

IllustrationTag defines model for IllustrationTag.

type ImageUrls

type ImageUrls = pixivgo.ImageUrls

ImageUrls defines model for ImageUrls.

type IncludeRankingIllustsQuery

type IncludeRankingIllustsQuery = bool

IncludeRankingIllustsQuery defines model for IncludeRankingIllustsQuery.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type ListDownloadsParams

type ListDownloadsParams struct {
	// Status Comma-separated subset of `DownloadStatus` to include. Omit for no
	// filter. Example: `queued,running`.
	Status *DownloadStatusListQuery `form:"status,omitempty" json:"status,omitempty"`

	// Page 1-based page index.
	Page *DownloadPageQuery `form:"page,omitempty" json:"page,omitempty"`

	// PerPage Items per page; clamped to `[1, 100]`.
	PerPage *DownloadPerPageQuery `form:"per_page,omitempty" json:"per_page,omitempty"`

	// UpdatedSince RFC3339 timestamp. Only jobs with `updated_at >= updated_since`
	// are returned. Used by the frontend to load the recent-tracked
	// window without scanning the whole history.
	UpdatedSince *DownloadUpdatedSinceQuery `form:"updated_since,omitempty" json:"updated_since,omitempty"`
}

ListDownloadsParams defines parameters for ListDownloads.

type ListFollowingIllustsParams

type ListFollowingIllustsParams struct {
	// Restrict Visibility scope (public or private).
	Restrict *RestrictQuery `form:"restrict,omitempty" json:"restrict,omitempty"`

	// Offset Offset for offset-paginated list endpoints.
	Offset *OffsetQuery `form:"offset,omitempty" json:"offset,omitempty"`
}

ListFollowingIllustsParams defines parameters for ListFollowingIllusts.

type ListRankingParams

type ListRankingParams struct {
	Mode *RankingMode `form:"mode,omitempty" json:"mode,omitempty"`

	// Date Ranking date in `YYYY-MM-DD`. Omit for the latest.
	Date *string `form:"date,omitempty" json:"date,omitempty"`

	// Offset Offset for offset-paginated list endpoints.
	Offset *OffsetQuery `form:"offset,omitempty" json:"offset,omitempty"`

	// ClientMode Client emulation mode (Pixiv's `filter` query). Omit (= `for_ios`)
	// to apply the same policy filter as the official iOS client;
	// pass `none` to disable.
	ClientMode *ClientModeQuery `form:"client_mode,omitempty" json:"client_mode,omitempty"`
}

ListRankingParams defines parameters for ListRanking.

type ListRecommendedParams

type ListRecommendedParams struct {
	// Type Illust type filter; both are returned when omitted (where supported).
	Type *IllustTypeQuery `form:"type,omitempty" json:"type,omitempty"`

	// Offset Offset for offset-paginated list endpoints.
	Offset *OffsetQuery `form:"offset,omitempty" json:"offset,omitempty"`

	// ClientMode Client emulation mode (Pixiv's `filter` query). Omit (= `for_ios`)
	// to apply the same policy filter as the official iOS client;
	// pass `none` to disable.
	ClientMode *ClientModeQuery `form:"client_mode,omitempty" json:"client_mode,omitempty"`

	// IncludeRankingIllusts When false, omit the daily-ranking section Pixiv injects into the
	// recommended feed. Omit to keep Pixiv's default behaviour.
	IncludeRankingIllusts *IncludeRankingIllustsQuery `form:"include_ranking_illusts,omitempty" json:"include_ranking_illusts,omitempty"`
}

ListRecommendedParams defines parameters for ListRecommended.

type ListUserBookmarkTagsParams

type ListUserBookmarkTagsParams struct {
	// Restrict Visibility scope (public or private).
	Restrict *RestrictQuery `form:"restrict,omitempty" json:"restrict,omitempty"`

	// Offset Offset for offset-paginated list endpoints.
	Offset *OffsetQuery `form:"offset,omitempty" json:"offset,omitempty"`
}

ListUserBookmarkTagsParams defines parameters for ListUserBookmarkTags.

type ListUserBookmarksParams

type ListUserBookmarksParams struct {
	// Restrict Visibility scope (public or private).
	Restrict *RestrictQuery `form:"restrict,omitempty" json:"restrict,omitempty"`

	// MaxBookmarkId Cursor for the next bookmarks page; pass `next_max_bookmark_id` from the previous response.
	MaxBookmarkId *MaxBookmarkIdQuery `form:"max_bookmark_id,omitempty" json:"max_bookmark_id,omitempty"`

	// Tag Restrict bookmarks to those tagged with this exact tag name.
	Tag *BookmarkTagQuery `form:"tag,omitempty" json:"tag,omitempty"`

	// ClientMode Client emulation mode (Pixiv's `filter` query). Omit (= `for_ios`)
	// to apply the same policy filter as the official iOS client;
	// pass `none` to disable.
	ClientMode *ClientModeQuery `form:"client_mode,omitempty" json:"client_mode,omitempty"`
}

ListUserBookmarksParams defines parameters for ListUserBookmarks.

type ListUserFollowingParams

type ListUserFollowingParams struct {
	// Restrict Visibility scope (public or private).
	Restrict *RestrictQuery `form:"restrict,omitempty" json:"restrict,omitempty"`

	// Offset Offset for offset-paginated list endpoints.
	Offset *OffsetQuery `form:"offset,omitempty" json:"offset,omitempty"`
}

ListUserFollowingParams defines parameters for ListUserFollowing.

type ListUserIllustsParams

type ListUserIllustsParams struct {
	// Type Illust type filter; both are returned when omitted (where supported).
	Type *IllustTypeQuery `form:"type,omitempty" json:"type,omitempty"`

	// Offset Offset for offset-paginated list endpoints.
	Offset *OffsetQuery `form:"offset,omitempty" json:"offset,omitempty"`

	// ClientMode Client emulation mode (Pixiv's `filter` query). Omit (= `for_ios`)
	// to apply the same policy filter as the official iOS client;
	// pass `none` to disable.
	ClientMode *ClientModeQuery `form:"client_mode,omitempty" json:"client_mode,omitempty"`
}

ListUserIllustsParams defines parameters for ListUserIllusts.

type LoginJSONRequestBody

type LoginJSONRequestBody = LoginRequest

LoginJSONRequestBody defines body for Login for application/json ContentType.

type LoginRequest

type LoginRequest struct {
	// RefreshToken Long-lived Pixiv OAuth refresh token. See README for how to obtain.
	RefreshToken string `json:"refresh_token"`
}

LoginRequest defines model for LoginRequest.

type MaxBookmarkIdQuery

type MaxBookmarkIdQuery = int64

MaxBookmarkIdQuery defines model for MaxBookmarkIdQuery.

type MetaPage

type MetaPage = pixivgo.MetaPage

MetaPage defines model for MetaPage.

type MetaSinglePage

type MetaSinglePage = pixivgo.MetaSinglePage

MetaSinglePage defines model for MetaSinglePage.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type NamingPreviewRequest

type NamingPreviewRequest struct {
	// FileGroupTemplate Candidate `download.file_group_template` template.
	FileGroupTemplate *string `json:"file_group_template,omitempty"`

	// FileTemplate Candidate `download.file_template` template.
	FileTemplate *string `json:"file_template,omitempty"`

	// OutputDir Candidate `download.output_dir` template.
	OutputDir *string `json:"output_dir,omitempty"`
}

NamingPreviewRequest Candidate download naming templates to render. All three are optional; any omitted field falls back to the current effective value. Mirrors the three `download.*` template keys. Nothing is persisted — this is a render-only preview.

type NamingPreviewResponse

type NamingPreviewResponse struct {
	// Fields Per-template error messages keyed by dotted config path
	// (`download.output_dir` / `download.file_template` /
	// `download.file_group_template`). A key is present only when
	// that template failed to parse or render; an empty/absent map
	// means every template rendered cleanly. Present even on 200.
	Fields map[string]string `json:"fields"`

	// MultiPage Full example path for a multi-page work: `output_dir` joined
	// with `file_group_template` at page Index 2 (demonstrates
	// `pad`, sample `.png`). Empty if either template failed.
	MultiPage string `json:"multi_page"`

	// OutputDir Rendered `output_dir` (absolute/relative aware). Empty if it failed to parse/render.
	OutputDir string `json:"output_dir"`

	// SinglePage Full example path for a single-page work: `output_dir` joined
	// with `file_template` (Index 0, sample `.jpg`). Empty if either
	// template failed.
	SinglePage string `json:"single_page"`
}

NamingPreviewResponse defines model for NamingPreviewResponse.

type NotFound

type NotFound = Error

NotFound defines model for NotFound.

type Novel

type Novel = pixivgo.NovelInfo

Novel Pixiv novel metadata. Shape mirrors pixivgo.NovelInfo.

type NovelTag

type NovelTag = pixivgo.NovelTag

NovelTag defines model for NovelTag.

type OAuthExchangeRequest

type OAuthExchangeRequest struct {
	// Code Either the bare authorisation `code` Pixiv emitted, or the full
	// callback URL the user pasted (the server extracts `?code=…`).
	Code string `json:"code"`

	// State The `state` returned by `/auth/oauth/start`.
	State string `json:"state"`
}

OAuthExchangeRequest defines model for OAuthExchangeRequest.

type OAuthStartResponse

type OAuthStartResponse struct {
	// LoginUrl Pixiv-hosted login URL the client should open in a popup. After
	// the user authenticates Pixiv redirects to a fixed callback URL
	// that carries `?code=…`; the user pastes that URL (or just the
	// code) back into the client.
	LoginUrl string `json:"login_url"`

	// State Opaque handle the client must echo back to `/auth/oauth/exchange`.
	// The server uses it to look up the matching PKCE verifier.
	State string `json:"state"`
}

OAuthStartResponse defines model for OAuthStartResponse.

type OffsetQuery

type OffsetQuery = int64

OffsetQuery defines model for OffsetQuery.

type PatchConfigJSONRequestBody

type PatchConfigJSONRequestBody = ConfigPatch

PatchConfigJSONRequestBody defines body for PatchConfig for application/json ContentType.

type PreviewNamingJSONRequestBody

type PreviewNamingJSONRequestBody = NamingPreviewRequest

PreviewNamingJSONRequestBody defines body for PreviewNaming for application/json ContentType.

type Profile

type Profile = pixivgo.Profile

Profile Pixiv user profile. Shape mirrors pixivgo.Profile.

type ProfileImageUrls

type ProfileImageUrls = pixivgo.ProfileImageUrls

ProfileImageUrls defines model for ProfileImageUrls.

type ProfilePublicity

type ProfilePublicity = pixivgo.ProfilePublicity

ProfilePublicity Pixiv profile publicity flags. Shape mirrors pixivgo.ProfilePublicity.

type ProxyCandidate

type ProxyCandidate struct {
	// Source Where the candidate was discovered — `system` (the OS GUI proxy
	// settings) or `env` (a proxy environment variable).
	Source ProxyCandidateSource `json:"source"`

	// Url Normalized proxy URL (`scheme://host[:port]`), ready to test or save.
	Url string `json:"url"`
}

ProxyCandidate defines model for ProxyCandidate.

type ProxyCandidateSource

type ProxyCandidateSource string

ProxyCandidateSource Where the candidate was discovered — `system` (the OS GUI proxy settings) or `env` (a proxy environment variable).

const (
	ProxyCandidateSourceEnv    ProxyCandidateSource = "env"
	ProxyCandidateSourceSystem ProxyCandidateSource = "system"
)

Defines values for ProxyCandidateSource.

func (ProxyCandidateSource) Valid

func (e ProxyCandidateSource) Valid() bool

Valid indicates whether the value is a known member of the ProxyCandidateSource enum.

type ProxyImageParams

type ProxyImageParams struct {
	// Url Full `https://i.pximg.net/...` image URL to proxy.
	Url string `form:"url" json:"url"`
}

ProxyImageParams defines parameters for ProxyImage.

type RankingMode

type RankingMode string

RankingMode defines model for RankingMode.

const (
	Day          RankingMode = "day"
	DayFemale    RankingMode = "day_female"
	DayFemaleR18 RankingMode = "day_female_r18"
	DayMale      RankingMode = "day_male"
	DayMaleR18   RankingMode = "day_male_r18"
	DayManga     RankingMode = "day_manga"
	DayR18       RankingMode = "day_r18"
	Month        RankingMode = "month"
	Week         RankingMode = "week"
	WeekOriginal RankingMode = "week_original"
	WeekR18      RankingMode = "week_r18"
	WeekR18g     RankingMode = "week_r18g"
	WeekRookie   RankingMode = "week_rookie"
)

Defines values for RankingMode.

func (RankingMode) Valid

func (e RankingMode) Valid() bool

Valid indicates whether the value is a known member of the RankingMode enum.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ResetConfigJSONRequestBody

type ResetConfigJSONRequestBody = ConfigResetRequest

ResetConfigJSONRequestBody defines body for ResetConfig for application/json ContentType.

type Restrict

type Restrict string

Restrict defines model for Restrict.

const (
	Private Restrict = "private"
	Public  Restrict = "public"
)

Defines values for Restrict.

func (Restrict) Valid

func (e Restrict) Valid() bool

Valid indicates whether the value is a known member of the Restrict enum.

type RestrictQuery

type RestrictQuery = Restrict

RestrictQuery defines model for RestrictQuery.

type RouteNotFoundError

type RouteNotFoundError struct {
	Method string
	Path   string
}

RouteNotFoundError backs the router's NotFound handler for requests under the API base that match no registered route. Routing it through WriteError (as a UserError) keeps unmapped-endpoint responses on the same structured envelope as every other API error, instead of chi's plain-text default or the SPA's HTML fallback.

func (*RouteNotFoundError) APICode

func (*RouteNotFoundError) APICode() ErrorCode

func (*RouteNotFoundError) Error

func (e *RouteNotFoundError) Error() string

func (*RouteNotFoundError) UserMessage

func (*RouteNotFoundError) UserMessage() string

type SearchDuration

type SearchDuration string

SearchDuration defines model for SearchDuration.

const (
	WithinLastDay   SearchDuration = "within_last_day"
	WithinLastMonth SearchDuration = "within_last_month"
	WithinLastWeek  SearchDuration = "within_last_week"
)

Defines values for SearchDuration.

func (SearchDuration) Valid

func (e SearchDuration) Valid() bool

Valid indicates whether the value is a known member of the SearchDuration enum.

type SearchIllustsParams

type SearchIllustsParams struct {
	Word         string        `form:"word" json:"word"`
	SearchTarget *SearchTarget `form:"search_target,omitempty" json:"search_target,omitempty"`
	Sort         *SearchSort   `form:"sort,omitempty" json:"sort,omitempty"`

	// StartDate Lower bound `YYYY-MM-DD` for creation date.
	StartDate *string `form:"start_date,omitempty" json:"start_date,omitempty"`

	// EndDate Upper bound `YYYY-MM-DD` for creation date.
	EndDate *string `form:"end_date,omitempty" json:"end_date,omitempty"`

	// Duration Time-window filter for search results.
	Duration *DurationQuery `form:"duration,omitempty" json:"duration,omitempty"`

	// ExcludeAi When true, exclude AI-generated works from search results
	// (Pixiv `search_ai_type=1`). Omit or set false to include them.
	ExcludeAi *ExcludeAiQuery `form:"exclude_ai,omitempty" json:"exclude_ai,omitempty"`

	// Offset Offset for offset-paginated list endpoints.
	Offset *OffsetQuery `form:"offset,omitempty" json:"offset,omitempty"`

	// ClientMode Client emulation mode (Pixiv's `filter` query). Omit (= `for_ios`)
	// to apply the same policy filter as the official iOS client;
	// pass `none` to disable.
	ClientMode *ClientModeQuery `form:"client_mode,omitempty" json:"client_mode,omitempty"`
}

SearchIllustsParams defines parameters for SearchIllusts.

type SearchSort

type SearchSort string

SearchSort defines model for SearchSort.

const (
	BookmarksDesc SearchSort = "bookmarks_desc"
	DateAsc       SearchSort = "date_asc"
	DateDesc      SearchSort = "date_desc"
	PopularDesc   SearchSort = "popular_desc"
	ViewsDesc     SearchSort = "views_desc"
)

Defines values for SearchSort.

func (SearchSort) Valid

func (e SearchSort) Valid() bool

Valid indicates whether the value is a known member of the SearchSort enum.

type SearchTarget

type SearchTarget string

SearchTarget defines model for SearchTarget.

const (
	ExactMatchForTags   SearchTarget = "exact_match_for_tags"
	Keyword             SearchTarget = "keyword"
	PartialMatchForTags SearchTarget = "partial_match_for_tags"
	TitleAndCaption     SearchTarget = "title_and_caption"
)

Defines values for SearchTarget.

func (SearchTarget) Valid

func (e SearchTarget) Valid() bool

Valid indicates whether the value is a known member of the SearchTarget enum.

type SearchUsersParams

type SearchUsersParams struct {
	Word string      `form:"word" json:"word"`
	Sort *SearchSort `form:"sort,omitempty" json:"sort,omitempty"`

	// Duration Time-window filter for search results.
	Duration *DurationQuery `form:"duration,omitempty" json:"duration,omitempty"`

	// Offset Offset for offset-paginated list endpoints.
	Offset *OffsetQuery `form:"offset,omitempty" json:"offset,omitempty"`

	// ClientMode Client emulation mode (Pixiv's `filter` query). Omit (= `for_ios`)
	// to apply the same policy filter as the official iOS client;
	// pass `none` to disable.
	ClientMode *ClientModeQuery `form:"client_mode,omitempty" json:"client_mode,omitempty"`
}

SearchUsersParams defines parameters for SearchUsers.

type Series

type Series = pixivgo.Series

Series Pixiv returns `{}` instead of `null` for empty series; in that case `id` is 0.

type ServerInterface

type ServerInterface interface {
	// Check whether the backend can reach Pixiv
	// (POST /auth/connectivity)
	CheckConnectivity(w http.ResponseWriter, r *http.Request)
	// Log in with a refresh token
	// (POST /auth/login)
	Login(w http.ResponseWriter, r *http.Request)
	// Log out the current session
	// (POST /auth/logout)
	Logout(w http.ResponseWriter, r *http.Request)
	// Complete a browser-driven Pixiv OAuth login
	// (POST /auth/oauth/exchange)
	ExchangeOAuth(w http.ResponseWriter, r *http.Request)
	// Begin a browser-driven Pixiv OAuth (PKCE) login
	// (POST /auth/oauth/start)
	StartOAuth(w http.ResponseWriter, r *http.Request)
	// Detect proxy candidates from the OS configuration
	// (GET /auth/proxy/detect)
	DetectProxies(w http.ResponseWriter, r *http.Request)
	// Get current auth status
	// (GET /auth/status)
	GetAuthStatus(w http.ResponseWriter, r *http.Request)
	// Get the effective config + per-key source layering
	// (GET /config)
	GetConfig(w http.ResponseWriter, r *http.Request)
	// Merge a partial update into the persisted overrides
	// (PATCH /config)
	PatchConfig(w http.ResponseWriter, r *http.Request)
	// Render the download naming templates against a fixed sample work
	// (POST /config/naming/preview)
	PreviewNaming(w http.ResponseWriter, r *http.Request)
	// Drop overrides from the file layer (per key or wholesale)
	// (POST /config/reset)
	ResetConfig(w http.ResponseWriter, r *http.Request)
	// Gracefully restart the process to apply restart-required settings
	// (POST /config/restart)
	RestartConfig(w http.ResponseWriter, r *http.Request)
	// Get the JSON Schema describing all settings
	// (GET /config/schema)
	GetConfigSchema(w http.ResponseWriter, r *http.Request)
	// Bulk-remove terminal download jobs from history
	// (DELETE /downloads)
	ClearDownloads(w http.ResponseWriter, r *http.Request, params ClearDownloadsParams)
	// List download jobs (paginated)
	// (GET /downloads)
	ListDownloads(w http.ResponseWriter, r *http.Request, params ListDownloadsParams)
	// Submit a download job
	// (POST /downloads)
	SubmitDownload(w http.ResponseWriter, r *http.Request)
	// Remove a download job from history
	// (DELETE /downloads/{id})
	RemoveDownload(w http.ResponseWriter, r *http.Request, id DownloadIdPath)
	// Get a download job
	// (GET /downloads/{id})
	GetDownload(w http.ResponseWriter, r *http.Request, id DownloadIdPath)
	// Cancel a running download job
	// (POST /downloads/{id}/cancel)
	CancelDownload(w http.ResponseWriter, r *http.Request, id DownloadIdPath)
	// Subscribe to the event stream
	// (GET /events)
	GetEvents(w http.ResponseWriter, r *http.Request, params GetEventsParams)
	// Check service health
	// (GET /health)
	GetHealth(w http.ResponseWriter, r *http.Request)
	// List illusts from followed users
	// (GET /illusts/following)
	ListFollowingIllusts(w http.ResponseWriter, r *http.Request, params ListFollowingIllustsParams)
	// List ranked illusts
	// (GET /illusts/ranking)
	ListRanking(w http.ResponseWriter, r *http.Request, params ListRankingParams)
	// List recommended illusts
	// (GET /illusts/recommended)
	ListRecommended(w http.ResponseWriter, r *http.Request, params ListRecommendedParams)
	// Get illust detail
	// (GET /illusts/{id})
	GetIllust(w http.ResponseWriter, r *http.Request, id IllustIdPath)
	// Remove an illust bookmark
	// (DELETE /illusts/{id}/bookmark)
	DeleteBookmark(w http.ResponseWriter, r *http.Request, id IllustIdPath)
	// Get current user's bookmark detail for an illust
	// (GET /illusts/{id}/bookmark)
	GetBookmarkDetail(w http.ResponseWriter, r *http.Request, id IllustIdPath)
	// Add or update an illust bookmark, preserving omitted fields
	// (PUT /illusts/{id}/bookmark)
	AddBookmark(w http.ResponseWriter, r *http.Request, id IllustIdPath)
	// Get ugoira metadata
	// (GET /illusts/{id}/ugoira)
	GetUgoiraMetadata(w http.ResponseWriter, r *http.Request, id IllustIdPath)
	// Proxy and cache a Pixiv image
	// (GET /proxy/img)
	ProxyImage(w http.ResponseWriter, r *http.Request, params ProxyImageParams)
	// Search illusts
	// (GET /search/illusts)
	SearchIllusts(w http.ResponseWriter, r *http.Request, params SearchIllustsParams)
	// Search users
	// (GET /search/users)
	SearchUsers(w http.ResponseWriter, r *http.Request, params SearchUsersParams)
	// Get the cached update-check result
	// (GET /system/update)
	GetUpdateStatus(w http.ResponseWriter, r *http.Request)
	// Download, verify, and apply the latest update, then restart
	// (POST /system/update/apply)
	ApplyUpdate(w http.ResponseWriter, r *http.Request)
	// Force an immediate update check against GitHub Releases
	// (POST /system/update/check)
	CheckForUpdate(w http.ResponseWriter, r *http.Request)
	// Get the running binary's version and build info
	// (GET /system/version)
	GetSystemVersion(w http.ResponseWriter, r *http.Request)
	// Get a user's profile detail
	// (GET /users/{id})
	GetUser(w http.ResponseWriter, r *http.Request, id UserIdPath, params GetUserParams)
	// List bookmark tags and upstream counts for one visibility partition
	// (GET /users/{id}/bookmark-tags)
	ListUserBookmarkTags(w http.ResponseWriter, r *http.Request, id UserIdPath, params ListUserBookmarkTagsParams)
	// List a user's bookmarks
	// (GET /users/{id}/bookmarks)
	ListUserBookmarks(w http.ResponseWriter, r *http.Request, id UserIdPath, params ListUserBookmarksParams)
	// Unfollow a user
	// (DELETE /users/{id}/follow)
	DeleteFollow(w http.ResponseWriter, r *http.Request, id UserIdPath)
	// Follow a user
	// (PUT /users/{id}/follow)
	AddFollow(w http.ResponseWriter, r *http.Request, id UserIdPath)
	// List users followed by a user
	// (GET /users/{id}/following)
	ListUserFollowing(w http.ResponseWriter, r *http.Request, id UserIdPath, params ListUserFollowingParams)
	// List illusts by a user
	// (GET /users/{id}/illusts)
	ListUserIllusts(w http.ResponseWriter, r *http.Request, id UserIdPath, params ListUserIllustsParams)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) AddBookmark

func (siw *ServerInterfaceWrapper) AddBookmark(w http.ResponseWriter, r *http.Request)

AddBookmark operation middleware

func (*ServerInterfaceWrapper) AddFollow

func (siw *ServerInterfaceWrapper) AddFollow(w http.ResponseWriter, r *http.Request)

AddFollow operation middleware

func (*ServerInterfaceWrapper) ApplyUpdate

func (siw *ServerInterfaceWrapper) ApplyUpdate(w http.ResponseWriter, r *http.Request)

ApplyUpdate operation middleware

func (*ServerInterfaceWrapper) CancelDownload

func (siw *ServerInterfaceWrapper) CancelDownload(w http.ResponseWriter, r *http.Request)

CancelDownload operation middleware

func (*ServerInterfaceWrapper) CheckConnectivity

func (siw *ServerInterfaceWrapper) CheckConnectivity(w http.ResponseWriter, r *http.Request)

CheckConnectivity operation middleware

func (*ServerInterfaceWrapper) CheckForUpdate

func (siw *ServerInterfaceWrapper) CheckForUpdate(w http.ResponseWriter, r *http.Request)

CheckForUpdate operation middleware

func (*ServerInterfaceWrapper) ClearDownloads

func (siw *ServerInterfaceWrapper) ClearDownloads(w http.ResponseWriter, r *http.Request)

ClearDownloads operation middleware

func (*ServerInterfaceWrapper) DeleteBookmark

func (siw *ServerInterfaceWrapper) DeleteBookmark(w http.ResponseWriter, r *http.Request)

DeleteBookmark operation middleware

func (*ServerInterfaceWrapper) DeleteFollow

func (siw *ServerInterfaceWrapper) DeleteFollow(w http.ResponseWriter, r *http.Request)

DeleteFollow operation middleware

func (*ServerInterfaceWrapper) DetectProxies

func (siw *ServerInterfaceWrapper) DetectProxies(w http.ResponseWriter, r *http.Request)

DetectProxies operation middleware

func (*ServerInterfaceWrapper) ExchangeOAuth

func (siw *ServerInterfaceWrapper) ExchangeOAuth(w http.ResponseWriter, r *http.Request)

ExchangeOAuth operation middleware

func (*ServerInterfaceWrapper) GetAuthStatus

func (siw *ServerInterfaceWrapper) GetAuthStatus(w http.ResponseWriter, r *http.Request)

GetAuthStatus operation middleware

func (*ServerInterfaceWrapper) GetBookmarkDetail

func (siw *ServerInterfaceWrapper) GetBookmarkDetail(w http.ResponseWriter, r *http.Request)

GetBookmarkDetail operation middleware

func (*ServerInterfaceWrapper) GetConfig

func (siw *ServerInterfaceWrapper) GetConfig(w http.ResponseWriter, r *http.Request)

GetConfig operation middleware

func (*ServerInterfaceWrapper) GetConfigSchema

func (siw *ServerInterfaceWrapper) GetConfigSchema(w http.ResponseWriter, r *http.Request)

GetConfigSchema operation middleware

func (*ServerInterfaceWrapper) GetDownload

func (siw *ServerInterfaceWrapper) GetDownload(w http.ResponseWriter, r *http.Request)

GetDownload operation middleware

func (*ServerInterfaceWrapper) GetEvents

func (siw *ServerInterfaceWrapper) GetEvents(w http.ResponseWriter, r *http.Request)

GetEvents operation middleware

func (*ServerInterfaceWrapper) GetHealth

func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)

GetHealth operation middleware

func (*ServerInterfaceWrapper) GetIllust

func (siw *ServerInterfaceWrapper) GetIllust(w http.ResponseWriter, r *http.Request)

GetIllust operation middleware

func (*ServerInterfaceWrapper) GetSystemVersion

func (siw *ServerInterfaceWrapper) GetSystemVersion(w http.ResponseWriter, r *http.Request)

GetSystemVersion operation middleware

func (*ServerInterfaceWrapper) GetUgoiraMetadata

func (siw *ServerInterfaceWrapper) GetUgoiraMetadata(w http.ResponseWriter, r *http.Request)

GetUgoiraMetadata operation middleware

func (*ServerInterfaceWrapper) GetUpdateStatus

func (siw *ServerInterfaceWrapper) GetUpdateStatus(w http.ResponseWriter, r *http.Request)

GetUpdateStatus operation middleware

func (*ServerInterfaceWrapper) GetUser

GetUser operation middleware

func (*ServerInterfaceWrapper) ListDownloads

func (siw *ServerInterfaceWrapper) ListDownloads(w http.ResponseWriter, r *http.Request)

ListDownloads operation middleware

func (*ServerInterfaceWrapper) ListFollowingIllusts

func (siw *ServerInterfaceWrapper) ListFollowingIllusts(w http.ResponseWriter, r *http.Request)

ListFollowingIllusts operation middleware

func (*ServerInterfaceWrapper) ListRanking

func (siw *ServerInterfaceWrapper) ListRanking(w http.ResponseWriter, r *http.Request)

ListRanking operation middleware

func (*ServerInterfaceWrapper) ListRecommended

func (siw *ServerInterfaceWrapper) ListRecommended(w http.ResponseWriter, r *http.Request)

ListRecommended operation middleware

func (*ServerInterfaceWrapper) ListUserBookmarkTags

func (siw *ServerInterfaceWrapper) ListUserBookmarkTags(w http.ResponseWriter, r *http.Request)

ListUserBookmarkTags operation middleware

func (*ServerInterfaceWrapper) ListUserBookmarks

func (siw *ServerInterfaceWrapper) ListUserBookmarks(w http.ResponseWriter, r *http.Request)

ListUserBookmarks operation middleware

func (*ServerInterfaceWrapper) ListUserFollowing

func (siw *ServerInterfaceWrapper) ListUserFollowing(w http.ResponseWriter, r *http.Request)

ListUserFollowing operation middleware

func (*ServerInterfaceWrapper) ListUserIllusts

func (siw *ServerInterfaceWrapper) ListUserIllusts(w http.ResponseWriter, r *http.Request)

ListUserIllusts operation middleware

func (*ServerInterfaceWrapper) Login

Login operation middleware

func (*ServerInterfaceWrapper) Logout

Logout operation middleware

func (*ServerInterfaceWrapper) PatchConfig

func (siw *ServerInterfaceWrapper) PatchConfig(w http.ResponseWriter, r *http.Request)

PatchConfig operation middleware

func (*ServerInterfaceWrapper) PreviewNaming

func (siw *ServerInterfaceWrapper) PreviewNaming(w http.ResponseWriter, r *http.Request)

PreviewNaming operation middleware

func (*ServerInterfaceWrapper) ProxyImage

func (siw *ServerInterfaceWrapper) ProxyImage(w http.ResponseWriter, r *http.Request)

ProxyImage operation middleware

func (*ServerInterfaceWrapper) RemoveDownload

func (siw *ServerInterfaceWrapper) RemoveDownload(w http.ResponseWriter, r *http.Request)

RemoveDownload operation middleware

func (*ServerInterfaceWrapper) ResetConfig

func (siw *ServerInterfaceWrapper) ResetConfig(w http.ResponseWriter, r *http.Request)

ResetConfig operation middleware

func (*ServerInterfaceWrapper) RestartConfig

func (siw *ServerInterfaceWrapper) RestartConfig(w http.ResponseWriter, r *http.Request)

RestartConfig operation middleware

func (*ServerInterfaceWrapper) SearchIllusts

func (siw *ServerInterfaceWrapper) SearchIllusts(w http.ResponseWriter, r *http.Request)

SearchIllusts operation middleware

func (*ServerInterfaceWrapper) SearchUsers

func (siw *ServerInterfaceWrapper) SearchUsers(w http.ResponseWriter, r *http.Request)

SearchUsers operation middleware

func (*ServerInterfaceWrapper) StartOAuth

func (siw *ServerInterfaceWrapper) StartOAuth(w http.ResponseWriter, r *http.Request)

StartOAuth operation middleware

func (*ServerInterfaceWrapper) SubmitDownload

func (siw *ServerInterfaceWrapper) SubmitDownload(w http.ResponseWriter, r *http.Request)

SubmitDownload operation middleware

type SubmitDownloadJSONRequestBody

type SubmitDownloadJSONRequestBody = SubmitDownloadRequest

SubmitDownloadJSONRequestBody defines body for SubmitDownload for application/json ContentType.

type SubmitDownloadRequest

type SubmitDownloadRequest struct {
	// IllustId Pixiv illustration ID.
	IllustId int64 `json:"illust_id"`
}

SubmitDownloadRequest defines model for SubmitDownloadRequest.

type SystemVersion

type SystemVersion struct {
	Arch      string `json:"arch"`
	GoVersion string `json:"go_version"`
	Os        string `json:"os"`

	// Version Binary version (main.version), e.g. 3.0.0 or 0.1.0-dev.
	Version string `json:"version"`
}

SystemVersion defines model for SystemVersion.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UgoiraFrame

type UgoiraFrame = pixivgo.UgoiraFrame

UgoiraFrame defines model for UgoiraFrame.

type UgoiraMetadata

type UgoiraMetadata = pixivgo.UgoiraMetadata

UgoiraMetadata defines model for UgoiraMetadata.

type UgoiraMetadataResponse

type UgoiraMetadataResponse = pixivgo.UgoiraMetadataResponse

UgoiraMetadataResponse Ugoira (animated illust) metadata. Mirrors pixivgo.UgoiraMetadataResponse.

type UgoiraZipUrls

type UgoiraZipUrls = pixivgo.UgoiraZipUrls

UgoiraZipUrls defines model for UgoiraZipUrls.

type Unauthenticated

type Unauthenticated = Error

Unauthenticated defines model for Unauthenticated.

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented

type Unimplemented struct{}

func (Unimplemented) AddBookmark

func (_ Unimplemented) AddBookmark(w http.ResponseWriter, r *http.Request, id IllustIdPath)

Add or update an illust bookmark, preserving omitted fields (PUT /illusts/{id}/bookmark)

func (Unimplemented) AddFollow

func (_ Unimplemented) AddFollow(w http.ResponseWriter, r *http.Request, id UserIdPath)

Follow a user (PUT /users/{id}/follow)

func (Unimplemented) ApplyUpdate

func (_ Unimplemented) ApplyUpdate(w http.ResponseWriter, r *http.Request)

Download, verify, and apply the latest update, then restart (POST /system/update/apply)

func (Unimplemented) CancelDownload

func (_ Unimplemented) CancelDownload(w http.ResponseWriter, r *http.Request, id DownloadIdPath)

Cancel a running download job (POST /downloads/{id}/cancel)

func (Unimplemented) CheckConnectivity

func (_ Unimplemented) CheckConnectivity(w http.ResponseWriter, r *http.Request)

Check whether the backend can reach Pixiv (POST /auth/connectivity)

func (Unimplemented) CheckForUpdate

func (_ Unimplemented) CheckForUpdate(w http.ResponseWriter, r *http.Request)

Force an immediate update check against GitHub Releases (POST /system/update/check)

func (Unimplemented) ClearDownloads

func (_ Unimplemented) ClearDownloads(w http.ResponseWriter, r *http.Request, params ClearDownloadsParams)

Bulk-remove terminal download jobs from history (DELETE /downloads)

func (Unimplemented) DeleteBookmark

func (_ Unimplemented) DeleteBookmark(w http.ResponseWriter, r *http.Request, id IllustIdPath)

Remove an illust bookmark (DELETE /illusts/{id}/bookmark)

func (Unimplemented) DeleteFollow

func (_ Unimplemented) DeleteFollow(w http.ResponseWriter, r *http.Request, id UserIdPath)

Unfollow a user (DELETE /users/{id}/follow)

func (Unimplemented) DetectProxies

func (_ Unimplemented) DetectProxies(w http.ResponseWriter, r *http.Request)

Detect proxy candidates from the OS configuration (GET /auth/proxy/detect)

func (Unimplemented) ExchangeOAuth

func (_ Unimplemented) ExchangeOAuth(w http.ResponseWriter, r *http.Request)

Complete a browser-driven Pixiv OAuth login (POST /auth/oauth/exchange)

func (Unimplemented) GetAuthStatus

func (_ Unimplemented) GetAuthStatus(w http.ResponseWriter, r *http.Request)

Get current auth status (GET /auth/status)

func (Unimplemented) GetBookmarkDetail

func (_ Unimplemented) GetBookmarkDetail(w http.ResponseWriter, r *http.Request, id IllustIdPath)

Get current user's bookmark detail for an illust (GET /illusts/{id}/bookmark)

func (Unimplemented) GetConfig

func (_ Unimplemented) GetConfig(w http.ResponseWriter, r *http.Request)

Get the effective config + per-key source layering (GET /config)

func (Unimplemented) GetConfigSchema

func (_ Unimplemented) GetConfigSchema(w http.ResponseWriter, r *http.Request)

Get the JSON Schema describing all settings (GET /config/schema)

func (Unimplemented) GetDownload

func (_ Unimplemented) GetDownload(w http.ResponseWriter, r *http.Request, id DownloadIdPath)

Get a download job (GET /downloads/{id})

func (Unimplemented) GetEvents

func (_ Unimplemented) GetEvents(w http.ResponseWriter, r *http.Request, params GetEventsParams)

Subscribe to the event stream (GET /events)

func (Unimplemented) GetHealth

func (_ Unimplemented) GetHealth(w http.ResponseWriter, r *http.Request)

Check service health (GET /health)

func (Unimplemented) GetIllust

func (_ Unimplemented) GetIllust(w http.ResponseWriter, r *http.Request, id IllustIdPath)

Get illust detail (GET /illusts/{id})

func (Unimplemented) GetSystemVersion

func (_ Unimplemented) GetSystemVersion(w http.ResponseWriter, r *http.Request)

Get the running binary's version and build info (GET /system/version)

func (Unimplemented) GetUgoiraMetadata

func (_ Unimplemented) GetUgoiraMetadata(w http.ResponseWriter, r *http.Request, id IllustIdPath)

Get ugoira metadata (GET /illusts/{id}/ugoira)

func (Unimplemented) GetUpdateStatus

func (_ Unimplemented) GetUpdateStatus(w http.ResponseWriter, r *http.Request)

Get the cached update-check result (GET /system/update)

func (Unimplemented) GetUser

func (_ Unimplemented) GetUser(w http.ResponseWriter, r *http.Request, id UserIdPath, params GetUserParams)

Get a user's profile detail (GET /users/{id})

func (Unimplemented) ListDownloads

func (_ Unimplemented) ListDownloads(w http.ResponseWriter, r *http.Request, params ListDownloadsParams)

List download jobs (paginated) (GET /downloads)

func (Unimplemented) ListFollowingIllusts

func (_ Unimplemented) ListFollowingIllusts(w http.ResponseWriter, r *http.Request, params ListFollowingIllustsParams)

List illusts from followed users (GET /illusts/following)

func (Unimplemented) ListRanking

func (_ Unimplemented) ListRanking(w http.ResponseWriter, r *http.Request, params ListRankingParams)

List ranked illusts (GET /illusts/ranking)

func (Unimplemented) ListRecommended

func (_ Unimplemented) ListRecommended(w http.ResponseWriter, r *http.Request, params ListRecommendedParams)

List recommended illusts (GET /illusts/recommended)

func (Unimplemented) ListUserBookmarkTags

func (_ Unimplemented) ListUserBookmarkTags(w http.ResponseWriter, r *http.Request, id UserIdPath, params ListUserBookmarkTagsParams)

List bookmark tags and upstream counts for one visibility partition (GET /users/{id}/bookmark-tags)

func (Unimplemented) ListUserBookmarks

func (_ Unimplemented) ListUserBookmarks(w http.ResponseWriter, r *http.Request, id UserIdPath, params ListUserBookmarksParams)

List a user's bookmarks (GET /users/{id}/bookmarks)

func (Unimplemented) ListUserFollowing

func (_ Unimplemented) ListUserFollowing(w http.ResponseWriter, r *http.Request, id UserIdPath, params ListUserFollowingParams)

List users followed by a user (GET /users/{id}/following)

func (Unimplemented) ListUserIllusts

func (_ Unimplemented) ListUserIllusts(w http.ResponseWriter, r *http.Request, id UserIdPath, params ListUserIllustsParams)

List illusts by a user (GET /users/{id}/illusts)

func (Unimplemented) Login

func (_ Unimplemented) Login(w http.ResponseWriter, r *http.Request)

Log in with a refresh token (POST /auth/login)

func (Unimplemented) Logout

func (_ Unimplemented) Logout(w http.ResponseWriter, r *http.Request)

Log out the current session (POST /auth/logout)

func (Unimplemented) PatchConfig

func (_ Unimplemented) PatchConfig(w http.ResponseWriter, r *http.Request)

Merge a partial update into the persisted overrides (PATCH /config)

func (Unimplemented) PreviewNaming

func (_ Unimplemented) PreviewNaming(w http.ResponseWriter, r *http.Request)

Render the download naming templates against a fixed sample work (POST /config/naming/preview)

func (Unimplemented) ProxyImage

func (_ Unimplemented) ProxyImage(w http.ResponseWriter, r *http.Request, params ProxyImageParams)

Proxy and cache a Pixiv image (GET /proxy/img)

func (Unimplemented) RemoveDownload

func (_ Unimplemented) RemoveDownload(w http.ResponseWriter, r *http.Request, id DownloadIdPath)

Remove a download job from history (DELETE /downloads/{id})

func (Unimplemented) ResetConfig

func (_ Unimplemented) ResetConfig(w http.ResponseWriter, r *http.Request)

Drop overrides from the file layer (per key or wholesale) (POST /config/reset)

func (Unimplemented) RestartConfig

func (_ Unimplemented) RestartConfig(w http.ResponseWriter, r *http.Request)

Gracefully restart the process to apply restart-required settings (POST /config/restart)

func (Unimplemented) SearchIllusts

func (_ Unimplemented) SearchIllusts(w http.ResponseWriter, r *http.Request, params SearchIllustsParams)

Search illusts (GET /search/illusts)

func (Unimplemented) SearchUsers

func (_ Unimplemented) SearchUsers(w http.ResponseWriter, r *http.Request, params SearchUsersParams)

Search users (GET /search/users)

func (Unimplemented) StartOAuth

func (_ Unimplemented) StartOAuth(w http.ResponseWriter, r *http.Request)

Begin a browser-driven Pixiv OAuth (PKCE) login (POST /auth/oauth/start)

func (Unimplemented) SubmitDownload

func (_ Unimplemented) SubmitDownload(w http.ResponseWriter, r *http.Request)

Submit a download job (POST /downloads)

type UnknownStatusError

type UnknownStatusError struct {
	Value string
}

UnknownStatusError covers the `?status=…` CSV in the downloads handlers — the only inline `Error{}` construction outside writeError before this refactor. Promoting it to a typed error puts both call sites back on the normal writeError path.

func (*UnknownStatusError) APICode

func (*UnknownStatusError) APICode() ErrorCode

func (*UnknownStatusError) Error

func (e *UnknownStatusError) Error() string

func (*UnknownStatusError) UserMessage

func (e *UnknownStatusError) UserMessage() string

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type UpdateApplyAccepted

type UpdateApplyAccepted struct {
	// Status Always `updating`.
	Status string `json:"status"`
}

UpdateApplyAccepted defines model for UpdateApplyAccepted.

type UpdateStatus

type UpdateStatus struct {
	// AssetName The release archive matching this OS/arch (the file Apply downloads).
	AssetName *string `json:"asset_name,omitempty"`

	// CurrentVersion The running binary's version.
	CurrentVersion string `json:"current_version"`

	// IsDev Running a dev/non-release build (e.g. `0.1.0-dev`, a `go run`, or a
	// git-describe build). Updates are never offered or applied for these.
	IsDev bool `json:"is_dev"`

	// LastChecked When this status was produced; absent if never checked.
	LastChecked *time.Time `json:"last_checked,omitempty"`

	// LastError Human-safe error from the most recent check, if any.
	LastError *string `json:"last_error,omitempty"`

	// LatestVersion Newest applicable release tag (normalized, e.g. v3.1.0). Empty until a check succeeds.
	LatestVersion *string `json:"latest_version,omitempty"`

	// PublishedAt When `latest_version` was published.
	PublishedAt *time.Time `json:"published_at,omitempty"`

	// ReleaseNotes Release body (markdown) as published on GitHub.
	ReleaseNotes *string `json:"release_notes,omitempty"`

	// ReleaseUrl GitHub release page for `latest_version`.
	ReleaseUrl *string `json:"release_url,omitempty"`

	// UpdateAvailable A newer release exists AND this is a real release build.
	UpdateAvailable bool `json:"update_available"`
}

UpdateStatus defines model for UpdateStatus.

type Upstream

type Upstream = Error

Upstream defines model for Upstream.

type User

type User = pixivgo.UserInfo

User Pixiv user summary. Shape mirrors pixivgo.UserInfo.

type UserBookmarkTag

type UserBookmarkTag = pixivgo.UserBookmarkTag

UserBookmarkTag defines model for UserBookmarkTag.

type UserDetailPage

type UserDetailPage struct {
	// Profile Pixiv user profile. Shape mirrors pixivgo.Profile.
	Profile Profile `json:"profile"`

	// ProfilePublicity Pixiv profile publicity flags. Shape mirrors pixivgo.ProfilePublicity.
	ProfilePublicity ProfilePublicity `json:"profile_publicity"`

	// User Pixiv user summary. Shape mirrors pixivgo.UserInfo.
	User User `json:"user"`

	// Workspace Pixiv workspace info. Shape mirrors pixivgo.Workspace.
	Workspace Workspace `json:"workspace"`
}

UserDetailPage defines model for UserDetailPage.

type UserError

type UserError interface {
	error
	UserMessage() string
	APICode() ErrorCode
}

UserError lets a service-layer error opt into "safe to display": the classify dispatcher will surface .UserMessage() as Error.message with kind=app and use .APICode() as the wire code. Without this opt-in, errors fall through to kind=internal with an empty Message (the frontend localizes via code), guaranteeing raw err.Error() text never reaches the client.

type UserIdPath

type UserIdPath = int64

UserIdPath defines model for UserIdPath.

type UserIllustsPage

type UserIllustsPage struct {
	Illusts    []Illust `json:"illusts"`
	NextOffset *int64   `json:"next_offset,omitempty"`

	// User Pixiv user summary. Shape mirrors pixivgo.UserInfo.
	User User `json:"user"`
}

UserIllustsPage defines model for UserIllustsPage.

type UserPreview

type UserPreview = pixivgo.UserPreview

UserPreview User + a few sample illusts. Shape mirrors pixivgo.UserPreview.

type UserPreviewPage

type UserPreviewPage struct {
	NextOffset   *int64        `json:"next_offset,omitempty"`
	UserPreviews []UserPreview `json:"user_previews"`
}

UserPreviewPage defines model for UserPreviewPage.

type ValidationError

type ValidationError struct{ Fields map[string]string }

ValidationError contains only authored field messages, never decoder or upstream text. It uses the same wire shape as settings validation.

func (*ValidationError) Error

func (e *ValidationError) Error() string

type Workspace

type Workspace = pixivgo.Workspace

Workspace Pixiv workspace info. Shape mirrors pixivgo.Workspace.

Jump to

Keyboard shortcuts

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