postgres

package
v0.0.0-...-10102c9 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string `yaml:"host" env-default:"localhost"`
	Port     string `yaml:"port" env-default:"5432"`
	User     string `yaml:"user" env-default:"postgres"`
	Password string `yaml:"password" env-default:"postgres"`
	DBName   string `yaml:"dbname" env-default:"test"`
}

func (*Config) ConnectionString

func (p *Config) ConnectionString() string

type CoursesRepository

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

func NewCoursesRepository

func NewCoursesRepository(db *gorm.DB) *CoursesRepository

func (CoursesRepository) Create

func (r CoursesRepository) Create(ctx context.Context, course *entity.Course) error

func (CoursesRepository) Delete

func (r CoursesRepository) Delete(ctx context.Context, id int64) error

func (CoursesRepository) Get

func (CoursesRepository) GetAll

func (CoursesRepository) Patch

func (r CoursesRepository) Patch(ctx context.Context, course *entity.Course) error

func (CoursesRepository) Search

type Repository

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

func NewPostgres

func NewPostgres(repository Config) (*Repository, error)

type TasksRepository

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

func NewTasksRepository

func NewTasksRepository(db *gorm.DB) *TasksRepository

func (TasksRepository) Create

func (r TasksRepository) Create(ctx context.Context, task *entity.Task) error

func (TasksRepository) Delete

func (r TasksRepository) Delete(ctx context.Context, id int64) error

func (TasksRepository) Get

func (r TasksRepository) Get(ctx context.Context, id int64) (*entity.Task, error)

func (TasksRepository) GetAll

func (TasksRepository) Patch

func (r TasksRepository) Patch(ctx context.Context, task *entity.Task) error

func (TasksRepository) Search

Jump to

Keyboard shortcuts

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