controller

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package controller is a package for handling the relay controller

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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