auditable.go
auditable.go - Overview
-
Overview Defines two struct types,
TimeAuditable
andUserAuditable
, which are intended to be embedded in other structs to provide auditing information. -
Detailed Documentation
TimeAuditable
-
Purpose: Provides fields for tracking creation and update timestamps.
-
Parameters: None
-
Returns: None
CreatedAt
:- Purpose: Stores the timestamp of when the record was created.
- Type:
time.Time
- Description: Uses the
bun:"created_at"
tag for database mapping andjson:"createdAt"
for JSON serialization.
UpdatedAt
:- Purpose: Stores the timestamp of when the record was last updated.
- Type:
time.Time
- Description: Uses the
bun:"updated_at"
tag for database mapping andjson:"updatedAt"
for JSON serialization.
UserAuditable
-
Purpose: Provides fields for tracking the user who created and updated the record.
-
Parameters: None
-
Returns: None
CreatedBy
:- Purpose: Stores the identifier of the user who created the record.
- Type:
string
- Description: Uses the
bun:"created_by"
tag for database mapping andjson:"createdBy"
for JSON serialization.
UpdatedBy
:- Purpose: Stores the identifier of the user who last updated the record.
- Type:
string
- Description: Uses the
bun:"updated_by"
tag for database mapping andjson:"updatedBy"
for JSON serialization.
Include in Getting Started: NO