postgres

package
v0.0.0-...-f8166fb Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAdminPassword

func CheckAdminPassword(db *pgxpool.Pool, pwd, pwdHash string) (string, error)

func CreateTables

func CreateTables(db *pgxpool.Pool) error

func DeleteMessage

func DeleteMessage(db *pgxpool.Pool, messageID int) error

func GetMessage

func GetMessage(db *pgxpool.Pool, messageID int) (domain.Message, error)

func GetMessages

func GetMessages(db *pgxpool.Pool) ([]domain.Message, error)

func InsertMessage

func InsertMessage(db *pgxpool.Pool, msg domain.Message) (int64, error)

func IsAdminSession

func IsAdminSession(db *pgxpool.Pool, cookie *http.Cookie) error

func New

func New(cfg Config) (*pgxpool.Pool, error)

Types

type Config

type Config struct {
	PGHost     string `env:"PGHOST"`
	PGPort     string `env:"PGPORT"`
	PGDBName   string `env:"PGDBNAME"`
	PGUser     string `env:"PGUSER"`
	PGPassword string `env:"PGPASSWORD"`
}

Jump to

Keyboard shortcuts

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