Versions in this module Expand all Collapse all v0 v0.2.0-beta.10 Oct 9, 2026 v0.2.0-beta.9 Oct 9, 2026 v0.2.0-beta.8 Oct 8, 2026 v0.2.0-beta.7 Oct 7, 2026 v0.2.0-beta.3 Oct 4, 2026 v0.2.0-beta.2 Sep 21, 2026 v0.2.0-beta.1 Sep 20, 2026 v0.1.1 Aug 29, 2026 Changes in this version + const AccessTokenTTL + const BillingSourceSubscription + const BillingSourceWallet + const CSAMViolationMarker + const ContentViolatesUsageMarker + const LoginSessionTTL + const RefreshCookieName + const RefreshReplayWindow + const SecurityProofTTL + const ViolationFeeCodePrefix + var ErrAuthTokenExpired = errors.New("authentication token has expired") + var ErrAuthTokenInvalid = errors.New("authentication token is invalid") + var ErrInsufficientWalletQuota = errors.New("wallet quota insufficient") + var ErrLoginSessionInvalid = errors.New("login session is invalid") + var ErrLoginSessionMismatch = errors.New("login session does not match the expected session") + var ErrLoginSessionRevoked = errors.New("login session is revoked") + var ErrProofMethod = errors.New("security proof method mismatch") + var ErrProofScope = errors.New("security proof scope mismatch") + var ErrRefreshRace = errors.New("refresh token was already rotated") + var ErrRefreshTokenInvalid = errors.New("refresh token is invalid") + var GetTaskAdaptorFunc func(platform constant.TaskPlatform) TaskPollingAdaptor + func AcSearch(findText string, dict []string, stopImmediately bool) (bool, []string) + func AppendChannelAffinityAdminInfo(c *gin.Context, adminInfo map[string]interface{}) + func ApplyChannelAffinityOverrideTemplate(c *gin.Context, paramOverride map[string]interface{}) (map[string]interface{}, bool) + func AuthSessionErrorCode(err error) (int, string) + func BuildCodexOAuthAuthorizeURL(state string, challenge string) (string, error) + func BuildTieredTokenParams(usage *dto.Usage, isClaudeUsageSemantic bool, usedVars map[string]bool) billingexpr.TokenParams + func CacheGetRandomSatisfiedChannel(param *RetryParam) (*model.Channel, string, error) + func CalcOpenRouterCacheCreateTokens(usage dto.Usage, priceData types.PriceData) int + func ChargeViolationFeeIfNeeded(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, apiErr *types.NewAPIError) bool + func ChatCompletionsRequestToResponsesRequest(req *dto.GeneralOpenAIRequest) (*dto.OpenAIResponsesRequest, error) + func ChatCompletionsResponseToResponsesResponse(resp *dto.OpenAITextResponse, id string) (*dto.OpenAIResponsesResponse, *dto.Usage, error) + func CheckNotificationLimit(userId int, notifyType string) (bool, error) + func CheckSensitiveMessages(messages []dto.Message) ([]string, error) + func CheckSensitiveText(text string) (bool, []string) + func ClaudeErrorWrapper(err error, code string, statusCode int) *dto.ClaudeErrorWithStatusCode + func ClaudeErrorWrapperLocal(err error, code string, statusCode int) *dto.ClaudeErrorWithStatusCode + func ClaudeToOpenAIRequest(claudeRequest dto.ClaudeRequest, info *relaycommon.RelayInfo) (*dto.GeneralOpenAIRequest, error) + func CleanupFileSources(c *gin.Context) + func ClearChannelAffinityCacheAll() int + func ClearChannelAffinityCacheByRuleName(ruleName string) (int, error) + func ClearCurrentChannelAffinityCache(c *gin.Context) bool + func ClearRefreshCookie(c *gin.Context) + func CloseResponseBodyGracefully(httpResponse *http.Response) + func ConsumeCodexWhamRateLimitResetCredit(ctx context.Context, client *http.Client, baseURL string, accessToken string, ...) (statusCode int, body []byte, err error) + func ConvertRequest(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, ...) (*relayconvert.RequestResult, error) + func ConvertRequestByID(c *gin.Context, info *relaycommon.RelayInfo, converter string, request any) (*relayconvert.RequestResult, error) + func ConvertRequestVia(c *gin.Context, info *relaycommon.RelayInfo, request any, ...) (*relayconvert.RequestResult, error) + func ConvertSimpleChangeParams(content string) *dto.MidjourneyRequest + func CountAudioTokenInput(audioBase64 string, audioFormat string) (int, error) + func CountAudioTokenOutput(audioBase64 string, audioFormat string) (int, error) + func CountTextToken(text string, model string) int + func CountTokenInput(input any, model string) int + func CountTokenRealtime(info *relaycommon.RelayInfo, request dto.RealtimeEvent, model string) (int, int, error) + func CoverPlusActionToNormalAction(midjRequest *dto.MidjourneyRequest) *dto.MidjourneyResponse + func CoverTaskActionToModelName(platform constant.TaskPlatform, action string) string + func CovertMjpActionToModelName(mjAction string) string + func CreateWaffoPancakePrimaryProduct(ctx context.Context, merchantID, privateKey, storeID, returnURL string) (string, error) + func CreateWaffoPancakePrimaryStore(ctx context.Context, merchantID, privateKey string) (string, error) + func CreateWaffoPancakeProductForPlan(ctx context.Context, ...) (string, error) + func DecodeBase64AudioData(audioBase64 string) (string, error) + func DecodeBase64FileData(base64String string) (string, string, error) + func DecodeBase64ImageData(base64String string) (image.Config, string, string, error) + func DecodeUrlImageData(imageUrl string) (image.Config, string, error) + func DetectFileType(mimeType string) types.FileType + func DisableChannel(channelError types.ChannelError, reason string) + func DispatchPlatformUpdate(ctx context.Context, platform constant.TaskPlatform, ...) + func DoDownloadRequest(originUrl string, reason ...string) (resp *http.Response, err error) + func DoMidjourneyHttpRequest(c *gin.Context, timeout time.Duration, fullRequestURL string) (*dto.MidjourneyResponseWithStatusCode, []byte, error) + func DoWorkerRequest(req *WorkerRequest) (*http.Response, error) + func EnableChannel(channelId int, usingKey string, channelName string) + func EnqueueSystemTask(taskType string, payload any) (*model.SystemTask, bool, error) + func EstimateRequestToken(c *gin.Context, meta *types.TokenCountMeta, info *relaycommon.RelayInfo) (int, error) + func EstimateToken(provider Provider, text string) int + func EstimateTokenByModel(model, text string) int + func ExtractCodexAccountIDFromJWT(token string) (string, bool) + func ExtractEmailFromJWT(token string) (string, bool) + func ExtractOutputTextFromResponses(resp *dto.OpenAIResponsesResponse) string + func FetchCodexChannelModels(channel *model.Channel) ([]string, error) + func FetchCodexModels(ctx context.Context, client *http.Client, baseURL string, ...) (statusCode int, models []string, err error) + func FetchCodexWhamRateLimitResetCredits(ctx context.Context, client *http.Client, baseURL string, accessToken string, ...) (statusCode int, body []byte, err error) + func FetchCodexWhamUsage(ctx context.Context, client *http.Client, baseURL string, accessToken string, ...) (statusCode int, body []byte, err error) + func FilterUserTokenAutoGroups(userGroup string, groups []string) []string + func FormatAuthError(err error) string + func GeminiToOpenAIRequest(geminiRequest *dto.GeminiChatRequest, info *relaycommon.RelayInfo) (*dto.GeneralOpenAIRequest, error) + func GenerateAudioOtherInfo(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.Usage, ...) map[string]interface + func GenerateClaudeOtherInfo(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, ...) map[string]interface + func GenerateMjOtherInfo(relayInfo *relaycommon.RelayInfo, priceData hosttypes.PriceData) map[string]interface + func GenerateTextOtherInfo(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, ...) map[string]interface + func GenerateWssOtherInfo(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.RealtimeUsage, ...) map[string]interface + func GetBase64Data(c *gin.Context, source types.FileSource, reason ...string) (string, string, error) + func GetCallbackAddress() string + func GetFileBase64FromUrl(c *gin.Context, url string, reason ...string) (*types.LocalFileData, error) + func GetFileTypeFromUrl(c *gin.Context, url string, reason ...string) (string, error) + func GetGroupsEnabledModels(groups []string) []string + func GetHttpClient() *http.Client + func GetHttpClientWithProxy(rawProxyURL string) (*http.Client, error) + func GetHttpClientWithProxySettings(rawProxyURL string, settings dto.ChannelSettings) (*http.Client, error) + func GetImageConfig(c *gin.Context, source types.FileSource) (image.Config, string, error) + func GetImageFromUrl(url string) (mimeType string, data string, err error) + func GetLatestCodexClientVersion(ctx context.Context, client *http.Client) (string, error) + func GetMimeType(c *gin.Context, source types.FileSource) (string, error) + func GetMimeTypeByExtension(ext string) string + func GetMjRequestModel(relayMode int, midjRequest *dto.MidjourneyRequest) (string, *dto.MidjourneyResponse, bool) + func GetPreferredChannelByAffinity(c *gin.Context, modelName string, usingGroup string) (int, bool) + func GetRequestAutoGroups(c *gin.Context, userGroup string) []string + func GetSSRFProtectedHTTPClient() *http.Client + func GetUserAutoGroup(userGroup string) []string + func GetUserGroupRatio(userGroup, group string) float64 + func GetUserUsableGroups(userGroup string) map[string]string + func GroupInUserUsableGroups(userGroup, groupName string) bool + func HasCSAMViolationMarker(err *types.NewAPIError) bool + func IOCopyBytesGracefully(c *gin.Context, src *http.Response, data []byte) + func InitAc(dict []string) *goahocorasick.Machine + func InitHttpClient() + func InitTokenEncoders() + func InjectTieredBillingInfo(other map[string]interface{}, relayInfo *relaycommon.RelayInfo, ...) + func InvalidateProxyClient(rawProxyURL string) + func IsUserSelectableGroup(userGroup, groupName string) bool + func IsViolationFeeCode(code types.ErrorCode) bool + func IssueAccessToken(identity AuthIdentity) (string, int64, error) + func IssueSecurityProof(identity AuthIdentity, method string, scopes []string) (string, int64, error) + func LoadFileSource(c *gin.Context, source types.FileSource, reason ...string) (*types.CachedFileData, error) + func LogTaskConsumption(c *gin.Context, info *relaycommon.RelayInfo) + func MarkChannelAffinityUsed(c *gin.Context, selectedGroup string, channelID int) + func MidjourneyErrorWithStatusCodeWrapper(code int, desc string, statusCode int) *taskdto.MidjourneyResponseWithStatusCode + func MidjourneyErrorWrapper(code int, desc string) *taskdto.MidjourneyResponse + func NewProxyHttpClient(proxyURL string) (*http.Client, error) + func NewSystemTaskProgressReporter(task *model.SystemTask, runnerID string) func(processed, total int) + func NormalizeCacheCreationSplit(totalTokens int, tokens5m int, tokens1h int) (int, int) + func NormalizeProxyURL(rawProxyURL string) (string, error) + func NormalizeViolationFeeError(err *types.NewAPIError) *types.NewAPIError + func NotifyRootUser(t string, subject string, content string) + func NotifyUpstreamModelUpdateWatchers(subject string, content string) + func NotifyUser(userId int, userEmail string, userSetting dto.UserSetting, data dto.Notify) error + func ObserveChannelAffinityUsageCacheByRelayFormat(c *gin.Context, usage *dto.Usage, relayFormat types.RelayFormat) + func ObserveChannelAffinityUsageCacheFromContext(c *gin.Context, usage *dto.Usage, cachedTokenRateMode string) + func PaymentReturnURL(suffix string) string + func PostAudioConsumeQuota(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.Usage, ...) + func PostConsumeQuota(relayInfo *relaycommon.RelayInfo, quota int, preConsumedQuota int, ...) error + func PostTextConsumeQuota(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.Usage, ...) + func PostWssConsumeQuota(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, modelName string, ...) + func PreConsumeBilling(c *gin.Context, preConsumedQuota int, relayInfo *relaycommon.RelayInfo) *types.NewAPIError + func PreConsumeTokenQuota(relayInfo *relaycommon.RelayInfo, quota int) error + func PreWssConsumeQuota(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.RealtimeUsage) error + func PrepareMidjourneyTaskBilling(relayInfo *relaycommon.RelayInfo, task *model.Midjourney, quota int, ...) (bool, error) + func PrepareTieredBillingForSelectedGroup(c *gin.Context, relayInfo *relaycommon.RelayInfo) *types.NewAPIError + func RecalculateTaskQuota(ctx context.Context, task *model.Task, actualQuota int, reason string, ...) + func RecalculateTaskQuotaByTokens(ctx context.Context, task *model.Task, totalTokens int) + func RecordChannelAffinity(c *gin.Context, channelID int) + func RefreshTokenSID(rawRefreshToken string) (string, bool) + func RefundMidjourneyQuota(ctx context.Context, task *model.Midjourney, reason string) bool + func RefundTaskQuota(ctx context.Context, task *model.Task, reason string) bool + func RegisterSystemTaskHandler(h SystemTaskHandler) + func RelayErrorHandler(ctx context.Context, resp *http.Response, showBodyWhenFail bool) (newApiErr *types.NewAPIError) + func RemoveDuplicate(s []string) []string + func ReportCurrentSystemInstance() error + func ResetProxyClientCache() + func ResetStatusCode(newApiErr *types.NewAPIError, statusCodeMappingStr string) + func ResolveWaffoPancakeSubscriptionTradeNo(event *WaffoPancakeWebhookEvent) (string, error) + func ResolveWaffoPancakeTradeNo(event *WaffoPancakeWebhookEvent) (string, error) + func ResponseOpenAI2Claude(openAIResponse *dto.OpenAITextResponse, info *relaycommon.RelayInfo) *dto.ClaudeResponse + func ResponseOpenAI2Gemini(openAIResponse *dto.OpenAITextResponse, info *relaycommon.RelayInfo) *dto.GeminiChatResponse + func ResponseText2Usage(c *gin.Context, responseText string, modeName string, promptTokens int) *dto.Usage + func ResponsesFinishReasonFromStatus(resp *dto.OpenAIResponsesResponse) (string, bool) + func ResponsesRequestToChatCompletionsRequest(req *dto.OpenAIResponsesRequest) (*dto.GeneralOpenAIRequest, error) + func ResponsesResponseToChatCompletionsResponse(resp *dto.OpenAIResponsesResponse, id string) (*dto.OpenAITextResponse, *dto.Usage, error) + func RevokeByRefreshToken(rawRefreshToken, expectedSID, reason string) error + func SaveWaffoPancakeConfig(ctx context.Context, ...) error + func SendWebhookNotify(webhookURL string, secret string, data dto.Notify) error + func SensitiveWordContains(text string) (bool, []string) + func SensitiveWordReplace(text string, returnImmediately bool) (bool, []string, string) + func SettleBilling(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, actualQuota int) error + func SettleMidjourneyTaskBilling(relayInfo *relaycommon.RelayInfo, task *model.Midjourney, prepared bool) (bool, error) + func ShouldChatCompletionsUseResponsesGlobal(channelID int, channelType int, model string) bool + func ShouldChatCompletionsUseResponsesPolicy(policy model_setting.ChatCompletionsToResponsesPolicy, channelID int, ...) bool + func ShouldCopyUpstreamHeader(c *gin.Context, k string, v []string) bool + func ShouldDisableChannel(err *types.NewAPIError) bool + func ShouldEnableChannel(newAPIError *types.NewAPIError, status int) bool + func ShouldKeepChannelAffinityOnChannelDisabled() bool + func ShouldSkipRetryAfterChannelAffinityFailure(c *gin.Context) bool + func StartAuthArtifactCleanup() + func StartCodexCredentialAutoRefreshTask() + func StartLogCleanupTask(targetTimestamp int64) (*model.SystemTask, error) + func StartSubscriptionQuotaResetTask() + func StartSystemInstanceReporter() + func StartSystemTaskRunner() + func StreamResponseOpenAI2Claude(openAIResponse *dto.ChatCompletionsStreamResponse, info *relaycommon.RelayInfo) []*dto.ClaudeResponse + func StreamResponseOpenAI2Gemini(openAIResponse *dto.ChatCompletionsStreamResponse, info *relaycommon.RelayInfo) *dto.GeminiChatResponse + func SundaySearch(text string, pattern string) bool + func TaskErrorFromAPIError(apiErr *types.NewAPIError) *taskdto.TaskError + func TaskErrorWrapper(err error, code string, statusCode int) *taskdto.TaskError + func TaskErrorWrapperLocal(err error, code string, statusCode int) *taskdto.TaskError + func TryTieredSettle(relayInfo *relaycommon.RelayInfo, params billingexpr.TokenParams) (ok bool, quota int, result *billingexpr.TieredResult) + func UpdateSunoTasks(ctx context.Context, taskChannelM map[int][]string, ...) error + func UpdateVideoTasks(ctx context.Context, platform constant.TaskPlatform, ...) error + func ValidUsage(usage *dto.Usage) bool + func ValidateLoginSession(identity AuthIdentity) (*model.UserSession, *model.UserBase, error) + func ValidateProxyURL(rawProxyURL string) error + func ValidateSSRFProtectedFetchURL(urlStr string) error + func VerifySecurityProof(raw string, identity AuthIdentity, requiredScope string, ...) (string, error) + func WaffoPancakeBuyerIdentityFromUserID(userID int) string + func WrapAsViolationFeeGrokCSAM(err *types.NewAPIError) *types.NewAPIError + func WriteRefreshCookie(c *gin.Context, rawToken string) + type AuthBundle struct + AccessExpiresAt int64 + AccessToken string + RefreshToken string + Session LoginSessionView + TokenType string + func AdvanceCurrentSessionSecurity(identity AuthIdentity, reason string) (*AuthBundle, error) + func AdvanceCurrentSessionToUserVersion(identity AuthIdentity, reason string) (*AuthBundle, error) + func CreateLoginSession(userID int, loginMethod, ip, userAgent string) (*AuthBundle, error) + func CreateLoginSessionAtAuthVersion(userID int, expectedAuthVersion int64, loginMethod, ip, userAgent string) (*AuthBundle, error) + func RefreshLoginSession(rawRefreshToken, expectedSID, ip, userAgent string) (*AuthBundle, *model.User, error) + type AuthIdentity struct + SessionID string + SessionVersion int64 + UserAuthVersion int64 + UserID int + func ParseAccessToken(raw string) (AuthIdentity, error) + func ParseDashboardAccessToken(raw string) (identity AuthIdentity, internal bool, err error) + func ValidateSessionReference(userID int, sid string) (AuthIdentity, error) + type BillingSession struct + func NewBillingSession(c *gin.Context, relayInfo *relaycommon.RelayInfo, preConsumedQuota int) (*BillingSession, *types.NewAPIError) + func (s *BillingSession) GetPreConsumedQuota() int + func (s *BillingSession) NeedsRefund() bool + func (s *BillingSession) Refund(c *gin.Context) + func (s *BillingSession) Reserve(targetQuota int) error + func (s *BillingSession) Settle(actualQuota int) error + type ChannelAffinityCacheStats struct + ByRuleName map[string]int + CacheAlgo string + CacheCapacity int + Enabled bool + Total int + Unknown int + func GetChannelAffinityCacheStats() ChannelAffinityCacheStats + type ChannelAffinityStatsContext struct + KeyFingerprint string + RuleName string + TTLSeconds int64 + UsingGroup string + func GetChannelAffinityStatsContext(c *gin.Context) (ChannelAffinityStatsContext, bool) + type ChannelAffinityUsageCacheCounters struct + CachedTokenRateMode string + CachedTokens int64 + CompletionTokens int64 + Hit int64 + LastSeenAt int64 + PromptCacheHitTokens int64 + PromptTokens int64 + Total int64 + TotalTokens int64 + WindowSeconds int64 + type ChannelAffinityUsageCacheStats struct + CachedTokenRateMode string + CachedTokens int64 + CompletionTokens int64 + Hit int64 + KeyFingerprint string + LastSeenAt int64 + PromptCacheHitTokens int64 + PromptTokens int64 + RuleName string + Total int64 + TotalTokens int64 + UsingGroup string + WindowSeconds int64 + func GetChannelAffinityUsageCacheStats(ruleName, usingGroup, keyFp string) ChannelAffinityUsageCacheStats + type CodexCredentialRefreshOptions struct + ResetCaches bool + type CodexOAuthAuthorizationFlow struct + AuthorizeURL string + Challenge string + State string + Verifier string + func CreateCodexOAuthAuthorizationFlow() (*CodexOAuthAuthorizationFlow, error) + type CodexOAuthKey struct + AccessToken string + AccountID string + Email string + Expired string + IDToken string + LastRefresh string + RefreshToken string + Type string + func RefreshCodexChannelCredential(ctx context.Context, channelID int, opts CodexCredentialRefreshOptions) (*CodexOAuthKey, *model.Channel, error) + type CodexOAuthTokenResult struct + AccessToken string + ExpiresAt time.Time + RefreshToken string + func ExchangeCodexAuthorizationCode(ctx context.Context, code string, verifier string) (*CodexOAuthTokenResult, error) + func ExchangeCodexAuthorizationCodeWithProxy(ctx context.Context, code string, verifier string, proxyURL string) (*CodexOAuthTokenResult, error) + func RefreshCodexOAuthToken(ctx context.Context, refreshToken string) (*CodexOAuthTokenResult, error) + func RefreshCodexOAuthTokenWithProxy(ctx context.Context, refreshToken string, proxyURL string) (*CodexOAuthTokenResult, error) + type FundingSource interface + PreConsume func(amount int) error + Refund func() error + Settle func(delta int) error + Source func() string + type HTTPTransportPolicy struct + Protocol string + Shards int + func NormalizeHTTPTransportPolicy(settings dto.ChannelSettings) HTTPTransportPolicy + func (p HTTPTransportPolicy) String() string + type LogCleanupPayload struct + BatchSize int + TargetTimestamp int64 + type LogCleanupResult struct + DeletedCount int64 + type LogCleanupState struct + Processed int64 + Progress int + Remaining int64 + Total int64 + type LoginSessionView struct + CreatedAt int64 + Current bool + ExpiresAt int64 + IP string + LastActiveAt int64 + LoginMethod string + SID string + UserAgent string + func ListLoginSessions(userID int, currentSID string) ([]LoginSessionView, error) + type ModelHistoryModel struct + Name string + Total int64 + Vendor string + type ModelHistoryPoint struct + Label string + Model string + Tokens int64 + Ts string + Vendor string + type ModelHistorySeries struct + Buckets int + Models []ModelHistoryModel + Points []ModelHistoryPoint + type Provider string + const Claude + const Gemini + const OpenAI + const Unknown + type QuotaInfo struct + GroupRatio float64 + InputDetails TokenDetails + ModelName string + ModelPrice float64 + ModelRatio float64 + OutputDetails TokenDetails + UsePrice bool + type RankedModel struct + Category string + GrowthPct float64 + ModelName string + PreviousRank *int + Rank int + Share float64 + TotalTokens int64 + Vendor string + VendorIcon string + type RankedVendor struct + GrowthPct float64 + ModelsCount int + Rank int + Share float64 + TopModel string + TotalTokens int64 + Vendor string + VendorIcon string + type RankingMover struct + CurrentRank int + GrowthPct float64 + ModelName string + RankDelta int + Vendor string + VendorIcon string + type RankingsResponse struct + Models []RankedModel + ModelsHistory ModelHistorySeries + TopDroppers []RankingMover + TopMovers []RankingMover + VendorShareHistory VendorShareSeries + Vendors []RankedVendor + func GetRankingsSnapshot(period string) (*RankingsResponse, error) + type RetryParam struct + Ctx *gin.Context + ModelName string + RequestPath string + Retry *int + TokenGroup string + func (p *RetryParam) GetRetry() int + func (p *RetryParam) IncreaseRetry() + func (p *RetryParam) ResetRetryNextTry() + func (p *RetryParam) SetRetry(retry int) + type ScheduledSystemTaskHandler interface + Enabled func() bool + Interval func() time.Duration + NewPayload func() any + type SubscriptionFunding struct + AmountTotal int64 + AmountUsedAfter int64 + PlanId int + PlanTitle string + func (s *SubscriptionFunding) PreConsume(_ int) error + func (s *SubscriptionFunding) Refund() error + func (s *SubscriptionFunding) Settle(delta int) error + func (s *SubscriptionFunding) Source() string + type SystemInstanceHostInfo struct + Hostname string + type SystemInstanceInfo struct + Extra map[string]any + Host SystemInstanceHostInfo + Node common.NodeIdentity + Resources SystemInstanceResources + Role SystemInstanceRoleInfo + Runtime SystemInstanceRuntimeInfo + SchemaVersion int + type SystemInstanceResourceUsage struct + UsagePercent float64 + type SystemInstanceResources struct + CPU SystemInstanceResourceUsage + Memory SystemInstanceResourceUsage + Storage SystemInstanceStorageMetrics + type SystemInstanceRoleInfo struct + IsMaster bool + type SystemInstanceRuntimeInfo struct + GOARCH string + GOOS string + StartedAt int64 + Version string + type SystemInstanceStorageMetrics struct + FreeBytes uint64 + TotalBytes uint64 + UsedBytes uint64 + UsedPercent float64 + type SystemTaskHandler interface + Run func(ctx context.Context, task *model.SystemTask, runnerID string) + Type func() string + type SystemTaskProgress struct + Processed int + Progress int + Total int + type TaskPollSummary struct + NullTasksFailed int + PlatformsScanned int + UnfinishedTasks int + func RunTaskPollingOnce(ctx context.Context, report func(processed, total int)) TaskPollSummary + type TaskPollingAdaptor interface + AdjustBillingOnComplete func(task *model.Task, taskResult *relaycommon.TaskInfo) int + FetchTask func(baseURL string, key string, body map[string]any, proxy string) (*http.Response, error) + Init func(info *relaycommon.RelayInfo) + ParseTaskResult func(body []byte) (*relaycommon.TaskInfo, error) + type TieredResultWrapper = billingexpr.TieredResult + type TokenDetails struct + AudioTokens int + TextTokens int + type ToolSurchargeItem struct + Count int + Name string + Price float64 + type VendorSharePoint struct + Label string + Share float64 + Tokens int64 + Ts string + Vendor string + type VendorShareSeries struct + Buckets int + Points []VendorSharePoint + Vendors []VendorShareVendor + type VendorShareVendor struct + Name string + Share float64 + Total int64 + type WaffoPancakeCatalog struct + Stores []WaffoPancakeCatalogStore + func ListWaffoPancakeCatalog(ctx context.Context, merchantID, privateKey string) (*WaffoPancakeCatalog, error) + type WaffoPancakeCatalogProduct struct + ID string + Name string + Status string + type WaffoPancakeCatalogStore struct + ID string + Name string + OnetimeProducts []WaffoPancakeCatalogProduct + ProdEnabled bool + Status string + type WaffoPancakeCheckoutSession struct + CheckoutURL string + ExpiresAt string + OrderID string + SessionID string + Token string + TokenExpiresAt string + func CreateWaffoPancakeCheckoutSession(ctx context.Context, params *WaffoPancakeCreateSessionParams) (*WaffoPancakeCheckoutSession, error) + type WaffoPancakeCreateSessionParams struct + BuyerEmail string + BuyerIdentity string + ExpiresInSeconds *int + OrderMerchantExternalID string + PriceSnapshot *WaffoPancakePriceSnapshot + ProductID string + type WaffoPancakePairResult struct + OrphanStore bool + ProductID string + ProductName string + StoreID string + StoreName string + func CreateWaffoPancakePrimaryPair(ctx context.Context, merchantID, privateKey, returnURL string) (*WaffoPancakePairResult, error) + type WaffoPancakePriceSnapshot struct + Amount string + TaxCategory string + type WaffoPancakeWebhookData struct + Amount string + BuyerEmail string + Currency string + MerchantProvidedBuyerIdentity string + OrderID string + OrderMerchantExternalID string + ProductName string + TaxAmount string + type WaffoPancakeWebhookEvent struct + Data WaffoPancakeWebhookData + EventID string + EventType string + ID string + Mode string + StoreID string + Timestamp string + func VerifyConfiguredWaffoPancakeWebhook(payload string, signatureHeader string) (*WaffoPancakeWebhookEvent, error) + func (e *WaffoPancakeWebhookEvent) NormalizedEventType() string + type WalletFunding struct + func (w *WalletFunding) PreConsume(amount int) error + func (w *WalletFunding) Refund() error + func (w *WalletFunding) Settle(delta int) error + func (w *WalletFunding) Source() string + type WebhookPayload struct + Content string + Timestamp int64 + Title string + Type string + Values []interface{} + type WorkerRequest struct + Body json.RawMessage + Headers map[string]string + Key string + Method string + URL string