Documentation
¶
Index ¶
- type DBCluster
- type Infrastructure
- type Sharding
- func (s *Sharding) ApplyFunc2DBs(f func(db minipkg_gorm.IDB) error) (err error)
- func (s *Sharding) Close() (err error)
- func (s *Sharding) GetClustersByEntityTypes(entityTypes []string) ([]*DBCluster, error)
- func (s *Sharding) SchemesInitWithContext(ctx context.Context, model interface{}) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBCluster ¶
type DBCluster struct { Capacity uint EntityTypes []string Items []minipkg_gorm.IDB }
func (*DBCluster) ApplyFunc2DBs ¶
func (s *DBCluster) ApplyFunc2DBs(f func(db minipkg_gorm.IDB) error) (err error)
type Infrastructure ¶
type Infrastructure struct { Logger log.Logger DataSharding Sharding ReferenceDB minipkg_gorm.IDB //SearchDB minipkg_gorm.IDB Redis redis.IDB }
func NewInfrastructure ¶
func NewInfrastructure(ctx context.Context, logger log.Logger, cfg *config.Infrastructure, model2sharding interface{}) (*Infrastructure, error)
func (*Infrastructure) Stop ¶
func (i *Infrastructure) Stop() error
type Sharding ¶
type Sharding struct { IsAutoMigrate bool Model interface{} Default *DBCluster BySysnames map[string]*DBCluster ClusterSysnamesByEntityTypes map[string]string }
func (*Sharding) ApplyFunc2DBs ¶
func (s *Sharding) ApplyFunc2DBs(f func(db minipkg_gorm.IDB) error) (err error)
func (*Sharding) GetClustersByEntityTypes ¶
Click to show internal directories.
Click to hide internal directories.