payloads

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: AGPL-3.0 Imports: 2 Imported by: 1 module, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBatchPayload

type AccountBatchPayload struct {
	IDs    []int  `json:"ids"`
	Action string `json:"action"`
}

AccountBatchPayload mirrors TS AccountBatchPayload.

type AccountCreatePayload

type AccountCreatePayload struct {
	SiteID         int      `json:"siteId"`
	Username       *string  `json:"username,omitempty"`
	AccessToken    *string  `json:"accessToken,omitempty"`
	AccessTokens   []string `json:"accessTokens,omitempty"`
	APIToken       *string  `json:"apiToken,omitempty"`
	PlatformUserID *int     `json:"platformUserId,omitempty"`
	ProxyURL       *string  `json:"proxyUrl,omitempty"`
	CheckinEnabled *bool    `json:"checkinEnabled,omitempty"`
	CredentialMode *string  `json:"credentialMode,omitempty"`
	RefreshToken   *string  `json:"refreshToken,omitempty"`
	TokenExpiresAt *int64   `json:"tokenExpiresAt,omitempty"`
	SkipModelFetch *bool    `json:"skipModelFetch,omitempty"`
}

AccountCreatePayload mirrors TS AccountCreatePayload.

type AccountHealthRefreshPayload

type AccountHealthRefreshPayload struct {
	AccountID *int  `json:"accountId,omitempty"`
	Wait      *bool `json:"wait,omitempty"`
}

AccountHealthRefreshPayload mirrors TS AccountHealthRefreshPayload.

type AccountLoginPayload

type AccountLoginPayload struct {
	SiteID   int    `json:"siteId"`
	Username string `json:"username"`
	Password string `json:"password"`
}

AccountLoginPayload mirrors TS AccountLoginPayload.

type AccountManualModelsPayload

type AccountManualModelsPayload struct {
	Models []string `json:"models"`
}

AccountManualModelsPayload mirrors TS AccountManualModelsPayload.

type AccountRebindSessionPayload

type AccountRebindSessionPayload struct {
	AccessToken    *string `json:"accessToken,omitempty"`
	PlatformUserID *int    `json:"platformUserId,omitempty"`
	RefreshToken   *string `json:"refreshToken,omitempty"`
	TokenExpiresAt *int64  `json:"tokenExpiresAt,omitempty"`
}

AccountRebindSessionPayload mirrors TS AccountRebindSessionPayload.

type AccountTokenBatchPayload

type AccountTokenBatchPayload struct {
	IDs    []int  `json:"ids"`
	Action string `json:"action"`
}

AccountTokenBatchPayload mirrors TS AccountTokenBatchPayload.

type AccountTokenCreatePayload

type AccountTokenCreatePayload struct {
	AccountID          int     `json:"accountId"`
	Name               *string `json:"name,omitempty"`
	Token              *string `json:"token,omitempty"`
	Enabled            *bool   `json:"enabled,omitempty"`
	IsDefault          *bool   `json:"isDefault,omitempty"`
	Source             *string `json:"source,omitempty"`
	Group              *string `json:"group,omitempty"`
	UnlimitedQuota     *bool   `json:"unlimitedQuota,omitempty"`
	RemainQuota        any     `json:"remainQuota,omitempty"`
	ExpiredTime        any     `json:"expiredTime,omitempty"`
	AllowIPs           *string `json:"allowIps,omitempty"`
	ModelLimitsEnabled *bool   `json:"modelLimitsEnabled,omitempty"`
	ModelLimits        *string `json:"modelLimits,omitempty"`
}

AccountTokenCreatePayload mirrors TS AccountTokenCreatePayload.

type AccountTokenSyncAllPayload

type AccountTokenSyncAllPayload struct {
	Wait *bool `json:"wait,omitempty"`
}

AccountTokenSyncAllPayload mirrors TS AccountTokenSyncAllPayload.

type AccountTokenUpdatePayload

type AccountTokenUpdatePayload struct {
	Name      *string `json:"name,omitempty"`
	Token     *string `json:"token,omitempty"`
	Group     *string `json:"group,omitempty"`
	Enabled   *bool   `json:"enabled,omitempty"`
	IsDefault *bool   `json:"isDefault,omitempty"`
	Source    *string `json:"source,omitempty"`
}

AccountTokenUpdatePayload mirrors TS AccountTokenUpdatePayload.

type AccountUpdatePayload

type AccountUpdatePayload struct {
	Username       *string  `json:"username,omitempty"`
	AccessToken    *string  `json:"accessToken,omitempty"`
	APIToken       any      `json:"apiToken,omitempty"`
	Status         *string  `json:"status,omitempty"`
	CheckinEnabled *bool    `json:"checkinEnabled,omitempty"`
	UnitCost       *float64 `json:"unitCost,omitempty"`
	ExtraConfig    any      `json:"extraConfig,omitempty"`
	RefreshToken   *string  `json:"refreshToken,omitempty"`
	TokenExpiresAt *int64   `json:"tokenExpiresAt,omitempty"`
	IsPinned       *bool    `json:"isPinned,omitempty"`
	SortOrder      *int     `json:"sortOrder,omitempty"`
	ProxyURL       *string  `json:"proxyUrl,omitempty"`
	Remark         *string  `json:"remark,omitempty"`
	// PlatformUserID is merged into extraConfig (same storage as the create
	// path) so session-account edits persist it instead of dropping it.
	PlatformUserID *int `json:"platformUserId,omitempty"`
	// SkipModelFetch is merged into extraConfig (same storage as create).
	SkipModelFetch *bool `json:"skipModelFetch,omitempty"`
	// CredentialMode is the mode the edit form saves (session | apikey). It was
	// absent from this payload, so the handler never saw it and a saved switch
	// silently kept the old mode (#1176).
	CredentialMode *string `json:"credentialMode,omitempty"`
	// Tags is stored in accounts.tags as a JSON array text (see tags.go).
	Tags *[]string `json:"tags,omitempty"`
}

AccountUpdatePayload mirrors TS AccountUpdatePayload.

type AccountVerifyTokenPayload

type AccountVerifyTokenPayload struct {
	SiteID         int     `json:"siteId"`
	AccessToken    *string `json:"accessToken,omitempty"`
	PlatformUserID *int    `json:"platformUserId,omitempty"`
	ProxyURL       *string `json:"proxyUrl,omitempty"`
	CredentialMode *string `json:"credentialMode,omitempty"`
}

AccountVerifyTokenPayload mirrors TS AccountVerifyTokenPayload.

type NullableBool added in v0.16.6

type NullableBool struct {
	Value   bool
	Present bool
	Null    bool
}

NullableBool decodes a JSON `true` / `false` / `null` value while remembering whether the key was present at all, so handlers can distinguish the three update intents the frontend form sends:

absent         → leave the stored value untouched
null           → clear the override (store NULL / inherit global default)
true / false   → store the explicit per-row override

Fields should be declared as *NullableBool with omitempty so a missing JSON key leaves the pointer nil. Used by sites.resinEnabled / useUtls (z.boolean().nullable() on the frontend).

func (*NullableBool) UnmarshalJSON added in v0.16.6

func (n *NullableBool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for the tri-state wire value.

type ProbeNowBody

type ProbeNowBody struct {
	Scope              *string `json:"scope,omitempty"`
	ModelName          *string `json:"modelName,omitempty"`
	LatencyThresholdMs *int    `json:"latencyThresholdMs,omitempty"`
}

ProbeNowBody is the JSON body for POST /api/sites/:id/probe-now.

type SiteAPIEndpointInput

type SiteAPIEndpointInput struct {
	URL       string `json:"url"`
	Enabled   bool   `json:"enabled"`
	SortOrder int    `json:"sortOrder"`
}

SiteAPIEndpointInput is an embedded sub-resource input for apiEndpoints.

type SiteBatchPayload

type SiteBatchPayload struct {
	IDs    []int  `json:"ids"`
	Action string `json:"action"`
}

SiteBatchPayload mirrors TS SiteBatchPayload.

type SiteCreatePayload

type SiteCreatePayload struct {
	Name                   string  `json:"name"`
	URL                    string  `json:"url"`
	Platform               *string `json:"platform,omitempty"`
	InitializationPresetID *string `json:"initializationPresetId,omitempty"`
	ProxyURL               *string `json:"proxyUrl,omitempty"`
	UseSystemProxy         *bool   `json:"useSystemProxy,omitempty"`
	CustomHeaders          *string `json:"customHeaders,omitempty"`
	// CustomHeadersOverrideRequestHeaders: when true, site custom headers
	// overwrite same-name request headers (site-wins). Default false = request-wins.
	CustomHeadersOverrideRequestHeaders *bool    `json:"customHeadersOverrideRequestHeaders,omitempty"`
	ExternalCheckinURL                  *string  `json:"externalCheckinUrl,omitempty"`
	Status                              *string  `json:"status,omitempty"`
	IsPinned                            *bool    `json:"isPinned,omitempty"`
	SortOrder                           *int     `json:"sortOrder,omitempty"`
	GlobalWeight                        *float64 `json:"globalWeight,omitempty"`
	// MaxConcurrency caps concurrent upstream calls for this site (0 = unlimited).
	MaxConcurrency *int64                 `json:"maxConcurrency,omitempty"`
	APIEndpoints   []SiteAPIEndpointInput `json:"apiEndpoints,omitempty"`
	// ResinEnabled / UseUTLS are nullable per-site overrides: true/false set
	// the override, null clears it back to inheriting the global flag. Value
	// types (not pointers) so a JSON null reaches UnmarshalJSON — a *T field
	// would be left nil by encoding/json and null/absent would be
	// indistinguishable.
	ResinEnabled NullableBool `json:"resinEnabled"`
	UseUTLS      NullableBool `json:"useUtls"`
}

SiteCreatePayload mirrors TS SiteCreatePayload (siteRoutePayloads.ts).

type SiteDetectPayload

type SiteDetectPayload struct {
	URL string `json:"url"`
}

SiteDetectPayload mirrors TS SiteDetectPayload.

type SiteDisabledModelsPayload

type SiteDisabledModelsPayload struct {
	Models []string `json:"models"`
}

SiteDisabledModelsPayload mirrors TS SiteDisabledModelsPayload.

type SiteImportAccount added in v0.11.0

type SiteImportAccount struct {
	Username    *string `json:"username,omitempty"`
	AccessToken string  `json:"accessToken,omitempty"`
	APIToken    string  `json:"apiToken,omitempty"`
}

SiteImportAccount mirrors an account to attach during batch import.

type SiteImportItem added in v0.11.0

type SiteImportItem struct {
	Name              string              `json:"name"`
	URL               string              `json:"url"`
	Platform          *string             `json:"platform,omitempty"`
	GlobalWeight      *float64            `json:"globalWeight,omitempty"`
	MaxConcurrency    *int64              `json:"maxConcurrency,omitempty"`
	DuplicateStrategy string              `json:"duplicateStrategy,omitempty"`
	Accounts          []SiteImportAccount `json:"accounts,omitempty"`
}

SiteImportItem is one candidate site in POST /api/sites/import.

type SiteImportPayload added in v0.11.0

type SiteImportPayload struct {
	Items             []SiteImportItem `json:"items"`
	DuplicateStrategy string           `json:"duplicateStrategy,omitempty"`
}

SiteImportPayload is the JSON body for POST /api/sites/import.

type SiteUpdatePayload

type SiteUpdatePayload struct {
	Name           *string `json:"name,omitempty"`
	URL            *string `json:"url,omitempty"`
	Platform       *string `json:"platform,omitempty"`
	ProxyURL       *string `json:"proxyUrl,omitempty"`
	UseSystemProxy *bool   `json:"useSystemProxy,omitempty"`
	CustomHeaders  *string `json:"customHeaders,omitempty"`
	// CustomHeadersOverrideRequestHeaders: opt-in site-wins for same-name headers.
	CustomHeadersOverrideRequestHeaders *bool    `json:"customHeadersOverrideRequestHeaders,omitempty"`
	ExternalCheckinURL                  *string  `json:"externalCheckinUrl,omitempty"`
	Status                              *string  `json:"status,omitempty"`
	IsPinned                            *bool    `json:"isPinned,omitempty"`
	SortOrder                           *int     `json:"sortOrder,omitempty"`
	GlobalWeight                        *float64 `json:"globalWeight,omitempty"`
	// MaxConcurrency caps concurrent upstream calls for this site (0 = unlimited).
	MaxConcurrency                     *int64                 `json:"maxConcurrency,omitempty"`
	APIEndpoints                       []SiteAPIEndpointInput `json:"apiEndpoints,omitempty"`
	PostRefreshProbeEnabled            *bool                  `json:"postRefreshProbeEnabled,omitempty"`
	PostRefreshProbeModel              *string                `json:"postRefreshProbeModel,omitempty"`
	PostRefreshProbeScope              *string                `json:"postRefreshProbeScope,omitempty"`
	PostRefreshProbeLatencyThresholdMs *int                   `json:"postRefreshProbeLatencyThresholdMs,omitempty"`
	// ResinEnabled / UseUTLS are nullable per-site overrides: true/false set
	// the override, null clears it back to inheriting the global flag. Value
	// types (not pointers) so a JSON null reaches UnmarshalJSON.
	ResinEnabled NullableBool `json:"resinEnabled"`
	UseUTLS      NullableBool `json:"useUtls"`
}

SiteUpdatePayload mirrors TS SiteUpdatePayload.

Jump to

Keyboard shortcuts

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