repository

package
v0.0.0-...-89fe5e3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresDB

func NewPostgresDB(cfg Config) (*sqlx.DB, error)

Types

type AuthPostgres

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

func NewAuthPostgress

func NewAuthPostgress(db *sqlx.DB) *AuthPostgres

func (*AuthPostgres) CreateUser

func (r *AuthPostgres) CreateUser(user webApi.User) (int, error)

func (*AuthPostgres) GetUser

func (r *AuthPostgres) GetUser(username, password string) (webApi.User, error)

type Authorization

type Authorization interface {
	CreateUser(user webApi.User) (int, error)
	GetUser(username, password string) (webApi.User, error)
}

type Category

type Category interface {
	Create(userId int, category webApi.Category) (int, error)
	GetAll(userId int) ([]webApi.Category, error)
	GetById(userId, id int) (webApi.Category, error)
	Delete(userId, id int) error
	Update(userId, id int, input webApi.UpdateCategoryInput) error
}

type CategoryPostgres

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

func NewCategoryPostgres

func NewCategoryPostgres(db *sqlx.DB) *CategoryPostgres

func (*CategoryPostgres) Create

func (r *CategoryPostgres) Create(userId int, category webApi.Category) (int, error)

func (*CategoryPostgres) Delete

func (r *CategoryPostgres) Delete(userId, id int) error

func (*CategoryPostgres) GetAll

func (r *CategoryPostgres) GetAll(userId int) ([]webApi.Category, error)

func (*CategoryPostgres) GetById

func (r *CategoryPostgres) GetById(userId, id int) (webApi.Category, error)

func (*CategoryPostgres) Update

func (r *CategoryPostgres) Update(userId, id int, input webApi.UpdateCategoryInput) error

type Config

type Config struct {
	Host     string
	Port     string
	Username string
	Password string
	DBName   string
	SSLMode  string
}

type Event

type Event interface {
	Create(userId int, category webApi.Event) (int, error)
	GetAll(userId int) ([]webApi.Event, error)
	GetById(userId, id int) (webApi.Event, error)
	Delete(userId, id int) error
	Update(userId, id int, input webApi.UpdateEventInput) error
}

type EventPostgres

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

func NewEventPostgres

func NewEventPostgres(db *sqlx.DB) *EventPostgres

func (*EventPostgres) Create

func (r *EventPostgres) Create(userId int, event webApi.Event) (int, error)

func (*EventPostgres) Delete

func (r *EventPostgres) Delete(userId int, id int) error

func (*EventPostgres) GetAll

func (r *EventPostgres) GetAll(userId int) ([]webApi.Event, error)

func (*EventPostgres) GetById

func (r *EventPostgres) GetById(userId int, id int) (webApi.Event, error)

func (*EventPostgres) Update

func (r *EventPostgres) Update(userId, id int, input webApi.UpdateEventInput) error

type Notion

type Notion interface {
	GetAll(userId int) ([]webApi.Notion, error)
	GetById(userId int, id int) (webApi.Notion, error)
	Create(userId int, notion webApi.Notion) (int, error)
	Delete(userId, id int) error
	Update(userId, id int, input webApi.UpdateNotionInput) error
}

type NotionPostgres

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

func NewNotionPostgres

func NewNotionPostgres(db *sqlx.DB) *NotionPostgres

func (*NotionPostgres) Create

func (r *NotionPostgres) Create(userId int, notion webApi.Notion) (int, error)

func (*NotionPostgres) Delete

func (r *NotionPostgres) Delete(userId int, id int) error

func (*NotionPostgres) GetAll

func (r *NotionPostgres) GetAll(userId int) ([]webApi.Notion, error)

func (*NotionPostgres) GetById

func (r *NotionPostgres) GetById(userId int, id int) (webApi.Notion, error)

func (*NotionPostgres) Update

func (r *NotionPostgres) Update(userId, id int, input webApi.UpdateNotionInput) error

type Repository

type Repository struct {
	Authorization
	Category
	Task
	Event
	Notion
	User
	Week
}

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

type Task

type Task interface {
	GetAll(userId int) ([]webApi.Task, error)
	GetById(userId int, id int) (webApi.Task, error)
	Create(userId int, notion webApi.Task) (int, error)
	Delete(userId, id int) error
	Update(userId, id int, input webApi.UpdateTaskInput) error
}

type TaskPostgres

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

func NewTaskPostgres

func NewTaskPostgres(db *sqlx.DB) *TaskPostgres

func (*TaskPostgres) Create

func (r *TaskPostgres) Create(userId int, task webApi.Task) (int, error)

func (*TaskPostgres) Delete

func (r *TaskPostgres) Delete(userId int, id int) error

func (*TaskPostgres) GetAll

func (r *TaskPostgres) GetAll(userId int) ([]webApi.Task, error)

func (*TaskPostgres) GetById

func (r *TaskPostgres) GetById(userId int, id int) (webApi.Task, error)

func (*TaskPostgres) Update

func (r *TaskPostgres) Update(userId, id int, input webApi.UpdateTaskInput) error

type User

type User interface {
	Get(userId int) (webApi.UsernameInfo, error)
}

type UserPostgres

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

func NewUserPostgres

func NewUserPostgres(db *sqlx.DB) *UserPostgres

func (*UserPostgres) Get

func (r *UserPostgres) Get(userId int) (webApi.UsernameInfo, error)

type Week

type Week interface {
	GetDays(userId int, input webApi.WeekRequest) ([]webApi.Day, error)
}

type WeekPostgres

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

func NewWeekPostgres

func NewWeekPostgres(db *sqlx.DB) *WeekPostgres

func (*WeekPostgres) GetDays

func (r *WeekPostgres) GetDays(userId int, input webApi.WeekRequest) ([]webApi.Day, error)

Jump to

Keyboard shortcuts

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