Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AutoMigrater ¶
AutoMigrater auto migrate the DB
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is the cmd configuration struct.
type Language ¶
type Language struct { gorm.Model Source string `gorm:"size:255;not null;index:source;" valid:"required"` Title string `gorm:"size:255;not null;index:title" valid:"required"` Synonym string `gorm:"size:255;"` Position uint `gorm:"not null;index:position" valid:"type(uint)"` // contains filtered or unexported fields }
Language is the service struct
func (*Language) BeforeSave ¶
BeforeSave runs before saving the object
func (*Language) GetAvailableSources ¶
GetAvailableSources returns the available sources
func (*Language) InitNameProcessor ¶
func (l *Language) InitNameProcessor()
InitNameProcessor creates a name normalizer
type LanguageRepository ¶
type LanguageRepository struct {
// contains filtered or unexported fields
}
LanguageRepository is the language repository struct
func NewLanguageRepository ¶
func NewLanguageRepository( database Database, nameProcessor nameProcessor, ) *LanguageRepository
NewLanguageRepository return a new LanguageRepository
func (*LanguageRepository) AddLanguage ¶
func (r *LanguageRepository) AddLanguage( source, title string, position uint, ) []error
AddLanguage creates a new language entry in the DB
func (*LanguageRepository) CreateLanguage ¶
func (r *LanguageRepository) CreateLanguage(lang *Language) []error
CreateLanguage creates a new language
func (*LanguageRepository) NewLanguage ¶
func (r *LanguageRepository) NewLanguage( source, title string, position uint, ) *Language
NewLanguage return a service object
Click to show internal directories.
Click to hide internal directories.