internal/storage/postgres¶
github.com/gamidoc/backend/internal/storage/postgres
- activity_repository.go
- db.go
- design_report_repository.go
- design_state_repository.go
- project_repository.go
- user_repository.go
Types¶
ActivityRepository¶
type ActivityRepository struct {
DB¶
type DB struct {
DesignReportRepository¶
type DesignReportRepository struct {
DesignStateRepository¶
type DesignStateRepository 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 {
DesignReportRepository.Create¶
func (r *DesignReportRepository) Create(ctx context.Context, report design.Report) (design.Report, error) {
DesignReportRepository.ListByProjectID¶
func (r *DesignReportRepository) ListByProjectID(ctx context.Context, projectID string) ([]design.Report, error) {
DesignStateRepository.Get¶
func (r *DesignStateRepository) Get(ctx context.Context, id string) (design.Status, error) {
DesignStateRepository.Save¶
func (r *DesignStateRepository) Save(ctx context.Context, id string, status design.Status) error {
New¶
func New(dsn string) (*DB, error) {
NewActivityRepository¶
func NewActivityRepository(db *DB) *ActivityRepository {
NewDesignReportRepository¶
func NewDesignReportRepository(db *DB) *DesignReportRepository {
NewDesignStateRepository¶
func NewDesignStateRepository(db *DB) *DesignStateRepository {
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) {