Documentation
¶
Index ¶
- type Config
- type DeeplRequestResponse
- type DeeplRequestResponseTranslation
- type DeeplRequestUsage
- type GoogleRequestResponse
- type GoogleRequestUsage
- type GoogleTranslateTextResponseList
- type GoogleTranslateTextResponseTranslation
- type T2
- type TranslationDeepl
- type TranslationGoogle
- type TranslationResponse
- type TranslationService
- type UsageResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeeplRequestResponse ¶
type DeeplRequestResponse struct {
Translations []DeeplRequestResponseTranslation
}
type DeeplRequestUsage ¶
type GoogleRequestResponse ¶ added in v0.4.0
type GoogleRequestResponse struct {
Data GoogleTranslateTextResponseList `json:"data"`
}
type GoogleRequestUsage ¶ added in v0.4.0
type GoogleTranslateTextResponseList ¶ added in v0.4.0
type GoogleTranslateTextResponseList struct {
Translations []GoogleTranslateTextResponseTranslation `json:"translations"`
}
type GoogleTranslateTextResponseTranslation ¶ added in v0.4.0
type T2 ¶ added in v0.4.0
type T2 struct {
// contains filtered or unexported fields
}
func NewT2 ¶
func NewT2(c Config, ts TranslationService) T2
func (T2) TraductionTranslation ¶ added in v0.4.0
type TranslationDeepl ¶
func (TranslationDeepl) Name ¶ added in v0.4.0
func (d TranslationDeepl) Name() string
func (TranslationDeepl) Translate ¶
func (d TranslationDeepl) Translate(text string, source string, target string) (TranslationResponse, error)
func (TranslationDeepl) Usage ¶
func (d TranslationDeepl) Usage() (UsageResponse, error)
type TranslationGoogle ¶ added in v0.4.0
func (TranslationGoogle) Name ¶ added in v0.4.0
func (d TranslationGoogle) Name() string
func (TranslationGoogle) Translate ¶ added in v0.4.0
func (d TranslationGoogle) Translate(text string, source string, target string) (TranslationResponse, error)
func (TranslationGoogle) Usage ¶ added in v0.4.0
func (d TranslationGoogle) Usage() (UsageResponse, error)
type TranslationResponse ¶
type TranslationResponse struct {
Text string
}
type TranslationService ¶ added in v0.4.0
type TranslationService interface {
Name() string
Translate(text string, source string, target string) (TranslationResponse, error)
Usage() (UsageResponse, error)
}
type UsageResponse ¶
Click to show internal directories.
Click to hide internal directories.