server

package
v1.0.0-beta.20241028 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateServer

func CreateServer(config *configs.Config) *fiber.App

func NewAuthMiddleware

func NewAuthMiddleware(authTokens []string) func() fiber.Handler

func RunServer

func RunServer(config *configs.Config) error

Types

type DeepLXRequest

type DeepLXRequest struct {
	Text       string `json:"text"`
	SourceLang string `json:"source_lang"` // default is auto
	TragetLang string `json:"target_lang"` // ZH
}

type DeepLXResponse

type DeepLXResponse struct {
	Code         int32    `json:"code"`
	Msg          string   `json:"msg"`
	Data         string   `json:"data"`
	SourceLang   string   `json:"source_lang"` // default is auto
	TragetLang   string   `json:"target_lang"` // ZH
	Alternatives []string `json:"alternatives"`
}

type HcfyRequest

type HcfyRequest struct {
	Name        string   `json:"name"`
	Text        string   `json:"text"`
	Destination []string `json:"destination"` //["中文(简体)", "英语"]
	Source      string   `json:"source"`      // undefined -> auto
}

type HcfyResponse

type HcfyResponse struct {
	Text   string   `json:"text"`
	From   string   `json:"from"`
	To     string   `json:"to"`
	Result []string `json:"result"`
}

type TranslationRequest

type TranslationRequest struct {
	Text         string `json:"text"`
	From         string `json:"from"` // default is auto
	To           string `json:"to"`
	ForceRefresh bool   `json:"force_refresh"` // default is false
}

type TranslationRequestWithModelName

type TranslationRequestWithModelName struct {
	TranslationRequest
	ModelName string `json:"model_name"`
}

type TranslationResponse

type TranslationResponse struct {
	ModelName      string `json:"model_name"`
	TranslatedText string `json:"translated_text"`
}

Jump to

Keyboard shortcuts

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