entity

package
v0.0.0-...-b9f6318 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateID

func GenerateID() uuid.UUID

GenerateID generates a unique ID that can be used as an identifier for an entity.

Types

type Album

type Album struct {
	ID   uuid.UUID `gorm:"primaryKey"`
	Name string
	Auditable
}

Album represents an album record.

func NewAlbum

func NewAlbum(request *request.UpsertAlbumRequest, createdBy uuid.UUID) *Album

func (*Album) MapDelete

func (album *Album) MapDelete(deletedBy uuid.UUID) map[string]any

func (*Album) MapToMap

func (album *Album) MapToMap() map[string]any

func (*Album) MapUpdate

func (album *Album) MapUpdate(request *request.UpsertAlbumRequest, updatedBy uuid.UUID) *Album

type Auditable

type Auditable struct {
	CreatedBy uuid.UUID
	UpdatedBy uuid.UUID
	DeletedBy uuid.UUID `gorm:"default:null"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt
}

func NewAuditable

func NewAuditable(createdBy uuid.UUID) Auditable

type User

type User struct {
	ID   string
	Name string
}

User represents a user.

func (User) GetID

func (u User) GetID() string

GetID returns the user ID.

func (User) GetName

func (u User) GetName() string

GetName returns the user name.

Jump to

Keyboard shortcuts

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