entity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCountryDB

func GetCountryDB(ctx context.Context, db *gorm.DB) *gorm.DB

GetCountryDB - Get the country store

func GetLanguageDB

func GetLanguageDB(ctx context.Context, defDB *gorm.DB) *gorm.DB

GetLanguageDB - Get the language store

Types

type Countries

type Countries []*Country

Countries - Countries list

func (Countries) ToSchemaCountries

func (a Countries) ToSchemaCountries() []*schema.Country

ToSchemaCountries - Convert to country object list

type Country

type Country struct {
	Code      *string         `gorm:"column:code;size:50;index;"`      // Number
	Name      *string         `gorm:"column:name;size:100;index;"`     // Name
	Native    *string         `gorm:"column:native;size:100;index;"`   // Native language
	Phone     *string         `gorm:"column:phone;size:20;index;"`     // Phone number
	Continent *string         `gorm:"column:continent;size:10;index;"` // Continent where country located
	Capital   *string         `gorm:"column:capital;size:100;index;"`  // Country's Capital
	Currency  json.RawMessage `gorm:"type:jsonb;"`                     // Country's Currency
	Languages json.RawMessage `gorm:"column:languages;type:json"`
	Timezones json.RawMessage `gorm:"column:timezones;type:jsonb"`
	LatLng    json.RawMessage `gorm:"column:latlng;type:jsonb"`
	Emoji     *string         `gorm:"column:emoji"`
	EmojiU    *string         `gorm:"column:emojiU"`
}

Country - Country entity

func (Country) String

func (a Country) String() string

func (Country) TableName

func (a Country) TableName() string

TableName - Table Name

func (Country) ToSchemaCountry

func (a Country) ToSchemaCountry() *schema.Country

ToSchemaCountry - Convert to country object

type Language

type Language struct {
	Code    *string `gorm:"column:code;size:50;unique_index;"` // Number
	Name    *string `gorm:"column:name;size:100;index;"`       // Name
	Native  *string `gorm:"column:native;size:100;index;"`     // Native
	Rtl     bool    `gorm:"column:rtl"`                        // RTL
	Default bool    `gorm:"column:default"`                    // Default language for project
	Active  bool    `gorm:"column:active"`                     // Status language can be added as content
}

Language - Language entity

func (Language) String

func (a Language) String() string

func (Language) TableName

func (a Language) TableName() string

TableName - Table Name

func (Language) ToSchemaLanguage

func (a Language) ToSchemaLanguage() *schema.Language

ToSchemaLanguage - Convert to language object

type Languages

type Languages []*Language

Languages - Language list

func (Languages) ToSchemaLanguages

func (a Languages) ToSchemaLanguages() []*schema.Language

ToSchemaLanguages - Convert to language object list

type SchemaCountry

type SchemaCountry schema.Country

SchemaCountry - Country object

func (SchemaCountry) ToCountry

func (a SchemaCountry) ToCountry() *Country

ToCountry - Convert to country entity

type SchemaLanguage

type SchemaLanguage schema.Language

SchemaLanguage - Language object

func (SchemaLanguage) ToLanguage

func (a SchemaLanguage) ToLanguage() *Language

ToLanguage - Convert to language entity

Jump to

Keyboard shortcuts

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