pg

package
v0.0.2-301223-e6c85bf Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

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

func NewRepository

func NewRepository(ctx context.Context, dbs string) (*Repository, error)

func (*Repository) Close

func (r *Repository) Close(ctx context.Context) error

func (*Repository) CreateMessage

func (r *Repository) CreateMessage(ctx context.Context, msg *models.Message) error

func (*Repository) GetMessage

func (r *Repository) GetMessage(ctx context.Context, id string) (*models.Message, error)

func (*Repository) GetUserByID

func (r *Repository) GetUserByID(ctx context.Context, id int64) (*models.User, error)

func (*Repository) GetWhitelisted

func (r *Repository) GetWhitelisted(ctx context.Context, userID int64) (bool, error)

func (*Repository) ListMessages

func (r *Repository) ListMessages(ctx context.Context, ownerID string, from, to time.Time) ([]*models.Message, error)

func (*Repository) SetUserID

func (r *Repository) SetUserID(ctx context.Context, username string, id int64) error

func (*Repository) SetWhitelisted

func (r *Repository) SetWhitelisted(ctx context.Context, userID int64, whitelisted bool) error

func (*Repository) UpsertUser

func (r *Repository) UpsertUser(ctx context.Context, user *models.User) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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