controller

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 32 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

Overview

Package controller is a package for handling the relay controller

Index

Constants

View Source
const (
	CtxKeyRequestBody contextKey = iota
	CtxKeyResponseBody
	CtxKeyRequestHeader
)

Variables

View Source
var CtxKeyPreConsumedQuota = "pre_consumed_quota"

Functions

func MaskAuthorizationHeader

func MaskAuthorizationHeader(headers http.Header) string

func RelayAudioHelper

func RelayAudioHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatusCode

func RelayErrorHandler

func RelayErrorHandler(resp *http.Response) (ErrorWithStatusCode *model.ErrorWithStatusCode)

func RelayImageHelper

func RelayImageHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatusCode

func RelayProxyHelper

func RelayProxyHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatusCode

RelayProxyHelper is a helper function to proxy the request to the upstream service

func RelayResponsesHelper

func RelayResponsesHelper(c *gin.Context) *model.ErrorWithStatusCode

func RelayTextHelper

func RelayTextHelper(c *gin.Context) *model.ErrorWithStatusCode

Types

type GeneralErrorResponse

type GeneralErrorResponse struct {
	Error    model.Error `json:"error"`
	Message  string      `json:"message"`
	Msg      string      `json:"msg"`
	Err      string      `json:"err"`
	ErrorMsg string      `json:"error_msg"`
	Header   struct {
		Message string `json:"message"`
	} `json:"header"`
	Response struct {
		Error struct {
			Message string `json:"message"`
		} `json:"error"`
	} `json:"response"`
}

func (GeneralErrorResponse) ToMessage

func (e GeneralErrorResponse) ToMessage() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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