entity

package
v0.0.0-...-0c778b9 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	Id          ID `json:"id" orm:"primaryKey"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
	DeletedAt   gorm.DeletedAt `orm:"index"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
}

func (Entity) GetId

func (e Entity) GetId() ID

func (Entity) SetId

func (e Entity) SetId(id any) IEntity

type ID

type ID uint

func CastId

func CastId(id any) ID

func (ID) String

func (e ID) String() string

type IEntity

type IEntity interface {
	SetId(any) IEntity
	GetId() ID
}

type Model

type Model[E IEntity] interface {
	ToEntity() E
	FromEntity(entity E) any
}

Jump to

Keyboard shortcuts

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