Documentation ¶
Index ¶
- func SetTimeFormatter(layout string)
- func SetTimeZone(zone int64)
- type JSONDate
- type JSONTime
- func (t *JSONTime) GetBSON() (interface{}, error)
- func (t JSONTime) MarshalJSON() ([]byte, error)
- func (t *JSONTime) Scan(value interface{}) error
- func (t *JSONTime) SetBSON(raw bson.RawValue) error
- func (t *JSONTime) String() string
- func (t *JSONTime) UnmarshalJSON(data []byte) error
- func (t *JSONTime) Value() (driver.Value, error)
- type MongoModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetTimeFormatter ¶
func SetTimeFormatter(layout string)
SetTimeFormatter - Set time format layout. Default: 2006-01-02T15:04:05.999999-07:00
func SetTimeZone ¶
func SetTimeZone(zone int64)
Types ¶
type JSONDate ¶
func (JSONDate) MarshalJSON ¶
MarshalJSON - Implement method MarshalJSON to output date with in formatted
func (*JSONDate) UnmarshalJSON ¶
type JSONTime ¶
func (JSONTime) MarshalJSON ¶
MarshalJSON - Implement method MarshalJSON to output time with in formatted
func (*JSONTime) UnmarshalJSON ¶
type MongoModel ¶
type MongoModel struct { PK primitive.ObjectID `json:"id" bson:"_id,omitempty"` Status int `json:"status" bson:"status,omitempty"` CreatedAt *JSONTime `json:"createdAt" bson:"createdAt,omitempty"` UpdatedAt *JSONTime `json:"updatedAt" bson:"updatedAt,omitempty"` DeletedAt *JSONTime `json:"deletedAt" bson:"deletedAt,omitempty"` }
func (*MongoModel) PrepareForInsert ¶
func (mg *MongoModel) PrepareForInsert(status int)
Click to show internal directories.
Click to hide internal directories.