base

package
v0.0.0-...-5be7bc9 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDocument

type BaseDocument struct {
	Id        primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	CreatedAt time.Time          `json:"createdAt" bson:"createdAt"`
	UpdatedAt time.Time          `json:"updatedAt" bson:"updatedAt"`
}

func (*BaseDocument) GetCreatedAt

func (bd *BaseDocument) GetCreatedAt() time.Time

func (*BaseDocument) GetID

func (bd *BaseDocument) GetID() primitive.ObjectID

func (*BaseDocument) GetUpdatedAt

func (bd *BaseDocument) GetUpdatedAt() time.Time

func (*BaseDocument) OnCreate

func (bd *BaseDocument) OnCreate()

func (*BaseDocument) OnUpdate

func (bd *BaseDocument) OnUpdate()

type IBaseDocument

type IBaseDocument interface {
	GetID() primitive.ObjectID
	GetUpdatedAt() time.Time
	GetCreatedAt() time.Time
	OnCreate()
	OnUpdate()
}

Jump to

Keyboard shortcuts

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