Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAzureTranslationAlreadyExists = errors.New("azure translation already exists")
View Source
var ErrTranslationAlreadyExists = errors.New("custsomtranslation already exists")
View Source
var ErrTranslationNotFound = errors.New("translation not found")
Functions ¶
This section is empty.
Types ¶
type AzureTranslation ¶
func (*AzureTranslation) ToTranslation ¶
func (t *AzureTranslation) ToTranslation(lang2 domain.Lang2, text string) (domain.Translation, error)
type AzureTranslationClient ¶
type AzureTranslationRepository ¶
type AzureTranslationRepository interface { Add(ctx context.Context, lang2 domain.Lang2, text string, result []AzureTranslation) error Find(ctx context.Context, lang2 domain.Lang2, text string) ([]AzureTranslation, error) FindByTextAndPos(ctx context.Context, lang2 domain.Lang2, text string, pos domain.WordPos) (domain.Translation, error) FindByText(ctx context.Context, lang2 domain.Lang2, text string) ([]domain.Translation, error) FindByFirstLetter(ctx context.Context, lang2 domain.Lang2, firstLetter string) ([]domain.Translation, error) Contain(ctx context.Context, lang2 domain.Lang2, text string) (bool, error) }
type CustomTranslationRepository ¶
type CustomTranslationRepository interface { Add(ctx context.Context, param TranslationAddParameter) error Update(ctx context.Context, lang2 domain.Lang2, text string, pos domain.WordPos, param TranslationUpdateParameter) error Remove(ctx context.Context, lang2 domain.Lang2, text string, pos domain.WordPos) error FindByText(ctx context.Context, lang2 domain.Lang2, text string) ([]domain.Translation, error) FindByTextAndPos(ctx context.Context, lang2 domain.Lang2, text string, pos domain.WordPos) (domain.Translation, error) FindByFirstLetter(ctx context.Context, lang2 domain.Lang2, firstLetter string) ([]domain.Translation, error) Contain(ctx context.Context, lang2 domain.Lang2, text string) (bool, error) }
type RepositoryFactory ¶
type RepositoryFactory interface { NewAzureTranslationRepository(ctx context.Context) AzureTranslationRepository NewCustomTranslationRepository(ctx context.Context) CustomTranslationRepository }
type TranslationAddParameter ¶
type TranslationAddParameter interface { GetText() string GetPos() domain.WordPos GetLang2() domain.Lang2 GetTranslated() string }
type TranslationSearchResult ¶
type TranslationSearchResult struct { TotalCount int64 Results [][]AzureTranslation }
type TranslationUpdateParameter ¶
type TranslationUpdateParameter interface {
GetTranslated() string
}
func NewTransaltionUpdateParameter ¶
func NewTransaltionUpdateParameter(translated string) (TranslationUpdateParameter, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.