postgres

package
v0.0.0-...-e384ca1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 4 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 ChatPg

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

func NewChatPg

func NewChatPg(db *sqlx.DB) *ChatPg

func (*ChatPg) Create

func (r *ChatPg) Create(chat *model.Chat) (string, error)

func (*ChatPg) ExistenceCheck

func (r *ChatPg) ExistenceCheck(chatId string) error

func (*ChatPg) GetAllForUser

func (r *ChatPg) GetAllForUser(userId string) ([]*model.Chat, error)

func (*ChatPg) GetById

func (r *ChatPg) GetById(chatId string) (*model.Chat, error)

type Config

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

type MessagePg

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

func NewMessagePg

func NewMessagePg(db *sqlx.DB) *MessagePg

func (*MessagePg) Create

func (r *MessagePg) Create(message *model.Message) (string, error)

func (*MessagePg) GetAllForChat

func (r *MessagePg) GetAllForChat(chatId string) ([]*model.Message, error)

type UserPg

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

func NewUserPg

func NewUserPg(db *sqlx.DB) *UserPg

func (*UserPg) Create

func (r *UserPg) Create(user *model.User) (string, error)

func (*UserPg) ExistenceCheck

func (r *UserPg) ExistenceCheck(userId string) error

Jump to

Keyboard shortcuts

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