You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
750 B
30 lines
750 B
1 year ago
|
package relation
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
ObjectInfoModelTableName = "object_info"
|
||
|
)
|
||
|
|
||
|
type ObjectInfoModel struct {
|
||
|
Name string `gorm:"column:name;primary_key"`
|
||
|
Hash string `gorm:"column:hash"`
|
||
|
ContentType string `gorm:"column:content_type"`
|
||
|
ValidTime *time.Time `gorm:"column:valid_time"`
|
||
|
CreateTime time.Time `gorm:"column:create_time"`
|
||
|
}
|
||
|
|
||
|
func (ObjectInfoModel) TableName() string {
|
||
|
return ObjectInfoModelTableName
|
||
|
}
|
||
|
|
||
|
type ObjectInfoModelInterface interface {
|
||
|
NewTx(tx any) ObjectInfoModelInterface
|
||
|
SetObject(ctx context.Context, obj *ObjectInfoModel) error
|
||
|
Take(ctx context.Context, name string) (*ObjectInfoModel, error)
|
||
|
DeleteExpiration(ctx context.Context, expiration time.Time) error
|
||
|
}
|