You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

pub_shards.go 542 B

123456789101112131415161718192021222324
  1. package db
  2. import jcstypes "gitlink.org.cn/cloudream/jcs-pub/common/types"
  3. type PubShardsDB struct {
  4. *DB
  5. }
  6. func (db *DB) PubShards() *PubShardsDB {
  7. return &PubShardsDB{DB: db}
  8. }
  9. func (*PubShardsDB) Get(ctx SQLContext, publicShardStoreID jcstypes.PubShardsID) (*jcstypes.PubShards, error) {
  10. var cfg jcstypes.PubShards
  11. if err := ctx.First(&cfg, publicShardStoreID).Error; err != nil {
  12. return nil, err
  13. }
  14. return &cfg, nil
  15. }
  16. func (*PubShardsDB) Create(ctx SQLContext, cfg jcstypes.PubShards) error {
  17. return ctx.Create(&cfg).Error
  18. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。