entity

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	ID        ids.ID    `json:"id" bson:"_id"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	Version   int       `json:"version"`
}

Metadata is the metadata for any entity.

func New

func New() Metadata

func NewAt

func NewAt(now time.Time) Metadata

func (Metadata) Clone

func (e Metadata) Clone(now time.Time) Metadata

Clone returns a clone of the entity with a new ID and CreatedAt if necessary. Updates UpdatedAt.

func (Metadata) GetID

func (e Metadata) GetID() ids.ID

GetID returns the ID of the entity. Implements Identifiable interfaces.

Jump to

Keyboard shortcuts

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