github.com/wfusion/gofusion@v1.1.14/db/plugins/interface.go (about)

     1  package plugins
     2  
     3  import (
     4  	"context"
     5  
     6  	"gorm.io/gorm"
     7  )
     8  
     9  type TableSharding interface {
    10  	gorm.Plugin
    11  
    12  	ShardingIDGen(ctx context.Context) (id uint64, err error)
    13  	ShardingByValues(ctx context.Context, src []map[string]any) (dst map[string][]map[string]any, err error)
    14  	ShardingByModelList(ctx context.Context, src ...any) (dst map[string][]any, err error)
    15  }