Skip to content

internal/storage/postgres

github.com/gamidoc/backend/internal/storage/postgres

Types

ActivityRepository

type ActivityRepository struct {

DB

type DB struct {

ProjectRepository

type ProjectRepository struct {

UserRepository

type UserRepository struct {

Functions

ActivityRepository.Save

func (r *ActivityRepository) Save(ctx context.Context, event activity.Event) error {

DB.Close

func (d *DB) Close() error {

DB.Ping

func (d *DB) Ping(ctx context.Context) error {

DB.Raw

func (d *DB) Raw() *sql.DB {

DB.Ready

func (d *DB) Ready(ctx context.Context) error {

New

func New(dsn string) (*DB, error) {

NewActivityRepository

func NewActivityRepository(db *DB) *ActivityRepository {

NewProjectRepository

func NewProjectRepository(db *DB) *ProjectRepository {

NewUserRepository

func NewUserRepository(db *DB) *UserRepository {

ProjectRepository.Create

func (r *ProjectRepository) Create(ctx context.Context, input project.Project) (project.Project, error) {

ProjectRepository.Delete

func (r *ProjectRepository) Delete(ctx context.Context, projectID string) error {

ProjectRepository.FindByID

func (r *ProjectRepository) FindByID(ctx context.Context, id string) (project.Project, error) {

ProjectRepository.ListByUserID

func (r *ProjectRepository) ListByUserID(ctx context.Context, userID string, options project.ListOptions) (project.ListResult, error) {

ProjectRepository.UpdateInfo

func (r *ProjectRepository) UpdateInfo(ctx context.Context, projectID string, name string, description string) (project.Project, error) {

ProjectRepository.UpdatePDFURL

func (r *ProjectRepository) UpdatePDFURL(ctx context.Context, projectID string, pdfURL string) (project.Project, error) {

ProjectRepository.UpdateWizard

func (r *ProjectRepository) UpdateWizard(ctx context.Context, projectID string, status wizard.Status) (project.Project, error) {

UserRepository.Create

func (r *UserRepository) Create(ctx context.Context, input user.User) (user.User, error) {

UserRepository.FindByEmail

func (r *UserRepository) FindByEmail(ctx context.Context, email string) (user.User, error) {

UserRepository.FindByID

func (r *UserRepository) FindByID(ctx context.Context, id string) (user.User, error) {