entitymodel

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNewEntityOption

func AddNewEntityOption(entity Entity, params ...interface{})

AddNewEntityOption

Creates a new entity option and adds it to the given entityOptionList

Types

type DoWithEntityFunc

type DoWithEntityFunc func(Entity, ...interface{})

type Entity

type Entity interface {
	EntityID() uint
	EntityDesc() string
	EntityOption() entitydto.EntityOption
	MustEmbed() []string
}

Entity ...

type EntityFactory

type EntityFactory interface {
	GetEntity(entityName string) (interface{}, error)
	GetEntitySlice(entityName string) (interface{}, error)
	DoWithAllEntities(entityList interface{}, entityFunc DoWithEntityFunc, params ...interface{})
}

type EntityOptionBuilder

type EntityOptionBuilder interface {
	BuildEntityOption() entitydto.EntityOption
}

EntityOptionBuilder struct that can build entity options

type GormEntity added in v0.1.6

type GormEntity struct {
	gorm.Model
}

func (GormEntity) EntityDesc added in v0.1.6

func (e GormEntity) EntityDesc() string

EntityDesc the description of the entity

func (GormEntity) EntityID added in v0.1.6

func (e GormEntity) EntityID() uint

EntityID the ID of the entity

func (GormEntity) EntityOption added in v0.1.6

func (e GormEntity) EntityOption() entitydto.EntityOption

EntityOption ...

func (*GormEntity) LoadRelatedEntities added in v0.1.6

func (e *GormEntity) LoadRelatedEntities(db *gorm.DB) error

LoadRelatedEntities implement this method in concrete entity

func (GormEntity) MustEmbed added in v0.1.6

func (e GormEntity) MustEmbed() []string

Jump to

Keyboard shortcuts

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