github.com/songzhibin97/gkit@v1.2.13/distributed/backend/backend_mongodb/option.go (about)

     1  package backend_mongodb
     2  
     3  import "github.com/songzhibin97/gkit/options"
     4  
     5  type config struct {
     6  	// DatabaseName db名称
     7  	databaseName string
     8  	// TableTaskName 任务表名称
     9  	tableTaskName string
    10  	// TableGroupName 组表名称
    11  	tableGroupName string
    12  }
    13  
    14  func SetDatabaseName(databaseName string) options.Option {
    15  	return func(c interface{}) {
    16  		c.(*config).databaseName = databaseName
    17  	}
    18  }
    19  
    20  func SetTableTaskName(tableTaskName string) options.Option {
    21  	return func(c interface{}) {
    22  		c.(*config).tableTaskName = tableTaskName
    23  	}
    24  }
    25  
    26  func SetTableGroupName(tableGroupName string) options.Option {
    27  	return func(c interface{}) {
    28  		c.(*config).tableGroupName = tableGroupName
    29  	}
    30  }