Documentation
¶
Overview ¶
Package controller is a package for handling the relay controller
Index ¶
- Constants
- Variables
- func MaskAuthorizationHeader(headers http.Header) string
- func RelayAudioHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatusCode
- func RelayErrorHandler(resp *http.Response) (ErrorWithStatusCode *model.ErrorWithStatusCode)
- func RelayImageHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatusCode
- func RelayProxyHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatusCode
- func RelayResponsesHelper(c *gin.Context) *model.ErrorWithStatusCode
- func RelayTextHelper(c *gin.Context) *model.ErrorWithStatusCode
- type GeneralErrorResponse
Constants ¶
View Source
const ( CtxKeyRequestBody contextKey = iota CtxKeyResponseBody CtxKeyRequestHeader )
Variables ¶
View Source
var CtxKeyPreConsumedQuota = "pre_consumed_quota"
Functions ¶
func MaskAuthorizationHeader ¶
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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.