types

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Randomizer

type Randomizer struct {
	// contains filtered or unexported fields
}

func (*Randomizer) Append

func (r *Randomizer) Append(appendableItems ...string)

Appends a string to the randomizer slice

func (*Randomizer) Combine

func (destRand *Randomizer) Combine(srcRand ...*Randomizer)

func (*Randomizer) Fill

func (r *Randomizer) Fill(filepath string, clear bool)

This function fills the randomizer's items slice with the contents of filepath. filepath points to a file with 1 item per line. The clear parameter lets you decide whether to clear the slice before filling it (rather than append to it)

func (Randomizer) Random

func (r Randomizer) Random() string

Produces a random item from the Randomizer slice. Examples show the use of rand.Seed but as of Go 1.20 the runtime seeds the generator automatically.

type SingleTranslation

type SingleTranslation struct {
	FromLangCode   string
	FromLang       string
	FromLangNative string
	ToLangCode     string
	ToLang         string
	ToLangNative   string
	TranslatedText string
	OriginalText   string
}

type Translator

type Translator struct {
	Translate              func(fromLang string, toLang string, translatable string) (SingleTranslation, error)
	FillLanguagesFromCodes func(SingleTranslation) SingleTranslation
}

Jump to

Keyboard shortcuts

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