Documentation
¶
Index ¶
Constants ¶
View Source
const ( IDKey = "_id" UpdatedAtKey = "updated_at" CreatedAtKey = "created_at" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Common ¶
type Common struct {
Meta `bson:",inline"`
Comp `bson:",inline"`
// ID is the identifier for the document.
// example:123e4567-e89b-12d3-a456-426655440000
// readOnly:true
ID *contract.ID `bson:"id" json:"id"`
// UpdatedAt is the last update time of the document in UTC.
// example:2020-10-05T10:00:00Z
// readOnly:true
// format:date-time
UpdatedAt *time.Time `bson:"updated_at" json:"updated_at" validate:"nonnilpointer,nonzeropointerelem"`
// CreatedAt is the creation time of the document in UTC.
// example:2020-10-05T10:00:00Z
// readOnly:true
// format:date-time
CreatedAt *time.Time `bson:"created_at" json:"created_at" validate:"nonnilpointer,nonzeropointerelem"`
}
Common defines shared fields for all documents. swagger:model
func (*Common) GetCreatedAt ¶
func (*Common) GetUpdatedAt ¶
func (*Common) SetCreatedAt ¶
func (*Common) SetUpdatedAt ¶
type Comp ¶
type Comp struct{}
func ApplyComp ¶
func ApplyComp(c *Comp, modifiers ...CompOption) Comp
type CompOption ¶
type CompOption = contract.CompOption[Comp]
type Meta ¶
type Meta struct{}
func ApplyMeta ¶
func ApplyMeta(m *Meta, modifiers ...MetaOption) Meta
type MetaOption ¶
type MetaOption = contract.MetaOption[Meta]
Click to show internal directories.
Click to hide internal directories.