orm

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	ID        uint      `gorm:"primary_key"`
	Lang      string    `gorm:"not null;type:varchar(8);index;unique_index:idx_locales_lang_code"`
	Code      string    `gorm:"not null;index;type:VARCHAR(255);unique_index:idx_locales_lang_code"`
	Message   string    `gorm:"not null;type:varchar(1024)"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

Model locale model

func (Model) TableName

func (Model) TableName() string

TableName table name

type Store

type Store struct {
	Db *gorm.DB `inject:""`
}

Store gorm-store

func (*Store) All

func (p *Store) All(lang string) (map[string]string, error)

All list all items

func (*Store) Del

func (p *Store) Del(lang, code string) error

Del del locale

func (*Store) Get

func (p *Store) Get(lang, code string) (string, error)

Get get message

func (*Store) Languages

func (p *Store) Languages() ([]string, error)

Languages languages

func (*Store) Set

func (p *Store) Set(lang, code, message string, override bool) error

Set set locale

Jump to

Keyboard shortcuts

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