relay

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: AGPL-3.0 Imports: 73 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AudioHelper

func AudioHelper(c *gin.Context, info *relaycommon.RelayInfo) (maxAPIError *types.MaxAPIError)

func ClaudeHelper

func ClaudeHelper(c *gin.Context, info *relaycommon.RelayInfo) (maxAPIError *types.MaxAPIError)

func EmbeddingHelper

func EmbeddingHelper(c *gin.Context, info *relaycommon.RelayInfo) (maxAPIError *types.MaxAPIError)

func GeminiEmbeddingHandler

func GeminiEmbeddingHandler(c *gin.Context, info *relaycommon.RelayInfo) (maxAPIError *types.MaxAPIError)

func GeminiHelper

func GeminiHelper(c *gin.Context, info *relaycommon.RelayInfo) (maxAPIError *types.MaxAPIError)

func GetAdaptor

func GetAdaptor(apiType int) channel.Adaptor

func GetTaskAdaptor

func GetTaskAdaptor(platform constant.TaskPlatform) channel.TaskAdaptor

func GetTaskPlatform

func GetTaskPlatform(c *gin.Context) constant.TaskPlatform

func ImageHelper

func ImageHelper(c *gin.Context, info *relaycommon.RelayInfo) (maxAPIError *types.MaxAPIError)

func RelayMidjourneyImage

func RelayMidjourneyImage(c *gin.Context)

func RelayMidjourneyNotify

func RelayMidjourneyNotify(c *gin.Context) *dto.MidjourneyResponse

func RelayMidjourneySubmit

func RelayMidjourneySubmit(c *gin.Context, relayInfo *relaycommon.RelayInfo) *dto.MidjourneyResponse

func RelayMidjourneyTask

func RelayMidjourneyTask(c *gin.Context, relayMode int) *dto.MidjourneyResponse

func RelayMidjourneyTaskImageSeed

func RelayMidjourneyTaskImageSeed(c *gin.Context) *dto.MidjourneyResponse

func RelaySwapFace

func RelaySwapFace(c *gin.Context, info *relaycommon.RelayInfo) *dto.MidjourneyResponse

func RelayTaskFetch

func RelayTaskFetch(c *gin.Context, relayMode int) (taskResp *dto.TaskError)

func RerankHelper

func RerankHelper(c *gin.Context, info *relaycommon.RelayInfo) (maxAPIError *types.MaxAPIError)

func ResolveOriginTask

func ResolveOriginTask(c *gin.Context, info *relaycommon.RelayInfo) *dto.TaskError

ResolveOriginTask 处理基于已有任务的提交(remix / continuation): 查找原始任务、从中提取模型名称、将渠道锁定到原始任务的渠道 (通过 info.LockedChannel,重试时复用同一渠道并轮换 key), 以及提取 OtherRatios(时长、分辨率)。 该函数在控制器的重试循环之前调用一次,其结果通过 info 字段和上下文持久化。

func ResponsesHelper

func ResponsesHelper(c *gin.Context, info *relaycommon.RelayInfo) (maxAPIError *types.MaxAPIError)

func TaskModel2Dto

func TaskModel2Dto(task *model.Task) *dto.TaskDto

func TextHelper

func TextHelper(c *gin.Context, info *relaycommon.RelayInfo) (maxAPIError *types.MaxAPIError)

func WssHelper

func WssHelper(c *gin.Context, info *relaycommon.RelayInfo) (maxAPIError *types.MaxAPIError)

Types

type TaskSubmitResult

type TaskSubmitResult struct {
	UpstreamTaskID string
	TaskData       []byte
	Platform       constant.TaskPlatform
	Quota          int
}

func RelayTaskSubmit

func RelayTaskSubmit(c *gin.Context, info *relaycommon.RelayInfo) (*TaskSubmitResult, *dto.TaskError)

RelayTaskSubmit 完成 task 提交的全部流程(每次尝试调用一次): 刷新渠道元数据 → 确定 platform/adaptor → 验证请求 → 估算计费(EstimateBilling) → 计算价格 → 预扣费(仅首次)→ 构建/发送/解析上游请求 → 提交后计费调整(AdjustBillingOnSubmit)。 控制器负责 defer Refund 和成功后 Settle。

Jump to

Keyboard shortcuts

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