@@ -13,7 +13,7 @@ const (
1313 defaultRetryDelay = 30 * time .Second
1414)
1515
16- type DataTransport struct {
16+ type DataSource struct {
1717 // data sources
1818 DbConn * gorm.DB
1919 RosettaClient * client.APIClient
@@ -24,10 +24,10 @@ type DataTransport struct {
2424 RetryDelay time.Duration
2525}
2626
27- type TransportOption func (* DataTransport )
27+ type SourceOption func (* DataSource )
2828
29- func NewDataTransport (opts ... TransportOption ) DataTransport {
30- d := DataTransport {
29+ func NewDataSource (opts ... SourceOption ) DataSource {
30+ d := DataSource {
3131 Ctx : context .Background (),
3232 RetryDelay : defaultRetryDelay ,
3333 }
@@ -38,38 +38,38 @@ func NewDataTransport(opts ...TransportOption) DataTransport {
3838 return d
3939}
4040
41- func WithContext (ctx context.Context ) TransportOption {
42- return func (w * DataTransport ) {
41+ func WithContext (ctx context.Context ) SourceOption {
42+ return func (w * DataSource ) {
4343 w .Ctx = ctx
4444 }
4545}
4646
47- func WithRetryDelay (delay time.Duration ) TransportOption {
48- return func (w * DataTransport ) {
47+ func WithRetryDelay (delay time.Duration ) SourceOption {
48+ return func (w * DataSource ) {
4949 w .RetryDelay = delay
5050 }
5151}
5252
53- func WithDBConnection (dbConn * gorm.DB ) TransportOption {
54- return func (w * DataTransport ) {
53+ func WithDBConnection (dbConn * gorm.DB ) SourceOption {
54+ return func (w * DataSource ) {
5555 w .DbConn = dbConn
5656 }
5757}
5858
59- func WithRosettaClient (client * client.APIClient ) TransportOption {
60- return func (w * DataTransport ) {
59+ func WithRosettaClient (client * client.APIClient ) SourceOption {
60+ return func (w * DataSource ) {
6161 w .RosettaClient = client
6262 }
6363}
6464
65- func WithNodeClient (node interface {}) TransportOption {
66- return func (w * DataTransport ) {
65+ func WithNodeClient (node interface {}) SourceOption {
66+ return func (w * DataSource ) {
6767 w .NodeClient = node
6868 }
6969}
7070
71- func WithDataStore (cfg ds.DataStoreConfig ) TransportOption {
72- return func (w * DataTransport ) {
71+ func WithDataStore (cfg ds.DataStoreConfig ) SourceOption {
72+ return func (w * DataSource ) {
7373 switch cfg .Service {
7474 case ds .MinIOStorage :
7575 c , _ := ds .NewMinioClient (cfg )
0 commit comments