repositories

package
v0.0.0-...-267b159 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RepositoryConfigurationName = map[RepoConfig]string{
	POSTGRES: "POSTGRES",
}

Functions

func Migrate

func Migrate(ctx context.Context) error

Migrate This command will run all the migrations for the database

func NewPostgresRepo

func NewPostgresRepo(db *gorm.DB, errorTransformer errors.ErrorTransformer, scope promutils.Scope) interfaces.DataCatalogRepo

Types

type DBHandle

type DBHandle struct {
	// contains filtered or unexported fields
}

func NewDBHandle

func NewDBHandle(ctx context.Context, dbConfigValues database.DbConfig, catalogScope promutils.Scope) (*DBHandle, error)

func (*DBHandle) CreateDB

func (h *DBHandle) CreateDB(dbName string) error

func (*DBHandle) Migrate

func (h *DBHandle) Migrate(ctx context.Context) error

type PostgresRepo

type PostgresRepo struct {
	// contains filtered or unexported fields
}

func (*PostgresRepo) ArtifactRepo

func (dc *PostgresRepo) ArtifactRepo() interfaces.ArtifactRepo

func (*PostgresRepo) DatasetRepo

func (dc *PostgresRepo) DatasetRepo() interfaces.DatasetRepo

func (*PostgresRepo) ReservationRepo

func (dc *PostgresRepo) ReservationRepo() interfaces.ReservationRepo

func (*PostgresRepo) TagRepo

func (dc *PostgresRepo) TagRepo() interfaces.TagRepo

type RepoConfig

type RepoConfig int32
const (
	POSTGRES RepoConfig = 0
)

type RepositoryInterface

type RepositoryInterface interface {
	DatasetRepo() interfaces.DatasetRepo
	ArtifactRepo() interfaces.ArtifactRepo
	TagRepo() interfaces.TagRepo
	ReservationRepo() interfaces.ReservationRepo
}

The RepositoryInterface indicates the methods that each Repository must support. A Repository indicates a Database which is collection of Tables/models. The goal is allow databases to be Plugged in easily.

func GetRepository

func GetRepository(ctx context.Context, repoType RepoConfig, dbConfig database.DbConfig, scope promutils.Scope) RepositoryInterface

Directories

Path Synopsis
Generic errors used in the repos layer
Generic errors used in the repos layer
Shared utils for postgresql tests.
Shared utils for postgresql tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL