lingvanex

package module
v0.0.0-...-ebc0e4f Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

README

lingvanex-sdk

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SetRetryMax(retryMax int) Client
	SetConnTimeout(connTimeout time.Duration) Client
	SetURL(apiURL string) Client
	SetKey(apiKey string) Client
	SetEnableTransliteration(enable bool) Client
	GetLanguages(ctx context.Context, code string) ([]Language, error)
	Translate(ctx context.Context, q, source, target string) (*TranslateResponse, error)
}

func NewTranslator

func NewTranslator() Client

type Language

type Language struct {
	FullCode    string `json:"full_code"`
	EnglishName string `json:"englishName"`
}

type LanguagesResponse

type LanguagesResponse struct {
	Err    string     `json:"err,omitempty"`
	Result []Language `json:"result,omitempty"`
}

type TranslateRequest

type TranslateRequest struct {
	Transliteration bool   `json:"enableTransliteration,omitempty"`
	From            string `json:"from,omitempty"`
	To              string `json:"to"`
	Data            string `json:"data"`
	TranslateMode   string `json:"translateMode,omitempty"`
	Platform        string `json:"platform,omitempty"`
}

type TranslateResponse

type TranslateResponse struct {
	Err                   string `json:"err,omitempty"`
	Result                string `json:"result,omitempty"`
	SourceTransliteration string `json:"sourceTransliteration,omitempty"`
	TargetTransliteration string `json:"targetTransliteration,omitempty"`
}

Jump to

Keyboard shortcuts

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