google

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestResponse

type RequestResponse struct {
	Data TranslateTextResponseList `json:"data"`
}

type RequestUsage

type RequestUsage struct {
	CharacterCount int64 `json:"character_count"`
	CharacterLimit int64 `json:"character_limit"`
}

type TranslateTextResponseList

type TranslateTextResponseList struct {
	Translations []TranslateTextResponseTranslation `json:"translations"`
}

type TranslateTextResponseTranslation

type TranslateTextResponseTranslation struct {
	DetectedSourceLanguage string `json:"detectedSourceLanguage"`
	Model                  string `json:"model"`
	Text                   string `json:"translatedText"`
}

type TranslationService

type TranslationService struct {
	Endpoint string
	ApiKey   string
}

func (TranslationService) Name

func (d TranslationService) Name() string

func (TranslationService) Translate

func (d TranslationService) Translate(text string, source string, target string) (backend.TranslationResponse, error)

func (TranslationService) Usage

Jump to

Keyboard shortcuts

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