mapper

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFieldByFieldTag

func GetFieldByFieldTag(jsonTagKey, jsonTagValue string, s interface{}) (string, interface{})

func MapLanguageGUID added in v0.6.1

func MapLanguageGUID(data interface{}, logger logrus.FieldLogger, db *gorm.DB, cache *LanguageCache) (interface{}, error)

func MapProductGUID

func MapProductGUID(data interface{}, logger logrus.FieldLogger, db *gorm.DB, cache *ProductCache) (interface{}, error)

Types

type Base

type Base struct {
	ID        string     `gorm:"primaryKey" json:"id"`
	CreatedAt time.Time  `json:"-"`
	UpdatedAt time.Time  `json:"-"`
	DeletedAt *time.Time `gorm:"index" json:"-"`
}

type Language added in v0.6.1

type Language struct {
	// ID, CreatedAt, UpdatedAt, DeletedAt
	Base
	// Language Specific fields
	Name   string `gorm:"unique" json:"name"`
	GUID   string `gorm:"column:guid" json:"guid"`
	MCName string `gorm:"column:mc_name" json:"mc_name"`
}

type LanguageCache added in v0.6.1

type LanguageCache struct {
	Map map[string]string
}

func (*LanguageCache) LoadLanguageCache added in v0.6.1

func (c *LanguageCache) LoadLanguageCache(db *gorm.DB) error

type Product

type Product struct {
	Base
	Name         string `gorm:"unique" json:"name"`
	BusinessLine string `json:"business_line"`
	ProductLine  string `json:"product_line"`
	GUID         string `gorm:"column:guid" json:"guid"`
	DisplayName  string `json:"display_name"`
	Cloud        string `json:"cloud"`
}

type ProductCache added in v0.6.1

type ProductCache struct {
	Map map[string]string
}

func (*ProductCache) LoadProductCache added in v0.6.1

func (c *ProductCache) LoadProductCache(db *gorm.DB) error

Jump to

Keyboard shortcuts

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