initial commit
This commit is contained in:
30
internal/repository/postgres/cache/model.go
vendored
Normal file
30
internal/repository/postgres/cache/model.go
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/datatypes"
|
||||
)
|
||||
|
||||
type KVModel struct {
|
||||
Key string `gorm:"primaryKey"`
|
||||
Value datatypes.JSON
|
||||
ExpiresAt *time.Time
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
func (KVModel) TableName() string {
|
||||
return "cache_kv"
|
||||
}
|
||||
|
||||
type HashModel struct {
|
||||
Key string `gorm:"primaryKey"`
|
||||
Field string `gorm:"primaryKey"`
|
||||
Value datatypes.JSON
|
||||
CreatedAt time.Time
|
||||
ExpiresAt *time.Time
|
||||
}
|
||||
|
||||
func (HashModel) TableName() string {
|
||||
return "cache_hash"
|
||||
}
|
||||
Reference in New Issue
Block a user