Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// LogLevel is the minimum severity level for log messages.
LogLevel LogLevel `yaml:"log_level"`
// Host is the server binding address.
Host string `yaml:"host"`
// Port is the server listening port.
Port int `yaml:"port"`
// MaxConcurrentComputations is the maximum amount of concurrent
// computations allowed.
MaxConcurrentComputations int `yaml:"max_concurrent_computations"`
// TLSEnabled reports whether to enable TLS.
TLSEnabled bool `yaml:"tls_enabled"`
// TLSCert is the TLS cert file. It is ignored if TLSEnabled is false.
TLSCert string `yaml:"tls_cert"`
// TLSKey is the TLS key file. It is ignored if TLSEnabled is false.
TLSKey string `yaml:"tls_key"`
// ModelsPath is the local path for all spaGO-compatible models.
ModelsPath string `yaml:"models_path"`
// LanguageModels provides the configuration for translation models
// to be loaded and handled by the service.
LanguageModels []LanguageModel `yaml:"language_models"`
}
Config is the main translator server configuration.
func FromYAMLFile ¶
FromYAMLFile reads a Config object from a YAML file.
type LanguageModel ¶
type LanguageModel struct {
// Source is an identifier for the source language of translation.
Source string `yaml:"source"`
// Target is an identifier for the target language of translation.
Target string `yaml:"target"`
// Model is the name of a spaGO-compatible model.
Model string `yaml:"model"`
}
LanguageModel identifies a single model and the identifiers for the source and target languages it supports.
Click to show internal directories.
Click to hide internal directories.