database

package
v0.0.0-...-51c22ce Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(db *gorm.DB) i18n.Backend

New new DB backend for I18n

Types

type Backend

type Backend struct {
	DB *gorm.DB
}

Backend DB backend

func (*Backend) DeleteTranslation

func (backend *Backend) DeleteTranslation(t *i18n.Translation) error

DeleteTranslation delete translation into DB backend

func (*Backend) LoadTranslations

func (backend *Backend) LoadTranslations() (translations []*i18n.Translation)

LoadTranslations load translations from DB backend

func (*Backend) SaveTranslation

func (backend *Backend) SaveTranslation(t *i18n.Translation) error

SaveTranslation save translation into DB backend

type Translation

type Translation struct {
	Locale string `sql:"size:12;"`
	Key    string `sql:"size:4294967295;"`
	Value  string `sql:"size:4294967295"`
}

Translation is a struct used to save translations into databae

Jump to

Keyboard shortcuts

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