Skip to content

Clean Repository Types #31

Description

@zahin-mohammad

Currently defined as:

package impl

import (
	influxdb2 "github.com/influxdata/influxdb-client-go/v2"
	"github.com/jmoiron/sqlx"
	"github.com/mochahub/coinprice-scraper/config"
)

type RepositoryImpl struct {
	db           *sqlx.DB
	influxClient *influxdb2.Client
	influxOrg    string
	ohlcBucket   string
}

func NewRepositoryImpl(
	config *config.Secrets,
	db *sqlx.DB,
	influxClient *influxdb2.Client,
) *RepositoryImpl {
	return &RepositoryImpl{
		db:           db,
		influxClient: influxClient,
		influxOrg:    config.Org,
		ohlcBucket:   config.Bucket,
	}
}

Instead of a single repository type, maybe we should have a repository per data model. This would result in more files but seems cleaner.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions